A method for secure communication of an internet of things device supporting multi-protocol adaptation
Patent Information
- Application Number
- CN202611256284.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-19
- Publication Date
- 2026-09-22
AI Technical Summary
[0004]为了解决抢救数据与历史重传数据无法区分导致抢救数据被堵塞的技术问题,本发明的目的在于提供一种支持多协议适配的物联网设备安全通信方法,所采用的技术方案具体如下:
本发明通过实时获取报文长度和信号强度,基于首个报文及指数移动平均算法动态更新报文长度基准值和信号强度基准值,根据报文长度变化与报文长度基准值判定跳变事件并基于并发收集时间窗口构建并发设备事件记录集,将同一事件的异常报文对齐到同一集合,基于信号强度和信号强度基准值计算信号衰减差值,并根据跳变事件数量和信号衰减差值进行分支判决,得到严重衰减事件集和无衰减事件集,准确区分了抢救数据和历史重传数据,解决了端到端加密下无法区分抢救数据和历史重传数据的问题;对严重衰减事件集内的报文直通发送,对无衰减事件集内的报文复用发送,解决了套接字分配抢占导致的队列阻塞和传输滞后问题,保障了抢救数据的优先传输。
Smart Images

Figure CN122802271A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of communication network technology, and more specifically to a secure communication method for Internet of Things (IoT) devices that supports multi-protocol adaptation. Background Technology
[0002] In smart healthcare and hospital IoT deployments, the gateway is responsible for receiving heterogeneous data generated by underlying monitoring nodes via short-connection protocols and converting and encapsulating this data into standard long-connection protocols for forwarding to the cloud. To meet medical data security compliance requirements, underlying monitoring nodes typically employ end-to-end encryption mechanisms. Under this mechanism, the gateway does not have the authority to decrypt service payloads. In a real ward environment, the effective scope of the gateway is limited to a single bed or adjacent bed units. When the network connection is restored, a large number of underlying monitoring nodes distributed across empty beds will retransmit the backlog of historical encrypted messages to the gateway. If, at the moment of network restoration, there is a bed undergoing emergency resuscitation, that bed will generate a high density of real-time life telemetry data. This data, along with a large amount of historical retransmitted data, will flood the gateway simultaneously, causing severe transmission control protocol socket allocation preemption. This results in real-time life telemetry data being blocked in the underlying allocation queue, causing transmission delays.
[0003] Existing conventional operations employ a first-in-first-out (FIFO) queuing principle or attempt to read the header field for queue reshaping. However, under the strong constraint of end-to-end encryption, the header field is encrypted and cannot be read. The FIFO queuing principle still causes congestion of rescue data, making it impossible to accurately identify and ensure the rapid transmission of rescue data. Summary of the Invention
[0004] To address the technical problem of data congestion caused by the inability to distinguish between rescue data and historical retransmission data, the present invention aims to provide a secure communication method for IoT devices that supports multi-protocol adaptation. The specific technical solution adopted is as follows: This invention proposes a secure communication method for IoT devices that supports multi-protocol adaptation, the method comprising: The message length and signal strength are acquired in real time; the message length and signal strength reference values are determined based on the first message reported when accessing the network, and the message length and signal strength reference values are updated using an exponential moving average algorithm; The transition event is determined based on the change in the current message length and the message length baseline value; a concurrent device event record set is constructed based on the transition event and the preset concurrent collection time window; Based on the signal strength and signal strength baseline of the corresponding message of the transition event, the signal attenuation difference is calculated; based on the number of transition events in the concurrent device event record set and the signal attenuation difference of the corresponding message, branch decision is performed on each transition event to obtain the severe attenuation event set and the no attenuation event set; Transition event messages within the severely attenuated event set that pass the judgment are sent directly; transition event messages within the non-attenuated event set are multiplexed and sent.
[0005] Furthermore, the method for determining the transition event includes: The length increment difference of the current message is calculated based on the message length and the message length baseline value, and the jump percentage of the current message is calculated using the length increment difference of the current message; the jump event is determined based on the length increment difference of the current message and the jump percentage.
[0006] Furthermore, the method for obtaining the jump percentage includes: Subtract the baseline message length from the current message length to obtain the message length increment difference. Use the message length increment difference as the numerator and the baseline message length as the denominator to calculate the jump percentage of the current message.
[0007] Furthermore, the method for determining the transition event based on the current message length increment difference and transition percentage includes: When the length increment difference of the current message is greater than the preset transition lower limit, and the transition percentage of the current message is greater than the preset transition ratio threshold, it is determined that there is a transition event in the current message.
[0008] Furthermore, the method for constructing the concurrent device event log set includes: The starting time of the transition event is set as the starting point. Based on the starting point, the medium access control address, signal strength and signal strength baseline value of all IoT devices corresponding to the transition events within the preset concurrent collection time window are extracted. A concurrent device event record set is constructed based on the extracted data.
[0009] Furthermore, the method for obtaining the signal attenuation difference includes: The signal strength baseline value of the message corresponding to the transition event is subtracted from the signal strength to obtain the relative difference of the signal strength of the message; if the relative difference of the signal strength is less than or equal to zero, the signal attenuation difference is set to zero; otherwise, the signal attenuation difference is equal to the relative difference of the signal strength.
[0010] Furthermore, the specific method for branch decision-making includes: When the number of transition events in the concurrent device event record set is equal to 1, the signal attenuation difference of the corresponding message of the transition event is compared with the preset single-instance attenuation judgment threshold. If the signal attenuation difference is greater than or equal to the single-instance attenuation judgment threshold, it is judged as a severe attenuation event; otherwise, it is judged as a no-attenuation event. When the number of transition events in the concurrent device event log set is greater than 1, the minimum and maximum values of the signal attenuation difference of the corresponding messages for all transition events are taken. If the minimum value is greater than or equal to the single-instance attenuation judgment threshold, all transition events are determined to be severe attenuation events; if the maximum value is less than the single-instance attenuation judgment threshold, all transition events are determined to be no attenuation events. If the minimum value is less than the single-instance attenuation judgment threshold and the maximum value is greater than or equal to the single-instance attenuation judgment threshold, the absolute value of the difference between the maximum and minimum signal attenuation difference of the corresponding messages for all transition events is calculated and compared with a preset convergence tolerance. If the absolute value of the difference is less than the convergence tolerance, all transition events are determined to be no attenuation events; if the absolute value of the difference is greater than or equal to the convergence tolerance, the transition events in the concurrent device event log set are clustered.
[0011] Furthermore, the method for obtaining the severely decayed event set and the non-decayed event set includes: The K-means clustering algorithm was used to divide the concurrent device event record set into a severely decaying event set and a non-decaying event set.
[0012] Furthermore, after obtaining the severely decayed event set and the non-decayed event set, the following is also included: The distance between the medical staff's name tag and the bed is obtained based on the Bluetooth broadcast frames emitted by the medical staff's name tag; the distance between the medical staff's name tag and the bed in the concurrent device event record set is compared with a preset effective operating distance threshold. If the distance between the medical staff's name tag and the bed is greater than or equal to the effective operating distance threshold, the severely attenuated event set divided by the concurrent device event record set is determined to be invalid, and the severely attenuated event set is forcibly cleared; if the distance between the medical staff's name tag and the bed is less than the effective operating distance threshold, the severely attenuated event set divided by the concurrent device event record set is determined to be valid, and the severely attenuated event set is retained.
[0013] Furthermore, the specific methods for direct transmission and multiplexed transmission include: For packets corresponding to transition events within the severely attenuated event set that pass the judgment, an independent socket is allocated, and the packets are sent to the cloud server via a direct path based on the independent socket; for packets corresponding to transition events within the non-attenuated event set, packets are sent to the cloud server in batches with a delay.
[0014] The present invention has the following beneficial effects: This invention acquires message length and signal strength in real time, dynamically updates message length and signal strength benchmarks based on the first message and an exponential moving average algorithm, determines jump events based on message length changes and benchmark values, and constructs a concurrent device event record set based on a concurrent collection time window. Abnormal messages of the same event are aligned to the same set. Signal attenuation difference is calculated based on signal strength and benchmark values, and branch decisions are made based on the number of jump events and the signal attenuation difference to obtain a severely attenuated event set and a non-attenuated event set. This accurately distinguishes between rescue data and historical retransmission data, solving the problem of not being able to distinguish between rescue data and historical retransmission data under end-to-end encryption. Messages in the severely attenuated event set are sent directly, while messages in the non-attenuated event set are multiplexed, solving the queue blocking and transmission lag problems caused by socket allocation preemption and ensuring priority transmission of rescue data. Attached Figure Description
[0015] To more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0016] Figure 1 This is a flowchart illustrating a secure communication method for IoT devices that supports multi-protocol adaptation, provided as an embodiment of the present invention. Detailed Implementation
[0017] To further illustrate the technical means and effects adopted by the present invention to achieve its intended purpose, the following, in conjunction with the accompanying drawings and preferred embodiments, details the specific implementation, structure, features, and effects of a secure communication method for IoT devices supporting multi-protocol adaptation proposed according to the present invention. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics in one or more embodiments can be combined in any suitable form.
[0018] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.
[0019] The following description, in conjunction with the accompanying drawings, details a specific scheme of a secure communication method for IoT devices that supports multi-protocol adaptation provided by the present invention.
[0020] Please see Figure 1 The diagram illustrates a flowchart of a secure communication method for IoT devices supporting multi-protocol adaptation, according to an embodiment of the present invention. The method includes: Step S1: Obtain message length and signal strength in real time; determine the message length reference value and signal strength reference value based on the first message reported when accessing the network, and update the message length reference value and signal strength reference value through the exponential moving average algorithm.
[0021] This invention addresses a situation where the hospital's underlying monitoring nodes employ an end-to-end encryption mechanism, preventing the gateway from reading the data content and thus making it impossible to determine whether the data received after a network outage is indeed emergency data. However, the signal strength and message length when the gateway receives the message are detectable plaintext data. Generally, urgent emergency events require more comprehensive basic data information, resulting in longer message lengths for high-density emergency data compared to ordinary data. Furthermore, the signal strength may drop when medical staff approach the bed during an emergency. In this invention, based on the above scenario, the message length and signal strength can be obtained in real time to determine the subsequent emergency data.
[0022] Because different underlying monitoring nodes have different antenna materials, and the header lengths of underlying protocol packets from different manufacturers also differ, the message lengths sent by different underlying monitoring nodes do not have a unified benchmark. Therefore, for each underlying monitoring node, the message length benchmark value and signal strength benchmark value of the underlying monitoring node are determined based on the first message reported when the corresponding device accesses the network. It should be noted that the first message is received when the corresponding device is in a normal state. If the first message is received in an abnormal state, the gateway delays the determination of the initial message length benchmark value and signal strength benchmark value until a message in a normal state is received.
[0023] During routine operation without any data anomalies, the baseline values may become invalid due to changes in temperature and humidity, as well as minor adjustments to equipment positions. Therefore, an exponential moving average algorithm is used to update the baseline values for message length and signal strength after each message is sent by the underlying monitoring node. Whenever the underlying monitoring node sends a message under normal conditions, the message length and signal strength of the current message are extracted as input. Combined with the old baseline values for message length and signal strength of the underlying monitoring node, a new baseline value for message length and signal strength is calculated using the exponential moving average algorithm and a preset smoothing coefficient. This new baseline value replaces the old baseline values for message length and signal strength and is then stored. The exponential moving average algorithm is a well-known technique in the art, and its specific details will not be elaborated upon.
[0024] In one specific implementation of this invention, the smoothing coefficient is set to 0.05 to ensure the smooth and stable transmission length reference value and signal strength reference value, and to avoid interference from high-frequency random jitter on transition detection.
[0025] Step S2: Determine the transition event based on the change in the current message length and the message length baseline value; construct a concurrent device event record set based on the transition event and the preset concurrent collection time window.
[0026] During network outage recovery, the length of historical retransmitted packets sent by the underlying monitoring nodes is usually much longer than that of regular packets. During rescue operations, due to the high density of rescue data, the length of packets sent by the underlying monitoring nodes is also usually much longer than that of regular packets. Therefore, it is necessary to determine whether there is a jump event in the current packet based on the change in the current packet length and the packet length baseline value. The jump event represents a significant change in packet length, which may be caused by rescue or network outage recovery. If a jump event is determined to have occurred in the current packet, since the historical retransmitted data after network outage recovery and the high-density data generated during the rescue process are not strictly single events, but will be sent to the gateway successively over a period of time, a concurrent device event record set is constructed based on the jump event and the preset concurrent collection time window. This set includes the packet information of all packets determined to be jump events within the concurrent collection time window, which facilitates further determination of subsequent rescue data.
[0027] In one specific implementation of this invention, since the jump in message length affects the message length reference value, after determining that a jump event has occurred in the current message, the update of the message length reference value is immediately stopped by issuing a reference value freeze command until the concurrent collection time window ends, at which point the message length reference value is unfrozen and the update of the message length reference value continues.
[0028] In one specific implementation of this invention, the concurrent collection time window is set to 2 seconds, which can ensure the timeliness of the rescue data while covering as much of the historical retransmission data that arrives from the scattered underlying monitoring nodes as possible.
[0029] Step S3: Calculate the signal attenuation difference based on the signal strength of the corresponding message and the signal strength baseline value of the transition event; perform branch decision on each transition event based on the number of transition events in the concurrent device event record set and the signal attenuation difference of the corresponding message to obtain the severe attenuation event set and the no attenuation event set.
[0030] Since both network recovery and emergency response messages will experience transition events, it is necessary to further filter out emergency response messages from the messages corresponding to the transition events. During emergency response, because medical staff approach the emergency bed, the underlying monitoring nodes are severely obstructed by the moisture from the human body, causing a significant drop in the signal strength of the messages. Therefore, the signal attenuation difference is calculated based on the signal strength of the messages corresponding to the transition events and the signal strength benchmark value. The signal strength benchmark value represents the signal strength of the underlying monitoring node that experienced the transition event in its normal unobstructed state. The signal attenuation difference quantifies the degree of attenuation of the radio frequency signal between the underlying monitoring node and the gateway during the transition event compared to the normal unobstructed state.
[0031] The concurrent device event record set obtained in step S2 contains information about all the messages corresponding to the transition events within the corresponding concurrent collection time window. Different message judgment methods can be used depending on the number of transition events in the concurrent device event record set. For example, when the number of transition events in the concurrent device event record set is 1, the signal attenuation difference of the message corresponding to the transition event can be compared with an absolute threshold to determine whether the transition is caused by emergency treatment. The absolute threshold can be set to 3dm, because when medical staff approach the bed for emergency treatment, the attenuation of signal strength by the human body is usually greater than 3dm. The absolute threshold can be used to distinguish whether a single transition event is an emergency treatment event. When the number of transition events in the concurrent device event record set is greater than 1, the degree of dispersion between the signal attenuation differences of each message or direct clustering can be used to determine whether the transition is caused by emergency treatment from multiple transition events.
[0032] Therefore, based on the number of transition events in the concurrent device event log set and the signal attenuation difference of the corresponding message, branch decisions are made on all transition events in the concurrent device event log set to obtain a severely attenuated event set and a non-attenuated event set.
[0033] The jump event in the severe attenuation event set corresponds to a message whose signal strength has been severely attenuated, and the message length jump is caused by rescue efforts; the jump event in the no attenuation event set corresponds to a message whose signal strength has not been severely attenuated, and the message length jump is usually caused by network recovery.
[0034] Step S4: For transition event messages in the severely attenuated event set that have passed the judgment, send them directly; for transition event messages in the non-attenuated event set, send them multiplexed.
[0035] In step S3, the concurrent device event record set is divided into a severely attenuated event set representing rescue and a non-attenuated event set representing network outage recovery. To prevent rescue messages and historical retransmission messages from flooding the gateway simultaneously and causing the Transmission Control Protocol socket allocation to be preempted, thus blocking rescue data in the underlying allocation queue, the messages corresponding to the transition events in the severely attenuated event set are sent directly to the cloud server; the messages corresponding to the transition events in the non-attenuated event set are multiplexed, that is, multiple messages share the same transmission channel to be sent to the cloud server, thus solving the problem of rescue data being blocked.
[0036] In summary, this method obtains the message length and signal strength of a packet, and calculates and determines a transition event using the message length and a baseline value. Based on a preset concurrent collection time window and the transition events, a concurrent device event record set is constructed. The signal strength of the packet corresponding to the transition event is calculated against the baseline value to obtain the signal attenuation difference. Using the signal attenuation difference and the number of transition events in the concurrent device event record set, the transition events are divided into a severely attenuated event set and a non-attenuated event set. Finally, packets in the severely attenuated event set are directly transmitted, while packets in the non-attenuated event set are multiplexed. This invention achieves the distinction between rescue data and historical retransmission data, solving the problem of rescue data congestion.
[0037] Preferably, in some specific implementations of the embodiments of the present invention, the method for determining the transition event includes: The message length baseline represents the message length of each underlying monitoring node under normal, anomaly-free conditions. A jump event occurs when the message length of the current message transmitted by a certain underlying monitoring node increases significantly relative to the message length baseline of that underlying monitoring node under normal, anomaly-free conditions. Therefore, the length increment difference of the current message is calculated based on the message length of the current message and the message length baseline, and the jump percentage of the current message is calculated using the length increment difference of the current message. The jump event is determined based on the length increment difference of the current message and the jump percentage.
[0038] Preferably, in some specific implementations of the embodiments of the present invention, the method for obtaining the jump percentage includes: Subtracting the baseline message length from the current message length yields the message length increment difference. This increment difference reflects the increase in message length of the current message relative to the normal state of the underlying monitoring node. The larger the value, the more significant the increase in the amount of data carried by the current message relative to the normal state, and the more likely it is to be identified as a jump event.
[0039] However, the message lengths of different underlying monitoring nodes may vary significantly under normal conditions. Using only the length increment difference for judgment would lead to an overemphasis on the slight increase in the message length of long messages and the neglect of the jumps in short messages. Therefore, the jump percentage of the current message is calculated by using the length increment difference of the current message as the numerator and the message length baseline value as the denominator. The jump percentage reflects the relative growth ratio of the current message length compared to the message length under normal conditions, making the degree of message length growth comparable between different nodes.
[0040] In one specific implementation of this invention, the message length reference value is the effective payload length of the first message reported by the underlying monitoring node when it accesses the network. When updated by the exponential moving average algorithm, it is always calculated based on a positive number, so the message length reference value is always positive and there is no risk of division by zero when calculating the jump percentage.
[0041] Preferably, in some specific implementations of the embodiments of the present invention, the method for determining the hopping event based on the current message length increment difference and the hopping percentage includes: The determination of a jump event adopts a dual-limit judgment. If only the length increment difference is used for judgment, when the normal message length of a certain underlying monitoring node is extremely long, even if the message length only increases by a small percentage, it may be misjudged as a jump event. If only the jump percentage is used for judgment, when the normal message length is extremely short, a small increase in message length will lead to a sharp increase in the jump percentage, which will also be misjudged as a jump event. Therefore, the length increment difference of the current message is compared with a preset jump lower limit. If the length increment difference is greater than the jump lower limit, the jump percentage of the current message is then compared with a preset jump percentage threshold. If the jump percentage is greater than the jump percentage threshold, the current message is determined to have a jump event.
[0042] In one specific implementation of this invention, the transition lower limit is set to 50 bytes. In real-world medical scenarios, when no transition event occurs, the occasional change in the message length of most underlying monitoring nodes will not exceed 30 bytes. The 50-byte transition lower limit ensures that most normal fluctuations will not be misjudged as transition events, while also ensuring the sensitivity of transition event detection.
[0043] In one specific implementation of this invention, the jump ratio threshold is set to 30%. In real-world medical scenarios, the packet length increment ratio in network recovery or emergency scenarios usually far exceeds 30%. The 30% jump ratio threshold can effectively filter out false positive fluctuations in long packets while ensuring that real jump events are not missed.
[0044] Preferably, in some specific implementations of the embodiments of the present invention, the method for constructing the concurrent device event log set includes: After determining a transition event, the start time of the transition event is set as the starting point, and a concurrent collection time window is preset. To ensure that the concurrent collection time window can cover the process of consecutive transition events caused by the same reason being sent to the gateway, based on the starting point within the time range of the concurrent collection time window, subsequent transmitted messages are continuously received and transition events are determined. For all underlying monitoring nodes determined to be transition events within the concurrent collection time window, the media access control address of the corresponding terminal is extracted, the signal strength of the transition event and the frozen signal strength baseline value are extracted, and the extracted information data is associated and stored to obtain a concurrent device event record set. After the concurrent collection time window ends, the extraction of information is stopped. The concurrent device event record set is the sole data source for subsequent signal attenuation difference calculation and branch decision.
[0045] Preferably, in some specific implementations of the embodiments of the present invention, the method for obtaining the signal attenuation difference includes: The relative difference in signal strength of a message is obtained by subtracting its signal strength from the baseline signal strength value of the message corresponding to the transition event. In a real hospital ward radio physical environment, the movement of medical staff may cause multipath effects due to signal reflection. That is, when reflected signals and direct signals overlap, the current received strength of the underlying monitoring node may be greater than the baseline signal strength value when there is no obstruction. In this case, the relative difference in signal strength is negative. Since a negative signal attenuation difference can be misinterpreted as signal strength enhancement, thus interfering with the identification of underlying monitoring nodes whose signal strength has dropped due to obstruction by medical staff, non-positive relative differences in signal strength are uniformly set to zero. If the relative difference in signal strength is less than or equal to zero, the signal attenuation difference is set to zero; otherwise, the signal attenuation difference equals the relative difference in signal strength, avoiding misjudgments caused by environmental factors such as multipath effects.
[0046] Preferably, in some specific implementations of the embodiments of the present invention, the specific method for branch decision includes: The number of transition events in the concurrent device event log set is obtained. When the number is equal to 1, it means that only one underlying monitoring node in the concurrent device event log set has transmitted a message that has transitioned. The signal attenuation difference of the message is compared with the preset single-instance attenuation judgment threshold. If the signal attenuation difference is greater than or equal to the single-instance attenuation judgment threshold, the transition event of the message is judged as a severe attenuation event; otherwise, it is judged as a no-attenuation event.
[0047] When the number of transition events in the concurrent device event log set is greater than 1, the minimum value of the signal attenuation difference of the corresponding messages of all transition events is taken first. If the minimum value is greater than or equal to the single-instance attenuation judgment threshold, it means that even the lowest-level monitoring node with the smallest signal attenuation in the concurrent device event log set has been significantly blocked and is in a state of emergency. Therefore, all transition events are judged to be severe attenuation events.
[0048] If the maximum value is less than the single-instance attenuation judgment threshold, it means that the signal attenuation difference of the messages corresponding to all transition events has reached the physical bottom line of severe attenuation. Therefore, all transition events are judged to be attenuation-free events.
[0049] If the minimum value is less than the single-instance attenuation judgment threshold and the maximum value is greater than or equal to the single-instance attenuation judgment threshold, it indicates that at least one underlying monitoring node's signal attenuation difference has not reached the level of severe attenuation, but at least one of the other underlying monitoring nodes has reached the level of severe attenuation. Therefore, the absolute value of the difference between the maximum and minimum signal attenuation difference of all jump events' corresponding messages is calculated and compared with the preset convergence tolerance. If the absolute value of the difference is less than the convergence tolerance, it indicates that the signal attenuation difference of all jump events' corresponding messages is highly concentrated and at a low level, and cannot form an effective fault. All jump events are determined to be attenuation-free events. If the absolute value of the difference is greater than or equal to the convergence tolerance, it indicates that the signal attenuation difference of all jump events' corresponding messages has an obvious discrete distribution, and further judgment is required through clustering.
[0050] In one specific implementation of this invention, the single-instance attenuation judgment threshold is set to 3dm. In real medical scenarios, the typical signal attenuation of the torso of medical staff is about 3dm. A single-instance signal attenuation difference of less than 3dm can be determined as signal attenuation caused by the fluctuation or movement of the underlying monitoring node itself.
[0051] In one specific implementation of this invention, the convergence tolerance is set to 1dm. In real medical scenarios, the resolution of the gateway for measuring signal strength is usually 1dm. When the absolute value of the difference between the maximum and minimum signal attenuation is less than 1dm, it is considered to be without significant difference in engineering and can be directly determined as a no-attenuation event.
[0052] Preferably, in some specific implementations of the embodiments of the present invention, the method for obtaining the severely attenuated event set and the non-attenuated event set includes: Messages determined as severely attenuated events during the branch decision process are assigned to the severely attenuated event set, while messages determined as non-attenuated events are assigned to the non-attenuated event set.
[0053] For the branch in the branch decision that performs clustering, the clustering is performed using the K-means clustering algorithm. The K-means clustering algorithm is used to classify all transition events in the concurrent device event record set into two categories. It should be noted that the K-means clustering algorithm is performed on a one-dimensional signal attenuation difference space, with the signal attenuation difference as the feature vector. In order to ensure the convergence of the algorithm, the initial cluster centers are the maximum and minimum values of the signal attenuation difference of the corresponding messages of all transition events in the concurrent device event record set, which are used as the initial first cluster center and the second cluster center, respectively. The messages corresponding to the transition events are then assigned to the initial severely attenuated event set and the non-attenuated event set, respectively. The subsequent iterative clustering process follows the steps of the standard K-means clustering algorithm. The K-means clustering algorithm is a technical means well known to those skilled in the art, and its specific content will not be elaborated.
[0054] When the change in the cluster center values obtained from two consecutive iterations of clustering calculation is less than the preset value, the clustering is determined to be complete. Clusters with larger cluster center values are mapped to severely decaying event sets, and clusters with smaller cluster center values are mapped to non-decaying event sets.
[0055] In one specific implementation of this invention, the preset value is set to 1dm, which corresponds to the convergence tolerance. When the change in cluster centers between two consecutive iterations is less than 1dm, the algorithm is considered to have converged stably in engineering terms. Continuing to iterate will not produce meaningful classification changes, thus ensuring the reliability of the clustering results and avoiding unnecessary iterative calculations.
[0056] Preferably, in some specific implementations of the embodiments of the present invention, after obtaining the severely decayed event set and the non-decayed event set, the method further includes: In real-world medical scenarios, some transition events may be misjudged as severely attenuated events due to medical staff passing by. To address the issue of misjudgment of severely attenuated events caused by special reasons, it is necessary to further determine whether medical staff are actually performing resuscitation operations. In real-world scenarios, medical staff usually carry name tag devices, which emit Bluetooth broadcast frames. Therefore, the signal can be extracted from the Bluetooth broadcast frames to determine whether medical staff are within the effective operating distance.
[0057] The received signal strength is extracted from the Bluetooth broadcast frames emitted by the name tag device carried by medical staff, and the maximum value of the received signal strength is defined as the name tag proximity signal peak value. The name tag proximity signal peak value reflects the physical distance between the medical staff closest to the gateway and the bed. The larger the name tag proximity signal peak value, the closer the medical staff is to the bed.
[0058] The peak value of the approach signal from the name tag is compared with a preset effective operating distance threshold. If the peak value is less than the threshold, it indicates that the medical staff is not within the effective operating distance, the bed is not in a resuscitation state, the severely attenuated event set of the concurrent device event record set is deemed invalid, the severely attenuated event set is cleared, and all transition events in it are assigned to the no-attenuation event set. If the peak value is greater than or equal to the effective operating distance threshold, it indicates that the medical staff is within the effective operating distance around the bed, the bed is in a resuscitation state, the severely attenuated event set of the concurrent device event record set is deemed valid, and the severely attenuated event set is retained.
[0059] In one specific implementation of this invention, the effective operating distance threshold is set to -65dBm. It should be noted that this effective operating distance threshold is a distance threshold expressed as the signal strength of the badge, not a physical unit of length. In real medical scenarios, when adult medical personnel operate the equipment from a bedside effective operating distance of 1.5 meters, the received signal strength of the Bluetooth broadcast frames emitted by their badges at the gateway is typically above -65dBm. This avoids misjudgments caused by personnel passing by and ensures the effectiveness of emergency decisions.
[0060] Preferably, in some specific implementations of the embodiments of the present invention, the specific methods for direct transmission and multiplexed transmission include: For packets corresponding to transition events within the severely attenuated event set, an independent Transmission Control Protocol (TCP) socket is requested. The packets are then encapsulated and sent directly to the network interface card (NIC) transmit buffer, and transmitted to the cloud server via a direct path. For packets corresponding to transition events within the non-attenuated event set, an independent socket is not allocated. Instead, the packets are concatenated at the application layer, that is, multiple short packets are strung together into a long data block, which is then pushed into a pre-established shared long connection channel and sent to the cloud server in batches according to a preset polling period.
[0061] In one specific implementation of this invention, the polling period can be set to 200 milliseconds, which can be adjusted according to network conditions and data real-time requirements.
[0062] It should be noted that the order of the above embodiments of the present invention is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. The processes depicted in the accompanying drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0063] The various embodiments in this specification are described in a progressive manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.
Claims
1. A secure communication method for IoT devices supporting multi-protocol adaptation, characterized in that, The method includes: The message length and signal strength are acquired in real time; the message length and signal strength reference values are determined based on the first message reported when accessing the network, and the message length and signal strength reference values are updated using an exponential moving average algorithm; The transition event is determined based on the change in the current message length and the message length baseline value; a concurrent device event record set is constructed based on the transition event and the preset concurrent collection time window; Based on the signal strength and signal strength baseline of the corresponding message of the transition event, the signal attenuation difference is calculated; based on the number of transition events in the concurrent device event record set and the signal attenuation difference of the corresponding message, branch decision is performed on each transition event to obtain the severe attenuation event set and the no attenuation event set; Transition event messages within the severely attenuated event set that pass the judgment are sent directly; transition event messages within the non-attenuated event set are multiplexed and sent.
2. The secure communication method for IoT devices supporting multi-protocol adaptation according to claim 1, characterized in that, The method for determining the transition event includes: The length increment difference of the current message is calculated based on the message length and the message length baseline value, and the jump percentage of the current message is calculated using the length increment difference of the current message; the jump event is determined based on the length increment difference of the current message and the jump percentage.
3. A secure communication method for IoT devices supporting multi-protocol adaptation according to claim 2, characterized in that, The method for obtaining the jump percentage includes: Subtract the baseline message length from the current message length to obtain the message length increment difference. Use the message length increment difference as the numerator and the baseline message length as the denominator to calculate the jump percentage of the current message.
4. A secure communication method for IoT devices supporting multi-protocol adaptation according to claim 2, characterized in that, The method for determining a transition event based on the current message length increment difference and transition percentage includes: When the length increment difference of the current message is greater than the preset transition lower limit, and the transition percentage of the current message is greater than the preset transition ratio threshold, it is determined that there is a transition event in the current message.
5. A secure communication method for IoT devices supporting multi-protocol adaptation according to claim 1, characterized in that, The method for constructing the concurrent device event log set includes: The starting time of the transition event is set as the starting point. Based on the starting point, the medium access control address, signal strength and signal strength baseline value of all IoT devices corresponding to the transition events within the preset concurrent collection time window are extracted. A concurrent device event record set is constructed based on the extracted data.
6. A secure communication method for IoT devices supporting multi-protocol adaptation according to claim 1, characterized in that, The method for obtaining the signal attenuation difference includes: The signal strength baseline value of the message corresponding to the transition event is subtracted from the signal strength to obtain the relative difference of the signal strength of the message; if the relative difference of the signal strength is less than or equal to zero, the signal attenuation difference is set to zero; if the relative difference of the signal strength is greater than zero, the signal attenuation difference is equal to the relative difference of the signal strength.
7. A secure communication method for IoT devices supporting multi-protocol adaptation according to claim 1, characterized in that, The specific methods for branch decision-making include: When the number of transition events in the concurrent device event record set is equal to 1, the signal attenuation difference of the corresponding message of the transition event is compared with the preset single-instance attenuation judgment threshold. If the signal attenuation difference is greater than or equal to the single-instance attenuation judgment threshold, it is judged as a severe attenuation event; otherwise, it is judged as a no-attenuation event. When the number of transition events in the concurrent device event log set is greater than 1, the minimum and maximum values of the signal attenuation difference of the corresponding messages for all transition events are taken. If the minimum value is greater than or equal to the single-instance attenuation judgment threshold, all transition events are determined to be severe attenuation events; if the maximum value is less than the single-instance attenuation judgment threshold, all transition events are determined to be no attenuation events. If the minimum value is less than the single-instance attenuation judgment threshold and the maximum value is greater than or equal to the single-instance attenuation judgment threshold, the absolute value of the difference between the maximum and minimum signal attenuation difference of the corresponding messages for all transition events is calculated and compared with a preset convergence tolerance. If the absolute value of the difference is less than the convergence tolerance, all transition events are determined to be no attenuation events; if the absolute value of the difference is greater than or equal to the convergence tolerance, the transition events in the concurrent device event log set are clustered.
8. A secure communication method for IoT devices supporting multi-protocol adaptation according to claim 7, characterized in that, The methods for obtaining the severely decayed event set and the non-decayed event set include: The K-means clustering algorithm was used to divide the concurrent device event record set into a severely decaying event set and a non-decaying event set.
9. A secure communication method for IoT devices supporting multi-protocol adaptation according to claim 1, characterized in that, After obtaining the severely decayed event set and the undecayed event set, the following is also included: The distance between the medical staff's name tag and the bed is obtained based on the Bluetooth broadcast frames emitted by the medical staff's name tag; the distance between the medical staff's name tag and the bed in the concurrent device event record set is compared with a preset effective operating distance threshold. If the distance between the medical staff's name tag and the bed is greater than or equal to the effective operating distance threshold, the severely attenuated event set divided by the concurrent device event record set is determined to be invalid, and the severely attenuated event set is forcibly cleared; if the distance between the medical staff's name tag and the bed is less than the effective operating distance threshold, the severely attenuated event set divided by the concurrent device event record set is determined to be valid, and the severely attenuated event set is retained.
10. A secure communication method for IoT devices supporting multi-protocol adaptation according to claim 1, characterized in that, The specific methods for direct transmission and multiplexed transmission include: For packets corresponding to transition events within the severely attenuated event set that pass the judgment, an independent socket is allocated, and the packets are sent to the cloud server via a direct path based on the independent socket; for packets corresponding to transition events within the non-attenuated event set, packets are sent to the cloud server in batches with a delay.