SENSOR HOLDING TERMINAL, DISCONNECTION DETECTION METHOD, AND DISCONNECTION DETECTION PROGRAM
The sensor-accommodating terminal uses time stamping and statistical analysis to detect abnormal packet reception intervals, preventing buffer overflows and ensuring stability in multi-sensor systems by disconnecting sensors in unstable conditions.
Patent Information
- Application Number
- JP2022561781
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2020-11-12
- Publication Date
- 2024-09-18
- Estimated Expiration
- 2040-11-12
AI Technical Summary
Existing sensor systems face challenges in managing buffer overflows and abnormal operations due to unpredictable packet loss and connection instability, especially when connecting a variety of sensor terminals with unknown quality and environment-dependent communication conditions.
A sensor-accommodating terminal equipped with a communication control unit, time stamping mechanism, and disconnection determination logic to assess packet reception intervals, using statistical methods to detect abnormality and disconnect sensors to prevent buffer overflows.
The solution effectively reduces the risk of buffer overflows and maintains system stability by proactively disconnecting sensors in unstable conditions, adapting to various sensor terminals with different specifications at a lower cost.
Smart Images

Figure 0007552721000021 
Figure 0007552721000015 
Figure 0007552721000013
Abstract
Description
[Technical field]
[0001] The present invention relates to a multi-sensor system that accommodates a large number of different sensors, and more particularly to determining whether communication between a sensor terminal and a sensor accommodation terminal has been disconnected. [Background technology]
[0002] In an IoT (Internet of Things) society where everything is connected to a network, a wide variety of sensors that can be connected to each other via wireless communication such as the Internet are available on the market. It is expected that these sensors will collect large amounts of data, and by analyzing the data, we can extract information that is useful to humans. Specifically, there has been a demand for and development of sensor systems that can meet various use cases and needs, such as healthcare, structural monitoring, and global environmental monitoring.
[0003] For example, Non-Patent Document 1 proposes a sensor system in which a sensor containing terminal 401 such as a smartphone transfers data from a sensor terminal 400 to a server device 402 as shown in Fig. 13. The sensor terminal 400 and the sensor containing terminal 401 are connected by short-range wireless communication, and the sensor containing terminal 401 and the server device 402 are connected by medium- to long-range wired communication or wireless communication.
[0004] When collecting data, it is important to understand the connection status between the sensor terminal and the sensor hosting terminal in order to avoid power waste and unintended operation due to data retransmission by the sensor terminal operating in a resource-limited environment. Indices used to understand the connection status include the Received Signal Strength Indicator (RSSI) and the Signal to Noise Ratio (S / N Ratio).
[0005] Naturally, it is desirable for all sensor terminals to have sufficient quality guaranteed. However, due to the wide variety of use cases, it is impossible for sensor terminal manufacturers to guarantee sufficient quality in all user environments. It is also difficult for users to check in advance the quality of all sensor terminals they will use. Therefore, a general-purpose sensor storage terminal that can be connected to sensor terminals including a wide variety of sensors is likely to be connected to sensor terminals whose functions and quality are unknown.
[0006] The connection state between a sensor terminal and a sensor host terminal depends on the environment according to the use case. In an unstable communication environment, packet loss occurs. Packet loss can occur with various communication protocols. When packet loss occurs, data is usually retransmitted, but data accumulation in the sensor terminal also occurs in parallel. In other words, in a connection environment where packet loss occurs frequently, the data accumulation speed is faster than the data transmission speed, and the memory of the sensor terminal becomes tight.
[0007] Unlike a situation where the connection between a sensor node and a sensor containing node is disconnected, a situation where packet loss occurs but the node does not transition to a disconnected state may cause a buffer overflow in the sensor node unless appropriate memory management is performed. The behavior of the sensor node when a buffer overflow occurs is undefined, and in some cases serious failures may occur. For this reason, it is necessary to prevent buffer overflows from occurring.
[0008] In the timeout method used in the conventional technology, if the sensor containing terminal receives packets from the sensor terminal at a reception interval that does not exceed the timeout time, the connection between the sensor terminal and the sensor containing terminal is maintained. However, in such a situation, as described above, a buffer overflow of the sensor terminal may occur, causing continuous packet loss. [Prior art documents] [Non-patent literature]
[0009] [Non-Patent Document 1] Kenichi Matsunaga, Naoichi Oshima, Musa Ahmad, Toshihiko Kondo, Hiroki Morimura, “Proposal of a Multi-Sensor Data Collection Technique Suitable for IoT”, Proceedings of the 2016 Society Conference of the Institute of Electronics, Information and Communication Engineers (IEICE) Summary of the Invention [Problem to be solved by the invention]
[0010] The present invention has been made to solve the above-mentioned problems, and aims to provide a sensor containing terminal, a disconnection determination method, and a disconnection determination program that can reduce the possibility of buffer overflow in a sensor terminal and prevent abnormal operation of the sensor terminal. [Means for solving the problem]
[0011] Books The sensor containing terminal of the invention includes a communication control unit configured to control communication with a sensor terminal that wirelessly transmits a packet storing sensor data, a time stamp assignment unit configured to acquire a time stamp of a reception time of a packet received from the sensor terminal, a memory configured to store the time stamp and a time stamp interval that is the time interval between two consecutive time stamps, a reference value determination unit configured to determine a reference value of the time stamp interval, an anomaly degree calculation unit configured to calculate an anomaly degree based on the reference value and the newly obtained time stamp interval, and an anomaly degree determination unit configured to determine whether the reception interval of the packet is normal or abnormal based on the anomaly degree, wherein the reference value is an expected value and deviation of the time stamp interval, and the reference value determination unit calculates the expected value and the deviation based on a plurality of the time stamp intervals, or calculates only the deviation using a predefined transmission period of the sensor terminal as the expected value. The communication control unit disconnects the connection with the sensor terminal when the packet reception interval is determined to be abnormal. It is characterized by the above.
[0012] Moreover, one configuration example of the sensor containing terminal of the present invention further includes a clock unit configured to measure time, and when the time stamp giving unit receives a packet from the sensor terminal, the time stamp giving unit obtains the time stamp based on time information from the clock unit, and the anomaly degree calculation unit calculates a χ 2 The degree of abnormality according to the distribution is calculated, and the abnormality determination unit determines whether the reception interval of the packets is normal or abnormal by comparing the degree of abnormality with a threshold value. do It is characterized by the above.
[0013] Furthermore, one configuration example of the sensor containing terminal of the present invention is characterized in that it further includes an average value calculation unit configured to calculate the average value of a specified number of the timestamp intervals, and the anomaly degree calculation unit calculates the anomaly degree based on the reference value and the average value of the timestamp intervals. Furthermore, in one configuration example of the sensor containing terminal of the present invention, the average value calculation unit is characterized in that, before calculating the average value of the timestamp intervals, it determines the specified number so that the degree of anomaly calculated from the delay time from a predetermined transmission period, the deviation, and the specified number exceeds the threshold value. Furthermore, in one configuration example of the sensor containing terminal of the present invention, the time stamp assignment unit stores the latest time stamp and the specified number of time stamp intervals in the memory, the reference value determination unit sequentially calculates the expected value and the deviation based on a plurality of the time stamp intervals, or sequentially calculates only the deviation using a predetermined transmission period of the sensor terminal as the expected value, the average value calculation unit sequentially calculates the average value of the specified number of time stamp intervals, and the memory is characterized in that the area in which the specified number of time stamp intervals are stored has a ring buffer structure.
[0014] Furthermore, in one configuration example of the sensor containing terminal of the present invention, when calculating the expected value, the reference value determination unit excludes from the calculation of the expected value a timestamp interval obtained by receiving packets from the sensor terminal whose communication state with the sensor containing terminal has been determined to be abnormal, and calculates the expected value based on the timestamp interval obtained by receiving packets from one or more of the sensor terminals whose communication state with the sensor containing terminal has been determined to be normal; and when calculating the deviation, the reference value determination unit excludes from the calculation of the deviation a timestamp interval obtained by receiving packets from the sensor terminal whose communication state with the sensor containing terminal has been determined to be abnormal, and calculates the deviation based on the timestamp interval obtained by receiving packets from one or more of the sensor terminals whose communication state with the sensor containing terminal has been determined to be normal. Furthermore, in one configuration example of the sensor containing terminal of the present invention, the reference value determination unit is characterized in that it sets a predetermined transmission period of the sensor terminal as the expected value, and when calculating the deviation, it calculates the deviation based on a timestamp interval obtained by receiving packets from a plurality of the sensor terminals.
[0015] AlsoThe present invention provides a disconnection determination method for determining whether to disconnect a connection between a sensor terminal and a sensor containing terminal in a sensor system including a sensor terminal configured to wirelessly transmit a packet storing sensor data, and a sensor containing terminal configured to transmit the sensor data included in the packet to a higher-level device, the disconnection determination method including a first step in which the sensor containing terminal acquires a timestamp of a reception time of a packet received from the sensor terminal, a second step in which the sensor containing terminal stores the timestamp and a timestamp interval which is the time interval between two consecutive timestamps, a third step in which the sensor containing terminal determines a reference value for the timestamp interval, a fourth step in which the sensor containing terminal calculates an anomaly level based on the reference value and the newly obtained timestamp interval, and a fifth step in which the sensor containing terminal determines whether the reception interval of the packet is normal or abnormal based on the anomaly level, the reference value being an expected value and deviation of the timestamp interval, and the third step including a step of calculating the expected value and the deviation based on a plurality of the timestamp intervals, or calculating only the deviation using a predefined transmission period of the sensor terminal as the expected value. A cut-off determination program according to the present invention is characterized in that it causes a computer to execute the above steps. Effect of the Invention
[0016] According to the present invention, by providing a time stamp assignment unit, a memory, a reference value determination unit, an anomaly degree calculation unit, and an anomaly degree determination unit in a sensor containing terminal, it is possible to reduce the possibility of a buffer overflow in the sensor terminal and prevent abnormal operation of the sensor terminal. As a result, the present invention makes it possible to improve the stability of the sensor system while absorbing differences in communication specifications and designs of various sensor terminals at low cost on the sensor containing terminal side. [Brief description of the drawings]
[0017] [Figure 1]FIG. 1 is a block diagram showing a configuration of a sensor system according to a first embodiment of the present invention. [Diagram 2] FIG. 2 is a block diagram showing a configuration of a disconnection determination unit of a sensor containing terminal according to a first embodiment of the present invention. [Diagram 3] FIG. 3 is a schematic diagram showing a flow of communication from a sensor terminal to a sensor containing terminal according to the first embodiment of the present invention. [Figure 4] FIG. 4 is a diagram showing an overview of a disconnection determination made by a disconnection determination unit of a sensor containing terminal according to the first embodiment of the present invention. [Diagram 5] FIG. 5 is a flowchart for explaining the operations of the communication control unit, the time stamp providing unit, and the disconnection determination unit of the sensor containing terminal according to the first embodiment of the present invention. [Figure 6] FIG. 6 is a block diagram showing a configuration of a disconnection determination unit of a sensor containing terminal according to the second embodiment of the present invention. [Figure 7] FIG. 7 is a flowchart for explaining the operations of the communication control unit, the time stamp providing unit, and the disconnection determination unit of the sensor containing terminal according to the second embodiment of the present invention. [Figure 8] FIG. 8 is a diagram illustrating an example of a change in the reception interval of the sensor containing terminal according to the second embodiment of the present invention. [Figure 9] FIG. 9 is a diagram for explaining a disconnection determination process according to the conventional timeout method and the first and second embodiments of the present invention. [Figure 10] FIG. 10 is a diagram for explaining a method of storing data in a memory of a sensor containing terminal according to a fourth embodiment of the present invention. [Figure 11] FIG. 11 is a flowchart illustrating the operation of the reference value determination unit of the sensor containing terminal according to the fifth embodiment of the present invention. [Figure 12] FIG. 12 is a block diagram showing an example of the configuration of a computer that realizes the control unit of the sensor containing terminal according to the first to fifth embodiments of the present invention. [Figure 13] FIG. 13 is a block diagram showing the configuration of a conventional sensor system. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0018] [Principle of the invention] To solve the above problem, it is necessary to grasp the connection status between the sensor terminal and the sensor containing terminal, and to appropriately determine and control whether to continue or cut off the connection. This control itself can be performed from either the sensor terminal or the sensor containing terminal. However, considering that a wide variety of sensor terminals will be connected to the sensor containing terminal, it is less expensive to perform comprehensive control in the sensor containing terminal than to perform control in each individual sensor terminal. In addition, performing control in the sensor containing terminal is efficient because it can be implemented without updating the firmware of many sensor terminals that have already been deployed.
[0019] Therefore, in this invention, we propose a method for a sensor accommodation terminal to determine and control disconnection with a sensor terminal. Communication strength indicators such as RSSI and S / N ratio are useful information for determining disconnection. However, there are two problems with using these communication strength indicators. The first problem is that since the communication strength indicator is a value obtained by the communication circuit, it is necessary for the communication circuit to be equipped with a function for acquiring the communication strength indicator.
[0020] The second problem is that even if a communication circuit is equipped with a function for acquiring communication strength indicators, it is not necessarily possible to access the communication strength indicator information from the application software side. The reason why the communication strength indicator information cannot be accessed from the application software side is because the communication strength indicator information is deleted by the driver software or the OS (Operating System). The problem of not being able to access necessary information also occurs when using communication packet information.
[0021] The most widely used standard for communication between sensor nodes and sensor containing nodes is Bluetooth (registered trademark) Low Energy (BLE). BLE specifies that usable information should be stored in communication packets to prevent buffer overflow in sensor nodes.
[0022] Specifically, a one-bit piece of information called the MD (More Data) flag is stored in the header of the data channel PDU (Protocol Data Unit). The MD flag indicates whether there is data that has not yet been transmitted. The BLE specifications are disclosed in the document “Bluetooth Core Specification v5.1”, Bluetooth SIG Proprietary, 2019.
[0023] If the MD flag could be used, it would be possible to determine whether there is remaining data, which could be used to avoid buffer overflows. However, as mentioned above, depending on the driver software and OS specifications, it may not be possible to access the MD flag from the application side.
[0024] For the above reasons, the present invention proposes a method in which the sensor containing terminal performs a disconnection judgment to avoid buffer overflow in the sensor terminal, without using specific header information of a communication packet.
[0025] [First Example] Hereinafter, embodiments of the present invention will be described with reference to the drawings. Fig. 1 is a block diagram showing the configuration of a sensor system according to a first embodiment of the present invention. The sensor system is composed of a sensor terminal 1 that wirelessly transmits packets storing sensor data, and a sensor containing terminal 2 that transmits the sensor data contained in the packets received from the sensor terminal 1 to a higher-level device such as a server device.
[0026] The sensor terminal 1 includes a control unit 10 configured by a CPU (Central Processing Unit) or MCU (Micro Control Unit), 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 the program of the control unit 10 and holds data acquired by the sensor circuit 12 until the data is transmitted. The control unit 10 includes a communication control unit 100 that controls communication with the sensor containing terminal 2.
[0027] The sensor containing terminal 2 comprises a control unit 20 constituted by a CPU or MCU, a wireless circuit 21 controlled by the control unit 20 and performing wireless communication with the sensor terminal 1, a communication circuit 22 controlled by the control unit 20 and performing communication with a server device (not shown), a memory 23 that stores the program, timestamps and timestamp intervals of the control unit 20, and a clock unit 24 that measures time.
[0028] The control unit 20 includes a communication control unit 200 that controls communication with the sensor terminal 1 and the server device, a timestamp assignment unit 201 that acquires a timestamp of the reception time of a packet received from the sensor terminal 1, and a disconnection determination unit 202 that determines whether communication with the sensor terminal 1 has been disconnected.
[0029] 2 is a block diagram showing the configuration of disconnection determination unit 202. Disconnection determination unit 202 includes a timestamp interval input unit 2020 that acquires a timestamp interval from memory 23, a preprocessing calculation unit 2021 that performs preprocessing on the timestamp interval, a reference value determination unit 2022 that determines a reference value for the timestamp interval, anomaly degree calculation unit 2023 that calculates an anomaly degree based on the reference value and the newly obtained timestamp interval, and anomaly degree determination unit 2024 that determines whether the packet reception interval is normal or abnormal based on the anomaly degree.
[0030] The CPU or MCU constituting the control unit 20 of the sensor containing terminal 2 must perform calculation processing, so it is necessary to select one with high calculation capabilities. On the other hand, the essential function of the sensor terminal 1 is to acquire data from the sensor circuit 12 and transmit the data to the sensor containing terminal 2 via wireless communication. For this reason, there is no problem with a CPU or MCU constituting the control unit 10 of the sensor terminal 1 having low performance.
[0031] FIG. 3 is a schematic diagram showing a flow of communication from the sensor terminal 1 to the sensor accommodation terminal 2 in this embodiment. 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 100 of the sensor terminal 1 transmits a packet storing the data acquired from the sensor circuit 12 to the sensor terminal 1 at a fixed period T send Then, the signal is transmitted from the wireless circuit 11 to the sensor housing terminal 2.
[0032] The communication control unit 200 of the sensor containing terminal 2 receives the packet transmitted from the sensor terminal 1 via the wireless circuit 21. The clock unit 24 of the sensor containing terminal 2 outputs time information of year, month, day, hour, minute, and second. The time stamp adding unit 201 of the sensor containing terminal 2 acquires time information (time stamp) when receiving a packet from the sensor terminal 1 and stores it in the memory 23. T0, T1, . . . , T in FIG. n ,···,T p ,T p+1 ,T p+2 ,···,T m represents a timestamp.
[0033] Two consecutive timestamps T n-1 ,T n Time interval d n-1 =T n -T n-1 The expected value E[d n ] is a predefined transmission period T send Each timestamp has a potentially random fluctuation component relative to the expected value. Therefore, the distribution of the time interval d between timestamps is normally distributed N(T send ,σ stamp 2 ) can be considered to follow (σ stamp 2 is the variance).
[0034] When the communication environment deteriorates, the packet arrival interval is no longer constant, and it is considered that the expected value and variance of the time stamp interval will change. Therefore, if it is found that the expected value or variance of the time interval has changed significantly from the value in a normal communication environment, it becomes possible to determine whether to disconnect from the sensor terminal 1.
[0035] 4 is a diagram showing an overview of a disconnection determination by the disconnection determination unit 202 of the sensor containing terminal 2. The disconnection determination is roughly divided into an initialization process (step S1) and an evaluation value calculation process (step S2).
[0036] We consider the disconnection detection as an anomaly detection problem for normal distributions, and propose Hotelling's T 2 Consider the application of the law. Hotelling's T 2 The method is described in the literature "Tsuyoshi Ide, Masaru Sugiyama, "Anomaly Detection and Change Detection", Kodansha Ltd., pp. 15-24, 2015".
[0037] FIG. 5 is a flowchart for explaining the operations of the communication control unit 200, the time stamp adding unit 201, and the disconnection determining unit 202 of the sensor containing terminal 2. As shown in FIG. When a connection with the sensor terminal 1 is established (step S100 in FIG. 5), the communication control unit 200 receives a packet transmitted from the sensor terminal 1 and extracts sensor data from the packet. The communication control unit 200 stores the extracted sensor data in a packet for communication with the server device, and transmits the packet from the communication circuit 22 to the server device.
[0038] When the time stamp assigning unit 201 receives a packet from the sensor terminal 1, it acquires a time stamp and stores it in the memory 23. In addition, the time stamp assigning unit 201 calculates the time interval between the acquired time stamp and the previous time stamp and stores the calculated time interval in the memory 23 (step S101 in FIG. 5).
[0039] When N+1 (N is an integer equal to or greater than 2) timestamps are stored in the memory 23 (YES in step S102 in FIG. 5), the reference value determination unit 2022 of the disconnection determination unit 202 acquires the time intervals of the timestamps. From the N+1 timestamps, the time interval d i N (i=1,...,N) are obtained.
[0040] The reference value determination unit 2022 initializes the disconnection determination process by determining N time stamp intervals di For μ, σ stamp Hat is calculated as follows (step S103 in FIG. 5):
[0041]
number
[0042] μ hat, σ stamp is the standard value for evaluating the degree of anomaly. μ is the N-th timestamp interval d i Expected value (average value) of σ stamp The hat is deviation.
[0043] As in step S101, when the time stamp assigning unit 201 receives a packet from the sensor terminal 1, it acquires a time stamp and stores it in the memory 23. In addition, the time stamp assigning 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 FIG. 5).
[0044] Next, the time stamp interval input unit 2020 acquires a new time stamp interval d that is different from the N time stamp intervals. The anomaly calculation unit 2023 calculates the expected value μ and the deviation σ stamp χ with degree of freedom 1 based on the time stamp interval d newly acquired by the time stamp interval input unit 2020 and 2 The degree of abnormality α(d) according to the distribution is calculated as follows (step S105 in FIG. 5):
[0045]
number
[0046] The anomaly level determination unit 2024 compares the anomaly level α(d) with a predetermined threshold for detecting an anomaly (step S106 in FIG. 5). If the anomaly level α(d) is equal to or lower than the threshold, the anomaly level determination unit 2024 determines that the packet reception interval is normal. If normal, the connection with the sensor terminal 1 is maintained, and the processes from step S104 onward are performed for the new timestamp.
[0047] Furthermore, if the degree of abnormality α(d) is greater than the threshold value, the abnormality degree determining unit 2024 determines that the packet reception interval is abnormal. If it is determined to be abnormal, the communication control unit 200 cuts off the connection with the sensor terminal 1.
[0048] In this embodiment, it is possible to determine whether the new timestamp interval is normal or abnormal, that is, whether the packet arrival interval has changed due to packet loss. Therefore, based on this determination result, the sensor containing terminal 2 can prevent abnormal operation by disconnecting the sensor terminal 1. Furthermore, after disconnection, the sensor terminal 1 generally goes into a connection standby state, eliminating the possibility of buffer overflow. Therefore, it is possible to continue operating the sensor terminal 1. As a result, in this embodiment, it is possible to improve the stability of the sensor system while absorbing the differences in communication specifications and designs of various sensor terminals 1 at low cost on the sensor containing terminal 2 side.
[0049] In this embodiment, the reference value determination unit 2022 does not calculate the reference μ hat, but determines the transmission period T send may be expressed as μ hat.
[0050] Since the timestamp interval is affected by delays due to software such as the communication path and the OS, there is a high possibility that unintended abnormal values are potentially included. Therefore, instead of directly applying the calculation according to the Hotelling theory, it is possible to eliminate unintended abnormal values by applying preprocessing to the timestamp interval and then applying the Hotelling theory. Preprocessing is effective in preventing false positives due to unintended abnormal values. The preprocessing calculation unit 2021 shown in FIG. 2 performs preprocessing on the timestamp interval. A specific example of the preprocessing calculation unit 2021 will be described in the second embodiment.
[0051] [Second Example] Next, a second embodiment of the present invention will be described. In this embodiment, the configurations of the sensor terminal 1 and the sensor containing terminal 2 are similar to those in the first embodiment, so the description will be given using the symbols in Fig. 1. In this embodiment, a specific example of the preprocessing calculation unit 2021 of the sensor containing terminal 2 will be described.
[0052] 6 is a block diagram showing the configuration of the disconnection determination unit 202 of this embodiment. The disconnection determination unit 202 of this embodiment includes a time stamp interval input unit 2020, an average value calculation unit 2021a that calculates an average value as preprocessing for the time stamp interval, a reference value determination unit 2022, an abnormality degree calculation unit 2023, and an abnormality degree determination unit 2024.
[0053] FIG. 7 is a flowchart for explaining the operations of the communication control unit 200, the time stamp adding unit 201, and the disconnection determining unit 202 of the sensor containing terminal 2 of this embodiment. The operations of the communication control unit 200, the time stamp adding unit 201, and the reference value determining unit 2022 (steps S200 to S203 in FIG. 7) are the same as those described in steps S100 to S103 in FIG.
[0054] As in step S201, when the time stamp assigning unit 201 receives a packet from the sensor terminal 1, it acquires a time stamp and stores it in the memory 23. In addition, the time stamp assigning unit 201 calculates the interval between the acquired time stamp and the previous time stamp, and stores the interval in the memory 23 (step S204 in FIG. 7).
[0055] The average value calculation unit 2021a of the cutoff determination unit 202 calculates the μ hat and σ stamp After calculating hat, when M+1 new timestamps (M is an integer equal to or greater than 2) are stored in memory 23 (YES in step S205 of FIG. 7), the average value dbar of the M timestamp intervals d obtained from the M+1 timestamps is calculated (step S206 of FIG. 7).
[0056] The anomaly calculation unit 2023 calculates the expected value μ and the deviation σ stamp Based on the hat and the average value d of the time stamp interval d, the degree of abnormality α(d) is calculated as follows (step S207 in FIG. 7).
[0057]
number
[0058] As in the first embodiment, the anomaly level determination unit 2024 compares the anomaly level α (d bar) with a predetermined threshold value (step S208 in FIG. 7). If the anomaly level α (d bar) is equal to or less than the threshold value, the anomaly level determination unit 2024 determines that the packet reception interval is normal. If normal, the connection with the sensor terminal 1 is maintained, and the processes from step S204 onward are performed for a new timestamp.
[0059] Furthermore, if the degree of abnormality α (d bar) is greater than the threshold value, the abnormality degree determining unit 2024 determines that the packet reception interval is abnormal. If it is determined to be abnormal, the communication control unit 200 cuts off the connection with the sensor terminal 1.
[0060] As described above, in this embodiment, the degree of anomaly is not calculated for one observed timestamp interval, but rather the most recent multiple timestamp intervals are acquired and the degree of anomaly is calculated for the average value d of these timestamp intervals. This embodiment is useful as a low-risk disconnection determination method because it can avoid the risk of disconnection in response to accidental packet loss.
[0061] This embodiment is particularly suitable for a communication protocol that does not change the transmission interval but lengthens the data payload when the amount of untransmitted data increases. The reason why this embodiment is suitable for such a communication protocol is that the sensor terminal 1 does not shorten the transmission interval and perform high-speed retransmission, so that a deterioration in the communication environment has an effect of increasing the average value of the data reception interval. Figure 8 shows an example in which the reception interval of the sensor containing terminal 2 changes due to a change in the transmission interval of the sensor terminal 1.
[0062] Fig. 9(a) shows an example of a disconnection judgment process using the conventional timeout method. rd is the reception interval at the sensor containing terminal, and rd bar is the average reception interval. In the example of Fig. 9(a), untransmitted data accumulates in the buffer of the sensor terminal for a period of Ta.
[0063] In the timeout method, it is difficult to set an appropriate standard, and frequent disconnections or an inability to disconnect may occur. As a result, the sensor terminal and the sensor accommodation terminal are not disconnected, causing a buffer overflow in the sensor terminal at time t3. This buffer overflow may cause the timeout to be too late, as in point rd1, causing a buffer overflow and resulting in abnormal operation.
[0064] On the other hand, Fig. 9b shows an example of disconnection determination processing according to the first and second embodiments. Tb is the period for calculating the reference value. In the first embodiment, the communication control unit 200 of the sensor accommodation terminal 2 disconnects the connection with the sensor terminal 1 when the abnormality degree α(d) exceeds the threshold value at time t1. In the first embodiment, the abnormality is detected at an earlier timing than the occurrence of a buffer overflow in the sensor terminal 1, making it possible to disconnect.
[0065] Furthermore, after disconnection, the sensor terminal 1 generally goes into a connection standby state, and after the connection standby state, it reconnects to the sensor accommodation terminal 2. The sensor terminal 1 clears its buffer when it goes into a connection standby state. Therefore, buffer overflows do not occur at the timing that would have occurred in the past, and it becomes possible for the sensor terminal 1 to continue operating.
[0066] On the other hand, when the purpose is to avoid buffer overflow of the sensor terminal 1, it is more important to show an abnormality as a recent tendency than an instantaneous abnormality. Therefore, by applying this embodiment, it becomes possible to perform a disconnection decision more quickly and appropriately than the timeout method. In this embodiment, the abnormality degree α (d bar) exceeds the threshold at time t2, so that the communication control unit 200 of the sensor containing terminal 2 disconnects the connection with the sensor terminal 1.
[0067] [Third Example] Next, a third embodiment of the present invention will be described. This embodiment relates to a method for determining the number of pieces of data M used to calculate an evaluation value (anomaly level α (d bar)) for disconnection judgment in the second embodiment. The configurations of the sensor terminal 1 and the sensor containing terminal 2 in this embodiment are the same as those in the second embodiment. The number N of timestamp intervals d for calculating the reference value and the number M of timestamp intervals d for calculating the evaluation value affect the reliability and real-time performance of the disconnection judgment method, and therefore require appropriate settings.
[0068] T 2 In this method, the number N of timestamp intervals d for calculating the reference value must be sufficiently large compared to the number of dimensions of the data, so N >> 1. Therefore, it is considered sufficient for N to be around 100.
[0069] If the number M of timestamp intervals d for calculating the evaluation value is small, it will lead to an increase in erroneous disconnections, and if the specified number M is large, it will lead to a delay in disconnection judgment. Here, M-1 timestamp intervals d are considered to be normal, and one timestamp interval d is considered to be an abnormal value t as shown in the following equation. t=T send +t' (5)
[0070] In equation (5), t' is the expected interval T send In the second embodiment, the average of M-1 normal timestamp intervals d and one abnormal timestamp interval d is taken, so the effect of the abnormal timestamp interval d is diluted by 1 / M, and the average value d is given by
[0071]
number
[0072] In other words, the average value d is the expected transmission period T send The delay time t' from the transmission period T send In this case, the degree of anomaly α(d bar) is expressed by equation (7).
[0073]
number
[0074] In this embodiment, a delay time t' of a timestamp interval that the user judges to be a case where disconnection is required in the worst case situation where the communication environment suddenly deteriorates severely is preset. Before calculating the average value d bar, the average value calculation unit 2021a calculates the average value d bar by comparing the preset delay time t' and σ stamp The specified number M may be determined so that the degree of abnormality α (d bar) calculated from hat and the specified number M exceeds the threshold for detecting an abnormality. In this manner, this embodiment can cope with the worst case scenario of a single cut.
[0075] When M > N, it becomes impossible to perform the disconnection determination until M pieces of data are accumulated, which poses a problem. Therefore, it is possible to avoid this by setting M ≤ N or by performing the disconnection determination with the number of data M' (N < M' < M) currently accumulated until M pieces of data are accumulated. In reality, when M is large, the influence of abnormal values becomes small, so M ≤ N is preferable.
[0076] [Fourth Embodiment] Next, the fourth embodiment of this embodiment will be described. This embodiment explains a method for reducing the amount of memory used in the second embodiment. The configurations of the sensor terminal 1 and the sensor housing terminal 2 in this embodiment are the same as those in the second embodiment.
[0077] In the second 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 housing terminal 2 is generally not abundant, it is impossible to continuously accumulate all of the time stamps and the time stamp intervals. Therefore, in this embodiment, a method for saving the amount of memory used is proposed.
[0078] FIG. 10 is a diagram for explaining a method of storing data in the memory 23 of the sensor housing terminal 2 of this embodiment. First, the method of sequentially calculating the expected value μ hat and the variance σ stamp 2 hat will be described. Normally, the expected value μ hat and the variance σ stamp 2 hat are calculated each time the target time stamp interval is obtained. However, while such a calculation method is simple and reliable, it consumes a large amount of memory, and the calculation amount cannot be ignored when performing repeated calculations.
[0079] Therefore, the reference value determination unit 2022 of this embodiment performs sequential calculation to update the value using the current expected value and variance when a new time stamp interval is obtained.
[0080] [Equation]
[0081] In formula (8) and formula (9), μ n hat is the expected value up to the nth timestamp interval, σ stamp,n 2 The reference value determination unit 2022 determines the variance up to the n-th timestamp interval d n+1 and the expected value μ n Using the hat, the expected value μ up to the n+1th timestamp interval n+1 Hat is calculated as in equation (8).
[0082] In addition, the reference value determination unit 2022 determines the variance σ stamp,n 2 Hat and expectation μ n Hat and μ n+1 Using the hat, the variance σ up to the n+1th timestamp interval stamp,n+1 2 The reference value determination unit 2022 calculates the variance σ stamp,n+1 2 By taking the square root of the hat, the deviation σ stamp Just calculate the hat.
[0083] By performing the above-described sequential calculations, necessary calculations can be performed without storing all timestamp intervals d in memory 23. Since the value required here is not the timestamp T itself but the timestamp interval d, the timestamp T stored in memory 23 needs to be only the most recent value for calculating the timestamp interval d.
[0084] In the example of Figure 10, timestamps T1, T2, T3, . . . , T n+2 are sequentially obtained. When the timestamp T1 is obtained, the timestamp assigning unit 201 stores the timestamp T1 in the memory 23 as shown in (b) of Fig. 10. Then, the timestamp assigning unit 201 sets a counter indicating the number of acquired timestamps T to 1.
[0085] When timestamp T2 is obtained, the timestamp assigning unit 201 updates the timestamp T1 stored in the memory 23 to timestamp T2 as shown in FIG. 10(c). Then, the timestamp assigning unit 201 sets a counter indicating the number of acquired timestamps T to 2. Furthermore, the timestamp assigning unit 201 stores the timestamp interval d1=T2-T1 in the memory 23. The reference value determining unit 2022 determines the expected value μ1 hat and the variance σ from the timestamp interval d1. stamp,1 2 The calculated value is stored in the memory 23.
[0086] Timestamp T N+1 When the time stamp adding unit 201 obtains the time stamp T N timestamp T N+1 Then, the time stamp assigning unit 201 updates the counter indicating the number of acquired time stamps T to N+1. Furthermore, the time stamp assigning unit 201 updates the time stamp interval d N =T N+1 -T N is stored in the memory 23.
[0087] The reference value determination unit 2022 determines the expected value μ N-1 Hat and timestamp interval d N Using the expected value μ N hat is calculated in the same manner as in equation (8), and the expected value μ N-1 Hat μ N Update to hat.
[0088] In addition, the reference value determination unit 2022 determines the variance σ stamp,N-1 2 and the expected value μ N-1 Hat and the newly calculated expectation μ N Hat and timestamp interval d N Using and variance σ stamp,N 2 is calculated in the same manner as in equation (9), and the variance σ stamp,N-1 2 σstamp,N 2 Update to
[0089] The average value calculation unit 2021a obtains the average using the past M time stamp intervals d. However, when a new time stamp interval d is obtained, it is necessary to obtain the average value by discarding the value of the time stamp interval d M intervals before. Therefore, the time stamp intervals d for the past M intervals must be stored in the memory 23.
[0090] The average value calculation unit 2021a is for the time stamp interval d n Once it is stored in the memory 23, as shown in (d) of FIG. 10, the time stamp d stored in the memory 23 n from d n-M+1 to d M calculates the M average value bars of d and stores them in the memory 23. The average value can also be calculated sequentially at this time.
[0091] After the calculation of μ hat and σ hat by the reference value determination unit 2022, when n + 1 time stamp intervals are obtained, if n < M, the average value calculation unit 2021a uses the time stamp interval d stamp and the average value bar of d stored in the memory 23 n+1 to calculate the average value bar of d as shown in Equation (10) and store it in the memory 23. M,n bar and stores it in the memory 23. M,n+1 bar and stores it in the memory 23.
[0092]
Equation
[0093] Also, when n ≥ M, the average value calculation unit 2021a uses the time stamp interval d n+1 and the average value bar of d stored in the memory 23 M,n bar and the time stamp interval d stored in the memory 23 n-M+1 to calculate the average value bar of d as shown in Equation (11) and store it in the memory 23. M,n+1 bar and stores it in the memory 23.
[0094]
number
[0095] By configuring the area of the memory 23 in which the M time stamp intervals d are stored as a ring buffer, it becomes possible to efficiently read from and write to the memory 23. The ring buffer connects to the oldest data after going around once.
[0096] The average value of Eq. (11) M,n+1 The sequential calculation of bars is performed for the oldest timestamp interval d n-M+1 Divide by M and subtract the result to get the new timestamp interval d n+1 Add the value obtained by dividing by M. Average value d M,n+1 The old average value stored in memory 23 in the bar d M,n Before overwriting the bars, the average value d M,n By reading the bar from the memory 23, memory access can be performed efficiently.
[0097] If the configuration of this embodiment is not adopted, an area of at least max(2N, 2M)×DATA_SIZE is required for the data area of the memory 23. max(2N, 2M) means that the larger of 2N and 2M is selected.
[0098] On the other hand, according to this embodiment, the data area of the memory 23 can be set to about (M+1)×DATA_SIZE. That is, compared to a case where the configuration of this embodiment is not adopted, the data area of the memory 23 can be reduced to about half.
[0099] In addition, if the connection between the sensor terminal 1 and the sensor containing terminal 2 is completely cut off, only the expected value and variance calculated as the reference values may be left and the areas other than the expected value and variance may be cleared, or all memory areas used in this embodiment may be cleared.
[0100] [Fifth Example] Next, a fifth embodiment of the present embodiment will be described. This embodiment describes an initialization method in the first to fourth embodiments when the communication environment is poor immediately after the start of connection between the sensor terminal and the sensor accommodation terminal, and a method for improving real-time performance by speeding up the initialization process.
[0101] In the first to fourth embodiments, the expected value μ hat and the deviation σ stamp It is assumed that the hat is to be calculated. However, in a multi-sensor system as shown in FIG. 13, a plurality of sensor terminals are connected to one sensor accommodation terminal. In order to apply the first to fourth embodiments to the multi-sensor system, the variance σ of the timestamp intervals is stamp 2 hat must be known. However, if the communication environment is poor immediately after the start of the connection between the sensor terminal 1 and the sensor containing terminal 2, packets cannot be received from the sensor terminal 1 (hereinafter referred to as the sensor terminal 1A) at normal communication intervals. Therefore, the variance σ stamp 2 Can't ask for a hat.
[0102] Also, the variance σ stamp 2 The variance σ is affected by the timestamp error caused by the OS capability and clock accuracy of the sensor containing terminal 2. stamp 2 hat does not vary depending on the individual sensor terminal 1, but can be considered as a variable determined by the sensor containing terminal 2. In other words, the variance σ stamp 2 The value hat is common to the sensor terminals 1 connected to the same sensor accommodation terminal 2 .
[0103] Therefore, the reference value determination unit 2022 of the sensor containing terminal 2 determines the variance σ based on the timestamp intervals obtained by receiving packets from one or more sensor terminals 1 that can communicate normally, other than the sensor terminal 1A. stamp 2 Calculate the hat and variance σ stamp 2Deviation σ from hat stamp 11 is a flowchart for explaining the operation of the reference value determination unit 2022 of this embodiment.
[0104] The reference value determination unit 2022 judges the normality of communication between the sensor containing terminal 2 and one or more sensor terminals 1 connected to the sensor containing terminal 2 (Step S300 in FIG. 11). The reception interval can be used as an index for determining the normality of communication. Specifically, the reference value determination unit 2022 determines the reception interval of a packet from the sensor terminal 1 and a predetermined transmission period T send If the difference between the packet reception interval and the transmission period T send If the difference is equal to or smaller than a specified value, it is determined that the communication state with the sensor terminal 1 is normal.
[0105] Since it is impossible to calculate the expected value μ from the sensor terminal 1A whose communication with the sensor containing terminal 2 is determined to be abnormal, the expected value μ is not calculated and the transmission period T send That is, the reference value determination unit 2022 substitutes the transmission period T send is set as the expected value μ hat (step S301 in FIG. 11).
[0106] Next, the reference value determination unit 2022 determines the deviation σ of the timestamp interval in the same manner as in the first to fourth embodiments. stamp At this time, the reference value determination unit 2022 calculates the variance σ of the timestamp interval obtained by receiving a packet from the sensor terminal 1 whose communication state with the sensor containing terminal 2 is determined to be abnormal in the process of step S300. stamp 2 Exclude from hat calculation.
[0107] Then, the reference value determination unit 2022 calculates the variance σ based on the timestamp intervals obtained by receiving packets from one or more sensor terminals 1 that have been determined to be in a normal communication state with the sensor containing terminal 2. stamp 2 Calculate the hat and the variance σstamp 2 Deviation σ from hat stamp Calculate the hat.
[0108] In this manner, in this embodiment, it is possible to determine whether or not a connection has been disconnected, regardless of the communication environment at the time of connection.
[0109] In this embodiment, the expected value μ hat and the variance σ are calculated based on the timestamp intervals obtained by receiving packets from multiple sensor nodes 1 that can communicate normally. stamp 2 When calculating hat, the time required for the initialization process can be shortened, and real-time performance can be improved.
[0110] There are S (S is an integer equal to or greater than 2) sensor terminals 1 that can communicate normally. The predetermined transmission period of each sensor terminal 1 is T send i The number of data items used in the initialization process is K (K is an integer equal to or greater than 2). send i are all the same value T send In this case, the time τ required for the initialization process is expressed by the following equation.
[0111]
number
[0112] In addition, the transmission period T send i When the time τ required for the initialization process is different, the time τ is expressed by the following equation.
[0113]
number
[0114] In this manner, in this embodiment, the initialization process can be speeded up, and the time required to determine whether or not a disconnection has occurred can be shortened. Transmission cycle T send i are all the same value Tsend In this case, if the number of pieces of data K is set to a multiple of the number S of the sensor terminals 1, it is possible to most efficiently collect the data for initialization.
[0115] The control unit 20 of the sensor containing terminal 2 explained in the first to fifth embodiments can be realized by a computer equipped with a CPU or MCU, a storage device and an interface, and a program that controls these hardware resources. An example of the configuration of this computer is shown in FIG.
[0116] 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, a disconnection determination program for implementing the disconnection determination method of the present invention is stored in the storage device 301. The CPU 300 executes the processes described in the first to fifth embodiments in accordance with the program stored in the storage device 301. It is also possible to provide the program through a network. The control unit 10 of the sensor terminal 1 can also be implemented by a computer. [Industrial Applicability]
[0117] The present invention can be applied to a multi-sensor system that accommodates a large number of different sensors. [Explanation of symbols]
[0118] 1...sensor terminal, 2...sensor accommodating terminal, 10,20...control unit, 11,21...wireless circuit, 12...sensor circuit, 13,23...memory, 22...communication circuit, 24...clock unit, 100,200...communication control unit, 201...time stamp assignment unit, 202...disconnection determination unit, 2020...time stamp interval input unit, 2021...pre-processing calculation unit, 2021a...average value calculation unit, 2022...reference value determination unit, 2023...anomaly calculation unit, 2024...anomaly determination unit.
Claims
1. a communication control unit configured to control communication with a sensor terminal that wirelessly transmits a packet storing sensor data; a time stamp assignment unit configured to acquire a time stamp of a reception time of a packet received from the sensor terminal; a memory configured to store the timestamp and a timestamp interval, which is a time interval between two consecutive timestamps; a reference value determiner configured to determine a reference value of the timestamp interval; an anomaly calculation unit configured to calculate an anomaly degree based on the reference value and a newly obtained timestamp interval; an abnormality degree determination unit configured to determine whether the packet reception interval is normal or abnormal based on the abnormality degree; the reference value is an expectation value and a deviation of the timestamp interval; the reference value determination unit calculates the expected value and the deviation based on a plurality of the timestamp intervals, or calculates only the deviation using a predetermined transmission period of the sensor terminal as the expected value; The sensor containing terminal is characterized in that the communication control unit cuts off a connection with the sensor terminal when the packet reception interval is determined to be abnormal.
2. 2. The sensor housing terminal according to claim 1, Further comprising a clock unit configured to measure time, the time stamp adding unit, when receiving a packet from the sensor terminal, acquires the time stamp based on time information of the clock unit; The anomaly degree calculation unit calculates a degree of freedom of χ 2 Calculate the anomaly degree according to the distribution; The sensor containing terminal is characterized in that the abnormality level determination unit determines whether the packet reception interval is normal or abnormal by comparing the abnormality level with a threshold value.
3. 3. The sensor housing terminal according to claim 2, an average value calculator configured to calculate an average value of a prescribed number of said time stamp intervals; The sensor containing terminal is characterized in that the abnormality degree calculation unit calculates the abnormality degree based on the reference value and an average value of the time stamp interval.
4. 4. The sensor housing terminal according to claim 3, The sensor containing terminal is characterized in that, before calculating the average value of the timestamp intervals, the average value calculation unit determines the specified number so that the degree of anomaly calculated from the delay time from a predetermined transmission period, the deviation, and the specified number exceeds the threshold value.
5. 5. The sensor housing terminal according to claim 3, the time stamp adding unit stores the latest time stamp and the specified number of time stamp intervals in the memory; the reference value determination unit sequentially calculates the expected value and the deviation based on a plurality of the time stamp intervals, or sequentially calculates only the deviation using a predetermined transmission period of the sensor terminal as the expected value; the average value calculation unit sequentially calculates an average value of the specified number of time stamp intervals; The sensor housing terminal is characterized in that the memory has an area in which the specified number of time stamp intervals are stored, the area having a ring buffer structure.
6. The sensor housing terminal according to any one of claims 2 to 5, the reference value determination unit, when calculating the expected value, excludes from the calculation of the expected value a timestamp interval obtained by receiving packets from the sensor terminal whose communication state with the sensor containing terminal has been determined to be abnormal, and calculates the expected value based on the timestamp interval obtained by receiving packets from one or more of the sensor terminals whose communication state with the sensor containing terminal has been determined to be normal; and, when calculating the deviation, excludes from the calculation of the deviation a timestamp interval obtained by receiving packets from the sensor terminal whose communication state with the sensor containing terminal has been determined to be abnormal, and calculates the deviation based on the timestamp interval obtained by receiving packets from the one or more sensor terminals whose communication state with the sensor containing terminal has been determined to be normal.
7. The sensor housing terminal according to any one of claims 2 to 5, The sensor containing terminal is characterized in that the reference value determination unit sets a predetermined transmission period of the sensor terminal as the expected value, and when calculating the deviation, calculates the deviation based on a timestamp interval obtained by receiving packets from a plurality of the sensor terminals.
8. 1. A disconnection determination method for a sensor system including a sensor terminal configured to wirelessly transmit a packet storing sensor data, and a sensor containing terminal configured to transmit the sensor data included in the packet to a higher-level device, the method comprising: determining whether to disconnect a connection between the sensor terminal and the sensor containing terminal, the method comprising: A first step of acquiring a timestamp of a packet received from the sensor terminal by the sensor containing terminal; a second step in which the sensor containing terminal stores the timestamp and a timestamp interval that is a time interval between two consecutive timestamps; A third step in which the sensor containing terminal determines a reference value of the timestamp interval; a fourth step in which the sensor containing terminal calculates an anomaly degree based on the reference value and the newly obtained timestamp interval; a fifth step of determining whether the packet reception interval is normal or abnormal based on the degree of abnormality by the sensor containing terminal; the reference value is an expectation value and a deviation of the timestamp interval; The third step is characterized in that it includes a step of calculating the expected value and the deviation based on a plurality of the timestamp intervals, or a step of calculating only the deviation using a predetermined transmission period of the sensor terminal as the expected value.
9. 9. A disconnection determination program for causing a computer to execute each step of claim 8.
Citation Information
Patent Citations
Method for training traffic detection model, method for detecting abnormality of service traffic, and device
CN109462580A
Method for discriminating moving direction of tape cassette
JP1986029443A
Method for reducing unnecessary retransmission due to delayed transmission in wireless network and communication device using the same
JP2006229955A
Monitoring device and monitoring method
JP2013080354A
Communication system, router, communication method, and control program
JP2013229814A
