The present invention relates to a multi-sensor system that accommodates a large variety of sensors, and particularly relates to determination of disconnection of communication between a sensor terminal and a sensor accommodating terminal.
In the Internet of Things (IoT) society in which all things are connected to a network, a wide variety of sensors that can be connected to each other by wireless communication such as the Internet are distributed on the market. By collecting a large amount of data with these sensors and analyzing the data, useful information for humans is expected to be extracted. Specifically, sensor systems corresponding to various use cases and needs such as healthcare, structure monitoring, and global environment monitoring have been requested and developed.
For example, Non Patent Literature 1 proposes a sensor system in which a sensor accommodating terminal 401 such as a smartphone transfers data from a sensor terminal 400 to a server device 402 as illustrated in
In collecting data, it is important to ascertain a connection status between the sensor terminal and the sensor accommodating terminal in order to avoid power waste due to data retransmission and unintended operation of the sensor terminal operating in an environment with limited resources. As an index for ascertaining the connection status, a received signal strength indicator (RSSI), a signal to noise ratio (S/N ratio), and the like are used.
It is naturally desirable that all sensor terminals have sufficient quality. However, it is impossible for a manufacturer of a sensor terminal to guarantee sufficient quality in the environments of all users due to various use cases. In addition, it is difficult for a user to check the quality of all the sensor terminals to be used in advance. Therefore, a method of connecting a general-purpose sensor accommodating terminal capable of being connected to a sensor terminal including a wide variety of sensors to a sensor terminal whose function and quality are unknown is fully expected.
The connection state between the sensor terminal and the sensor accommodating terminal depends on the environment according to the use case. In an unstable communication environment, packet loss occurs. Packet loss may occur in various communication protocols. When packet loss occurs, data is usually retransmitted, but data is accumulated in the sensor terminal in parallel. That is, under a connection environment where packet loss frequently occurs, the data accumulation speed is faster than the data transmission speed, and the memory of the sensor terminal becomes tight.
Unlike a situation in which the connection between the sensor terminal and the sensor accommodating terminal is disconnected, in a situation in which packet loss occurs but the state does not shift to the disconnected state, there is a likelihood that a buffer overflow of the sensor terminal will occur unless appropriate memory management is performed. The operation of the sensor terminal when a buffer overflow occurs is undefined, and a serious failure may occur in some cases. Therefore, it is necessary to prevent the buffer overflow from occurring.
In a timeout method used in the related art, connection between a sensor terminal and a sensor accommodating terminal is maintained when the sensor accommodating terminal receives a packet from the sensor terminal at a reception interval that does not exceed a timeout period. However, in such a situation, there is a likelihood that the buffer overflow of the sensor terminal will occur as described above, and packet loss will continuously occur.
Embodiments of the present invention have been made to solve the above problems, and an object of embodiments of the present invention is to provide a sensor accommodating terminal, a disconnection determination method, and a disconnection determination program capable of reducing a likelihood of a buffer overflow of a sensor terminal and preventing an abnormal operation of the sensor terminal in advance.
According to embodiments of the present invention, there is provided a sensor accommodating terminal including: a communication control unit configured to control communication with a sensor terminal that wirelessly transmits a packet storing sensor data; a time stamp adding unit configured to acquire a time stamp of a reception time of the packet received from the sensor terminal; a memory configured to store the time stamp and a time stamp interval which is a time interval of two consecutive time stamps; a first variance calculation unit configured to calculate a first variance of a plurality of the time stamp intervals; a second variance calculation unit configured to calculate a second variance of the plurality of time stamp intervals newly obtained after calculation of the first variance; an evaluation value calculation unit configured to calculate a ratio of the second variance to the first variance as an evaluation value; and an equal variance determination unit configured to determine whether a reception interval of the packet is normal or abnormal by equal variance determination of the evaluation value.
Further, a configuration example of the sensor accommodating terminal of embodiments of the present invention further includes a clock unit configured to measure time, in which the time stamp adding unit acquires the time stamp on the basis of time information of the clock unit upon receiving a packet from the sensor terminal, the first variance calculation unit calculates the first variance on the basis of a first specified number of the time stamp intervals, the second variance calculation unit calculates the second variance on the basis of a second specified number of the time stamp intervals newly obtained after calculation of the first variance, the equal variance determination unit determines whether the reception interval of the packet is normal or abnormal by comparing the evaluation value with a critical value corresponding to a significance level of an F distribution, and the communication control unit disconnects the connection to the sensor terminal when the reception interval of the packet is determined to be abnormal.
Further, in a configuration example of the sensor accommodating terminal of embodiments of the present invention, the time stamp adding unit stores the latest time stamp and the time stamp intervals corresponding to the second specified number in the memory, and an area of the memory in which the time stamp intervals corresponding to the second specified number are stored has a ring buffer structure.
Further, in a configuration example of the sensor accommodating terminal of embodiments of the present invention, the first variance calculation unit sequentially calculates an average value by using the newly obtained time stamp interval and an average value of the time stamp intervals up to an immediately preceding time to store the average value in the memory, and sequentially calculates the first variance by using the newly obtained time stamp interval, the first variance up to an immediately preceding time, the average value up to an immediately preceding time, and the newly calculated average value to store the first variance in the memory, and the second variance calculation unit calculates the second variance on the basis of the second specified number of the time stamp intervals newly obtained after calculation of the first variance of the first specified number of the time stamp intervals.
Further, in a configuration example of the sensor accommodating terminal of embodiments of the present invention, the second variance calculation unit sequentially calculates an average value by using the newly obtained time stamp interval, an average value of the time stamp intervals up to an immediately preceding time, and an oldest time stamp interval stored in the memory to store the average value in the memory, and sequentially calculates the second variance by using the newly obtained time stamp interval, the second variance up to an immediately preceding time, the average value up to an immediately preceding time, the oldest time stamp interval stored in the memory, and the newly calculated average value to store the second variance in the memory.
Further, in a configuration example of the sensor accommodating terminal of embodiments of the present invention, the first variance calculation unit excludes, from calculation of the first variance, a time stamp interval obtained by receiving packets from the sensor terminal in which a communication state with the sensor accommodating terminal is determined to be abnormal, and calculates the first variance on the basis of a time stamp interval obtained by receiving packets from one or more sensor terminals in which a communication state with the sensor accommodating terminal is determined to be normal.
Further, in a configuration example of the sensor accommodating terminal of embodiments of the present invention, the first variance calculation unit calculates the first variance on the basis of a time stamp interval obtained by receiving packets from a plurality of the sensor terminals.
According to embodiments of the present invention, there is provided a disconnection determination method for determining whether to disconnect connection between a sensor terminal and a sensor accommodating terminal in a sensor system including the sensor terminal configured to wirelessly transmit a packet storing sensor data and the sensor accommodating terminal configured to transmit the sensor data included in the packet to a host device, the disconnection determination method including: a first step of acquiring, by the sensor accommodating terminal, a time stamp of a reception time of a packet received from the sensor terminal; a second step of storing, by the sensor accommodating terminal, the time stamp and a time stamp interval which is a time interval between two consecutive time stamps; a third step of calculating, by the sensor accommodating terminal, a first variance of a plurality of the time stamp intervals; a fourth step of calculating, by the sensor accommodating terminal, a second variance of a plurality of the time stamp intervals newly obtained after calculation of the first variance; a fifth step of calculating, by the sensor accommodating terminal, a ratio of the second variance to the first variance as an evaluation value; and a sixth step of determining, by the sensor accommodating terminal, whether a reception interval of the packet is normal or abnormal by equal variance determination of the evaluation value.
According to embodiments of the present invention, there is provided a disconnection determination program causing a computer to execute each of the above steps.
According to embodiments of the present invention, by providing the time stamp adding unit, the memory, the first variance calculation unit, the second variance calculation unit, the evaluation value calculation unit, and the equal variance determination unit in the sensor accommodating terminal, a likelihood of a buffer overflow of the sensor terminal can be reduced, and abnormal operation of the sensor terminal can be prevented in advance. As a result, in embodiments of the present invention, it is possible to improve stability of a sensor system while absorbing differences in communication specifications and designs of various sensor terminals at a low cost on the sensor accommodating terminal side.
In order to solve the above problems, it is necessary to ascertain a state of connection between a sensor terminal and a sensor accommodating terminal, and appropriately determine whether to continue or disconnect the connection to perform control. This control itself can be performed from either the sensor terminal or the sensor accommodating terminal. However, considering that a wide variety of sensor terminals are connected to the sensor accommodating terminal, it costs less to comprehensively perform control in the sensor accommodating terminal than to perform control in individual sensor terminals. In addition, when control is performed in the sensor accommodating terminal, it is possible to implement a large number of deployed sensor terminals without updating firmware, which is efficient.
Therefore, embodiments of the present invention propose a method for determining and controlling disconnection from a sensor terminal by a sensor accommodating terminal. Communication strength indexes such as an RSSI and an S/N ratio are useful information for performing the disconnection determination. However, there are two problems in using these communication strength indexes. The first problem is that since the communication strength index is a value obtained by the communication circuit, it is necessary to implement a communication strength index acquisition function in the communication circuit.
The second problem is that even if the communication strength index acquisition function is implemented in the communication circuit, it is not always possible to access the information on the communication strength index from the application software side. The reason why the information on the communication strength index cannot be accessed from the application software side is that the information on the communication strength index is deleted by driver software or an operating system (OS). The problem that the necessary information cannot be accessed similarly occurs in the use of the communication packet information.
Bluetooth (registered trademark) Low Energy (BLE) is the most widely used standard for communication between a sensor terminal and a sensor accommodating terminal. In BLE, it is specified that information available for preventing occurrence of a buffer overflow of a sensor terminal is stored in a communication packet.
Specifically, 1-bit information called a more data (MD) flag is stored in a header in a data channel protocol data unit (PDU). The MD flag indicates the presence or absence of data that has not yet been transmitted. The specification of BLE is disclosed in the literature “‘Bluetooth Core Specification v5.1,’ Bluetooth SIG Proprietary, 2019.”
If the MD flag can be used, the presence or absence of the remaining data can be ascertained, and therefore it can be used to avoid a buffer overflow. However, as described above, there is a likelihood that the MD flag will not be able to be accessed from the application side depending on the specifications of the driver software and the OS.
For the above reasons, the present invention proposes a method of performing the disconnection determination for avoiding the buffer overflow of the sensor terminal in the sensor accommodating terminal without using the specific header information of the communication packet.
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
The sensor terminal 1 includes a control unit 10 including a central processing unit (CPU) or a micro control unit (MCU), a wireless circuit 11 controlled by the control unit 10, a sensor circuit 12 that measures a physical quantity, and a memory 13 that stores a program of the control unit 10 and holds data acquired by the sensor circuit 12 until transmission. The control unit 10 includes a communication control unit 100 that controls communication with the sensor accommodating terminal 2.
The sensor accommodating terminal 2 includes a control unit 20 including a CPU or an MCU, a wireless circuit 21 that is controlled by the control unit 20 and performs wireless communication with the sensor terminal 1, a communication circuit 22 that is controlled by the control unit 20 and performs communication with a server device (not illustrated), a memory 23 that stores a program, a time stamp, and a time stamp interval of the control unit 20, and a clock unit 24 that measures time.
The control unit 20 includes a communication control unit 200 that controls communication with the sensor terminal 1 and the server device, a time stamp adding unit 201 that acquires a time stamp of a reception time of a packet received from the sensor terminal 1, and a disconnection determination unit 202 that performs disconnection determination of communication with the sensor terminal 1.
Since the CPU or the MCU constituting the control unit 20 of the sensor accommodating terminal 2 needs to perform calculation processing, it is necessary to select one having high calculation capability. On the other hand, an essential function of the sensor terminal 1 is to acquire data from the sensor circuit 12 and transmit the data to the sensor accommodating terminal 2 by wireless communication. Therefore, the CPU or MCU constituting the control unit 10 of the sensor terminal 1 may have low performance, and there is no problem.
The sensor circuit 12 of the sensor terminal 1 outputs sensor data including information on the measured physical quantity. This sensor data is temporarily stored in the memory 13. The communication control unit wo of the sensor terminal 1 causes the wireless circuit 11 to transmit a packet storing the data acquired from the sensor circuit 12 to the sensor accommodating terminal 2 at a constant cycle Tsend.
The communication control unit 200 of the sensor accommodating terminal 2 receives the packet transmitted from the sensor terminal 1 via the wireless circuit 21. The clock unit 24 of the sensor accommodating terminal 2 outputs time information of year, month, day, hour, minute, and second. The time stamp adding unit 201 of the sensor accommodating terminal 2 acquires time information (time stamp) upon receiving a packet from the sensor terminal 1 and stores the time information in the memory 23. In
An expected value E[dn] of a time interval dn−1=Tn−Tn−1 between the two consecutive time stamps Tn−1 and Tn coincides with a predefined transmission cycle Tsend. Each time stamp has a potentially random variation component relative to the expected value. Therefore, the distribution of a time interval d of the time stamps can be considered to follow a normal distribution N(Tsend, σstamp2)(σstamp2 is a variance).
When the communication environment deteriorates, the packet arrival interval is not constant, and thus, it is considered that the expected value and the variance of the time interval of the time stamp change. Therefore, if it is found that the expected value or variance of the time interval has significantly changed from the value in the normal communication environment, it is possible to determine disconnection from the sensor terminal 1.
As described above, when the communication environment deteriorates, it is considered that the expected value and the variance of the time interval of the time stamp change, and thus, the expected value and the variance can be used for the disconnection determination.
However, there is also a communication protocol that transmits data at intervals shorter than the defined transmission cycle Tsend when data transfer is delayed due to packet loss or the like. Therefore, as illustrated in
For example, according to BLE, which is a communication protocol widely used in sensor terminals, a sensor terminal performs communication only at a specified connection interval at the time of connection with a sensor accommodating terminal, and attempts transmission at a connection interval immediately after occurrence of an event of transmitting data. This connection interval is generally shorter than the data transmission cycle Tsend. When data transmission fails, the sensor terminal attempts retransmission at the next connection interval. Therefore, there is a likelihood that the sensor accommodating terminal will record a time stamp interval shorter than Tsend.
Therefore, in the present embodiment, the disconnection determination is performed as follows using only the variance instead of the expected value of the time stamp interval.
When the connection with the sensor terminal 1 is established (step S100 in
The time stamp adding unit 201 acquires a time stamp upon receiving a packet from the sensor terminal 1 and stores the time stamp in the memory 23. In addition, the time stamp adding unit 201 calculates a time interval between the acquired time stamp and the previous time stamp and stores the time interval in the memory 23 (step S101 in
When n1+1(n1 is a first specified number, and is an integer of 2 or more) time stamps are stored in the memory 23 (YES in step S102 in
As initialization processing of the disconnection determination, the reference variance calculation unit 2021 calculates a variance σstamp2-hat for n1 time stamp intervals d1,i as in the following expression (step S103 in
Similarly to step S101, the time stamp adding unit 201 acquires a time stamp upon receiving a packet from the sensor terminal 1 and stores the time stamp in the memory 23. In addition, the time stamp adding unit 201 calculates the interval between the acquired time stamp and the previous time stamp and stores the interval in the memory 23 (step S104 in
When n2+1 (n2 is a second specified number, and is an integer of 2 or more) time stamps different from the n1+1 time stamps are stored in the memory 23 (YES in step S105 in
The variance calculation unit 2022 calculates a variance σeval2-hat for the n2 time stamp intervals d2,i as in the following expression (step S106 in
The evaluation value calculation unit 2023 calculates a ratio σeval2-hat/σstamp2-hat of the variance σeval2-hat to the variance σstamp2-hat as an evaluation value (step S107 in
The equal variance determination unit 2024 determines whether the evaluation value σeval2-hat/σstamp2-hat is equal to or greater than a critical value F(n2-1, n1-1; α) corresponding to a significance level α of an F distribution of a degree of freedom (n2-1, n1-1) as in the following expression (step S108 in
When Expression (3) is satisfied, the equal variance determination unit 2024 determines that σeval2-hat has changed with respect to the variance σstamp2-hat, and determines that the packet reception interval is abnormal. When it is determined to be abnormal, the communication control unit 200 disconnects the connection to the sensor terminal 1.
In addition, when the evaluation value σeval2-hat/σstamp2-hat is smaller than F(n2-1, n1-1; α) and Expression (3) is not satisfied, the equal variance determination unit 2024 determines that the variances σstamp2-hat and σeval2-hat are equal and the packet reception interval is normal. In a normal case, the connection with the sensor terminal 1 is maintained, and the processing in and after step S104 is performed for a new time stamp.
According to the above method, in the present embodiment, a significant change in σeval2-hat with respect to the variance σstamp2-hat in the normal state can be recognized, and the disconnection determination can be performed at an arbitrary level of the user. Here, in order to perform disconnection determination with a small temporal loss after calculation of the variance σstamp2-hat which is a reference value, it is preferable to set n1≥n2.
In the timeout method, an appropriate threshold value needs to be set, and there is a likelihood that frequent disconnection or an event that disconnection cannot be performed will occur. As a result, since the sensor terminal and the sensor accommodating terminal are not disconnected, a buffer overflow of the sensor terminal occurs at time t2. Due to the occurrence of the buffer overflow, a timeout cannot be made in time as at point rdi, and there is a likelihood that the buffer overflow will occur and an abnormal operation will occur.
On the other hand, b of
In the present embodiment, by performing disconnection on the basis of the equal variance determination result of the evaluation value, it is possible to identify the instability of the communication environment from the variation in the reception intervals and perform the disconnection processing at timing earlier than the occurrence of the buffer overflow of the sensor terminal 1. Therefore, abnormal operation of the sensor terminal 1 can be prevented in advance.
In addition, the sensor terminal 1 is generally in a connection standby state after disconnection, and is connected to the sensor accommodating terminal 2 again after the connection standby state. When the sensor terminal 1 enters the connection standby state, the buffer is cleared. Therefore, buffer overflow does not occur at the timing of occurrence in the related art, and the sensor terminal 1 can be continuously operated. As a result, in the present embodiment, it is possible to improve stability of a sensor system while absorbing differences in communication specifications and designs of various sensor terminals 1 at a low cost on the sensor accommodating terminal 2 side.
The present embodiment is particularly suitable in a communication protocol in which retransmission, that is, burst transmission, is performed at a higher speed than a specified transmission cycle when there is untransmitted data.
Subsequently, a second embodiment of the present invention will be described. The present embodiment describes a method of reducing the used memory amount in the first embodiment. The configurations of the sensor terminal 1 and the sensor accommodating terminal 2 in the present embodiment are the same as those in the first embodiment.
In the first embodiment, it is necessary to accumulate the time stamp intervals for calculating the reference value and the evaluation value, which consumes the memory 23. Since the capacity of the memory 23 of the sensor accommodating terminal 2 is generally not abundant and limited, it is not possible to continue to accumulate all of the time stamps and the time stamp intervals. Therefore, the present embodiment proposes a method of saving the used memory amount.
Typically, the variance σstamp2-hat is calculated every time a targeted time stamp interval is obtained. However, while such a calculation method is simple and reliable, a large amount of memory is consumed, and a calculation amount cannot be ignored when a repeated operation is performed.
Therefore, the reference variance calculation unit 2021 of the present embodiment performs sequential calculation of updating a value using the current average value and variance when a new time stamp interval is obtained.
In Expressions (4) and (5), a dn-bar is an average value up to the n-th time stamp interval, and σstamp,n2-hat is a variance up to the n-th time stamp interval. The reference variance calculation unit 2021 uses an n+1-th time stamp interval dn+1 and the average value dn-bar to calculate an average value dn+1-bar up to the n+i-th time stamp interval as shown in Expression (4).
In addition, the reference variance calculation unit 2021 uses the variance σstamp,n2-hat and the average values dn-bar and dn+1-bar to calculate a variance σstamp,n+12-hat up to the n+1-th time stamp interval as shown in Expression (5).
By performing the sequential calculation as described above, it is possible to perform necessary calculation without accumulating all the time stamp intervals d in the memory 23. Since the value required here is not the time stamp T itself but the time stamp interval d, the time stamp T stored in the memory 23 may be only the latest value for calculating the time stamp interval d.
In the example of
When the time stamp T2 is obtained, the time stamp adding unit 201 updates the time stamp T1 stored in the memory 23 to the time stamp T2 as illustrated in (c) of
When the time stamp Tn1+1 is obtained, the time stamp adding unit 201 updates the time stamp Tn1 stored in the memory 23 to the time stamp Tn1+1. Then, the time stamp adding unit 201 sets a counter indicating the number of times of acquisition of the time stamp T to n1+1. Further, the time stamp adding unit 201 stores the time stamp interval dn1=Tn1+1−Tn1 in the memory 23.
The reference variance calculation unit 2021 calculates an average value dn1-bar using the average value dn1−1-bar and the time stamp interval dn1 stored in the memory 23 in the same manner as in Expression (4), and updates the average value dn1−1-bar stored in the memory 23 to the dn1-bar.
In addition, the reference variance calculation unit 2021 calculates a variance σstamp,m2-hat in the same manner as in Expression (5) using the variance σstamp,n1−12-hat and the average value dn1−1-bar stored in the memory 23, the newly calculated average value dn1-bar, and time stamp interval dn1, and updates the variance σstamp,n1−12-hat stored in the memory 23 to the σstamp,n12-hat.
Subsequently, the variance σeval2-hat cannot be calculated by sequential calculation of the variance σstamp2-hat in the foregoing expression. This is because when the new time stamp interval d is obtained, the oldest one of the n2 time stamp intervals d has to be discarded, and the variance σeval2-hat has to be recalculated with the n2 values including the new time stamp interval d. Therefore, it is necessary to always hold the n2 time stamp intervals d in the memory 23.
On the other hand, since all the time stamp intervals d necessary for the calculation are held in the memory 23, the variance σeval2-hat may be calculated every time using all the time stamp intervals d. However, a calculation amount of O(n2) is required for one calculation, and when the communication state is evaluated m times, a calculation amount of O(mn2) is required, and the processing capability of the sensor accommodating terminal 2 becomes tight.
Therefore, the variance calculation unit 2022 of the present embodiment performs sequential calculation of updating the value using the current average value and variance when the new time stamp interval d is obtained. Thereby, the calculation amount can be reduced to O(m).
When m+1 time stamp intervals d are obtained after the calculation of the variance σstamp2-hat by the reference variance calculation unit 2021 (m≥n2), the variance calculation unit 2022 calculates an average value dn2,m+1-bar as shown in Expression (6) using the time stamp interval dm+1, the average value dn2,m-bar stored in the memory 23, and the time stamp interval dm+n2+1 stored in the memory 23, and updates the average value dn2,m-bar stored in the memory 23 to the dn2,m+1-bar. Expression (6) is an update expression of the average value of the latest n2 time stamp intervals d.
Furthermore, the variance calculation unit 2022 calculates a variance σeval,m+12-hat as shown in Expression (7) using the time stamp interval dm+1, the variance σeval,m2-hat, the average value dn2,m-bar, and the time stamp interval dm−n2+1 stored in the memory 23, and the newly calculated average value dn2,m+1-bar, and updates the variance σeval,m2-hat stored in the memory 23 to the σeval,m+12-hat.
An area of the memory 23 in which the n2 time stamp intervals d are stored has a ring buffer structure, and thus reading and writing from and to the memory 23 can be efficiently performed. One round of the ring buffer leads to the oldest data.
In the sequential calculation of the average value dn2,m+1-bar of Expression (6), a value obtained by dividing the oldest time stamp interval dm−n2+1 by n2 is subtracted, and a value obtained by dividing the new time stamp interval dm+1 by n2 is added. Before overwriting the old average value dn2,m-bar stored in the memory 23 with the average value dn2,m+1-bar, memory access can be performed without waste by reading the average value dn2,m-bar from the memory 23. Similarly, before overwriting the old variance σeval,m2-hat stored in the memory 23 with the variance σeval,m+12-hat, memory access can be performed without waste by reading the variance σeval,m2-hat from the memory 23.
The time stamp adding unit 201 resets the counter recorded in the memory 23 to 0 (step S200 in
The time stamp adding unit 201 acquires the time stamp T again, and updates the time stamp T stored in the memory 23 to the newly acquired time stamp T (step S203 in
The reference variance calculation unit 2021 calculates the average value d-bar of the time stamp interval d and the variance σstamp2-hat as shown in Expressions (4) and (5), and stores the average value d-bar and the variance σstamp2-hat in the memory 23 (step S205 in
The variance calculation unit 2022 calculates the average value d-bar of the time stamp interval d and the variance σeval2-hat as show in Expressions (6) and (7) and stores the average value d-bar and the variance σeval2-hat in the memory 23 (step S206 in
The time stamp adding unit 201 increments the counter by 1 (step S207 in
The processing of steps S209, S210, and S211 is the same as that of steps S203, S204, and S206. Thereafter, the processing of steps S209 to S211 is repeatedly performed.
Note that, when the connection between the sensor terminal 1 and the sensor accommodating terminal 2 is completely disconnected, only the variance calculated as the reference value may be left, and the area other than the variance may be cleared, or all the memory areas used in the present embodiment may be cleared.
Subsequently, a third embodiment of the present invention will be described. The present embodiment describes, in the first and second embodiments, an initialization method in the case where the communication environment is poor immediately after the start of connection between the sensor terminal and the sensor accommodating terminal, and a method of improving the real-time performance by speeding up the initialization processing.
In the first and second embodiments, it is assumed that the variances σstamp2-hat and σeval2-hat are calculated by receiving packets from one sensor terminal 1.
However, in the multi-sensor system as illustrated in
In addition, the variance σstamp2-hat is affected by the error of the time stamp caused by the capability of the OS of the sensor accommodating terminal 2 and the clock accuracy. Therefore, the variance σstamp2-hat does not vary depending on each sensor terminal 1, but can be considered as a variable determined by the sensor accommodating terminal 2. That is, the variance σstamp2-hat is a common value in the sensor terminals 1 connected to the same sensor accommodating terminal 2.
Therefore, the reference variance calculation unit 2021 of the sensor accommodating terminal 2 calculates the variance σstamp2-hat on the basis of the time stamp interval obtained by receiving packets from one or more sensor terminals 1 that can normally communicate other than the sensor terminal 1A.
The reference variance calculation unit 2021 determines normality of communication between one or more sensor terminals 1 connected to the sensor accommodating terminal 2 and the sensor accommodating terminal 2 (step S300 in
As an index for determining the normality of communication, a reception interval can be used. Specifically, the reference variance calculation unit 2021 may determine that the communication state with the sensor terminal 1 is abnormal when the difference between the reception interval of the packet from the sensor terminal 1 and the predefined transmission cycle Tsend of the sensor terminal 1 exceeds the defined value, and may determine that the communication state with the sensor terminal 1 is normal when the difference between the reception interval of the packet and the transmission cycle Tsend is equal to or less than the defined value.
The reference variance calculation unit 2021 calculates the average value d-bar of the time stamp intervals d similarly to the first and second embodiments (step S301 in
Then, the reference variance calculation unit 2021 calculates the variance σstamp2-hat of the time stamp interval d similarly to the first and second embodiments (step S302 in
Thus, in the present embodiment, the disconnection determination can be performed regardless of the communication environment at the time of connection.
Furthermore, in the present embodiment, when the average value d-bar and the variance σstamp2-hat are calculated on the basis of the time stamp interval obtained by receiving packets from a plurality of sensor terminals 1 that can normally communicate, the time required for the initialization processing can be shortened, and the real-time performance can be improved.
There are S (S is an integer of 2 or more) sensor terminals 1 that can normally communicate, and a predefined transmission cycle of each sensor terminal 1 is denoted by Tsendi, and the number of data used for initialization processing is denoted by K (K is an integer of 2 or more). When the transmission cycles Tsendi are all the same value Tsend, a time T required for the initialization processing is as follows.
Furthermore, when the transmission cycles Tsendi of the sensor terminals 1 are different from each other, the time T required for the initialization processing is as follows.
In this way, in the present embodiment, the initialization processing can be speeded up, and the time until the disconnection determination is performed can be shortened.
When the transmission cycles Tsendi are all the same value Tsend, it is possible to collect initialization data most efficiently by setting the number of data K to a multiple of the number S of the sensor terminals 1.
The control unit 20 of the sensor accommodating terminal 2 described in the first to third embodiments can be realized by a computer including a CPU or an MCU, a storage device, and an interface, and a program for controlling these hardware resources. A configuration example of this computer is illustrated in
The computer includes a CPU 300, a storage device 301, and an interface device (I/F) 302. The wireless circuit 21, the communication circuit 22, the clock unit 24, and the like are connected to the I/F 302. In such a computer, the disconnection determination program for realizing the disconnection determination method according to embodiments of the present invention is stored in the storage device 301. The CPU 300 executes the processes described in the first to third embodiments according to the program stored in the storage device 301. The program may also be provided via a network. The control unit 10 of the sensor terminal 1 can also be realized by a computer.
Embodiments of the present invention can be applied to a multi-sensor system that accommodates a large variety of sensors.
This application is a national phase entry of PCT Application No. PCT/JP2020/042248, filed on Nov. 12, 2020, which application is hereby incorporated herein by reference.
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/JP2020/042248 | 11/12/2020 | WO |