A cellular internet of things multi-node keep-alive communication system and method
By intercepting and clustering node data streams in gateway devices, the problem of traffic waste and low bandwidth efficiency caused by independent keep-alive of multiple nodes in cellular IoT is solved, achieving more efficient keep-alive communication management and improved stability.
Patent Information
- Application Number
- CN202511150314.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-18
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2045-08-18
AI Technical Summary
In the existing technology, independent keep-alive of multiple nodes in the cellular Internet of Things leads to waste of cellular traffic, low efficiency of bandwidth resource utilization, disordered keep-alive timing causing an increase in peak-to-average ratio, and keep-alive connections being susceptible to network congestion, resulting in the problem of erroneous judgment of network disconnection.
By deploying modules in gateway devices to intercept and copy node data streams, extract specified messages, perform sequence matching and feature vector clustering, establish periodic keep-alive channels, and uniformly send keep-alive probe requests to the target server, the redundant communication and peak bandwidth impact can be reduced.
It reduces cellular traffic costs, improves bandwidth utilization, reduces network resource consumption, enhances communication stability and response success rate, and enables centralized management and dynamic scheduling of node keep-alive communication.
Smart Images

Figure CN120676477B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of Internet of Things communication, and in particular to a cellular Internet of Things multi-node keep-alive communication system and method. BACKGROUND
[0002] In today's wide deployment of the Internet of Things, a large number of communication nodes need to maintain long-term and stable connections with remote servers through cellular networks to realize real-time data synchronization, remote operation and maintenance, and security control. In particular, in scenarios such as shared charging, intelligent energy, and urban infrastructure, multiple nodes often access the same gateway and are connected to the external Internet through the cellular network of the gateway. This "multi-node access to the same cellular gateway" topology has become a typical architecture of cellular Internet of Things. Usually, in this kind of network topology, each communication node uses a periodic keep-alive (heartbeat) mechanism to send a probe request to the remote server to maintain network connection and detect link reachability. These probe activities not only help the application layer to perceive network changes and timely rebuild connection status, but also maintain address mapping in NAT (Network Address Translation) devices, so as to ensure that the server can actively access the terminal node. In the prior art, lightweight protocols such as Internet Control Message Protocol and Domain Name System Protocol are often used to complete the above-mentioned probe task, and the probe method includes fixed period, event triggering or a combination of both, and allows carrying of lightweight business data to improve bandwidth utilization.
[0003] However, under this architecture, multiple nodes independently send keep-alive probe requests to the server, which has a series of obvious technical defects. First, due to the lack of coordination among nodes, keep-alive connections form a large number of repeated links between the gateway and the remote server, which not only causes waste of cellular traffic costs, but also puts pressure on limited bandwidth resources. Second, the timing overlap of periodic probes by multiple nodes can cause sharp peak loads of keep-alive traffic on the gateway, increase the peak-to-average ratio, intensify communication link jitter, and reduce overall bandwidth utilization. In addition, the gateway cannot perceive the priority of keep-alive data packets when forwarding them, which can easily cause keep-alive probes to fail in network congestion, thereby causing nodes to misjudge network disconnection and reset the connection, affecting the stable transmission of actual business.
[0004] Furthermore, since the gateway and the nodes usually come from different manufacturers and have limited protocol layer collaboration capabilities, the current system cannot be optimized from the architecture level. The existing keep-alive mechanism cannot fully utilize the low-cost and high-reliability characteristics of local communication between nodes and gateways, nor can it aggregate and intelligently schedule keep-alive behavior based on global traffic perception on the gateway side, so it is difficult to balance multiple dimensions such as link stability, traffic economy, and resource utilization. SUMMARY
[0005] (1) Technical problems to be solved
[0006] In view of the above-mentioned defects and deficiencies of the prior art, the present application provides a cellular Internet of Things multi-node keep-alive communication system and method, which solves the technical problems of the prior art that the multi-node independent keep-alive leads to cellular traffic waste, connection redundancy, low bandwidth resource utilization efficiency, peak-to-average ratio increase caused by disordered keep-alive timing, and misjudgment of the network due to the influence of network congestion on keep-alive connection.
[0007] (II) Technical solutions
[0008] In order to achieve the above-mentioned purpose, the main technical solution adopted by the present application includes:
[0009] In a first aspect, the present embodiment provides a cellular Internet of Things multi-node keep-alive communication system, which is deployed in a gateway device in an Internet of Things topology, and the system comprises:
[0010] A first module is configured to intercept and copy, in a bypass manner, uplink and downlink data streams of a plurality of nodes in the Internet of Things topology forwarded through the gateway device, so as to obtain data packets containing complete protocol content, and extract specified messages from the data packets;
[0011] A second module is configured to receive the specified messages extracted by the first module, and perform the following operations:
[0012] Match the specified messages with a pre-stored sequence, and if the matching is successful, update the field information of the matched sequence and determine the sequence state thereof;
[0013] Based on the specified messages matched with the sequence, update the sequence state and the sequence period of the sequence;
[0014] Based on the specified messages matched with the sequence and the sequence period corresponding to the sequence, extract a feature vector of the sequence, and use the feature vectors of the sequences to cluster and group the sequences;
[0015] According to the clustering and grouping result, establish a periodic keep-alive channel between the gateway device and target servers in the Internet of Things topology, and use the cellular network IP address obtained by the gateway device as a source address, and send keep-alive probe requests to the target servers according to the sending time slots;
[0016] The sending time slots are determined by the sequence periods of the sequences in the clustering and grouping;
[0017] After receiving responses of the target servers to the keep-alive probe requests, update the keep-alive state of the sequence according to the response result, and feed back the keep-alive state to the corresponding node in the Internet of Things topology.
[0018] Preferably, in some embodiments of the present application, the first module comprises a data duplication unit and a plurality of protocol filtering units;
[0019] The data copying unit is configured to intercept and copy uplink and downlink data streams of a plurality of nodes in the Internet of Things topology forwarded through the gateway device by a bypass mode, to obtain data packets containing complete protocol contents, and to identify protocol types of the data packets and distribute the data packets to protocol filtering units corresponding to the protocol types.
[0020] The plurality of protocol filtering units are respectively configured for different protocol types, and each protocol filtering unit is configured to receive data packets of a corresponding protocol type and extract specified messages from the data packets, and send the specified messages to the second module.
[0021] The specified messages include a time stamp of a receiving time, a source IP in a packet header, a destination IP in the packet header, a message type, and a packet length obtained from the extracted data packets.
[0022] Preferably, in some embodiments of the present application, the second module includes a sequence storage unit, a keep-alive unit, and a plurality of sequence calculation units.
[0023] The plurality of sequence calculation units respectively correspond to the plurality of protocol filtering units in the first module one by one, and each sequence calculation unit is configured to receive specified messages of a corresponding protocol type and perform the following operations:
[0024] matching the specified messages with a sequence pre-stored in the sequence storage unit, and if the matching is successful, updating field information of the matched sequence and determining a sequence state of the sequence;
[0025] updating the sequence state and a sequence period of the sequence based on the specified messages matched with the sequence;
[0026] extracting a feature vector of the sequence based on the specified messages matched with the sequence and the sequence period corresponding to the sequence;
[0027] The keep-alive unit is configured to cluster and group sequences based on the feature vectors extracted by the plurality of sequence calculation units, and establish a periodic keep-alive channel between the gateway device and target servers in the Internet of Things topology according to a clustering result, to send keep-alive probe requests to the target servers at a first time interval with a cellular network IP address obtained by the gateway device as a source address.
[0028] The sequence calculation unit is further configured to update a keep-alive state of a corresponding sequence based on a response result of the target servers to the keep-alive probe requests after receiving the responses, and feed back the keep-alive state to corresponding nodes in the Internet of Things topology.
[0029] Preferably, in some embodiments of the present application, at least one sequence is pre-stored in the sequence storage unit, and each sequence includes the following field information:
[0030] update time, used for recording the time stamp of the last time when the specified message matches the sequence; sequence code, used for identifying the unique code field of the sequence; packet header source IP list, used for storing the source IP address obtained by the node from the gateway device in the Internet of Things topology; packet header destination IP, used for identifying the target server IP address in the Internet of Things topology; packet length, used for recording the packet length;
[0031] sequence state, used for representing the state of the current sequence, the sequence state including a first state, a second state, a third state and a fourth state; message type, used for representing the message protocol type field; domain name system request body, used for storing the domain name list initiated by the node in the domain name system protocol type keep-alive; sequence period, used for recording the sequence keep-alive period field; remaining survival time, used for indicating the remaining time of waiting for the next specified message to arrive; keep-alive state, used for representing the keep-alive state field whether the last keep-alive detection request of the sequence is successful; keep-alive reply information, used for storing the information of the target server responding to the keep-alive detection request; sequence feature vector, used for representing the vector of the sequence features extracted based on the specified message; keep-alive group, used for representing the sequence belonging to the keep-alive cluster group field.
[0032] Preferably, in some embodiments of the present application, the condition for matching success is that the packet header destination IP, the message type and the packet length in the received specified message are all the same as the corresponding field information in any pre-stored sequence;
[0033] matching the specified message with the pre-stored sequence, if the matching is successful, updating the field information of the matched sequence and determining the sequence state thereof, specifically including:
[0034] adding the packet header source IP in the specified message to the packet header source IP list field of the matched sequence;
[0035] updating the time stamp of the received packet in the specified message to the update time in the field information of the matched sequence;
[0036] resetting the remaining survival time in the field information of the matched sequence to a preset initial value, the remaining survival time being a decreasing timer, and when the value thereof decreases to 0, the following processing is performed:
[0037] if the sequence state of the matched sequence is the first state, deleting the sequence from the sequence storage unit;
[0038] if the sequence state is the second state, updating it to the fourth state;
[0039] if the sequence state is the third state, keeping the current state unchanged;
[0040] If the sequence state is the fourth state, the sequence state is updated to the first state;
[0041] The first state indicates that the sequence currently receives only one designated message, and the sequence period in the field information of the sequence is set to -1.
[0042] The second state indicates that the sequence receives multiple designated messages within the remaining time before the next designated message arrives, but the sequence period has not been confirmed, and the sequence period in the field information of the sequence is set to -1.
[0043] The third state indicates that the sequence has confirmed the sequence period, and the last state is the second state, and the sequence period in the field information of the sequence has a period value.
[0044] The fourth state indicates that the period calculation is not completed because the number of received designated messages is less than the preset minimum value, and the sequence period in the field information of the sequence is set to -1.
[0045] The sequence calculation unit is further configured to, when the received designated message fails to match the pre-stored sequence in the sequence storage unit, generate a sequence corresponding to the designated message, and set the sequence state of the generated sequence to the first state.
[0046] The field information of the generated sequence is all initial values extracted from the designated message.
[0047] Preferably, in some embodiments of the present application, the sequence state and the sequence period of the sequence are updated based on the designated message matched with the sequence, specifically comprising:
[0048] Extracting the timestamps of the k designated messages currently received by the sequence, and converting the timestamps into a relative time sequence based on the timestamp of the first designated message; wherein k is greater than the preset minimum value.
[0049] For the relative time sequence, constructing a time interval sequence based on the difference between adjacent timestamps.
[0050] Sorting the time interval sequence, obtaining the first quartile Q1 and the third quartile Q3 of the sorted time interval sequence, and calculating the interquartile range IQR based on the first quartile Q1 and the third quartile Q3; regarding all time intervals less than the lower limit value or greater than the upper limit value as abnormal values and eliminating them, and retaining the remaining data to form a non-jump time interval set.
[0051] Wherein, IQR = Q3 - Q1; lower limit value = Q1 - 1.5 * IQR; upper limit value = Q3 + 1.5 * IQR.
[0052] Based on the non-jump time interval set, calculating the average value, the standard deviation, and determining the coefficient of variation based on the average value and the standard deviation; the coefficient of variation = standard deviation / average value.
[0053] When the coefficient of variation is less than the set threshold value, it is determined that the current sequence has periodicity, and the initial period estimation value is taken as the average value of the set of non-jump time intervals;
[0054] If the sequence satisfies the condition that the coefficient of variation is less than the threshold value in the subsequent M consecutive designated messages, the subsequent determination is terminated in advance, and the initial period estimation value is taken as the final period estimation value;
[0055] If the number of received designated messages reaches the preset maximum value and the final period estimation value is not obtained, it is considered that the sequence does not have periodicity;
[0056] The sequence calculation unit sends the periodicity determination result to the sequence storage unit:
[0057] If the sequence has periodicity, the sequence period in the field information of the sequence is updated to the final period estimation value, and the sequence state in the field information of the sequence is updated to the third state;
[0058] If the sequence does not have periodicity, the sequence period in the field information of the sequence remains the initial value, and the sequence state in the field information of the sequence remains unchanged.
[0059] Preferably, in some embodiments of the present application, the feature vector of the sequence is extracted based on the designated message matched by the sequence and the sequence period corresponding to the sequence, specifically including:
[0060] The timestamp of the first designated message in the sequence is taken as the zero moment;
[0061] Based on the sequence period in the field information of the sequence, the phase offset of each designated message timestamp relative to the sequence period position is calculated using the following formula:
[0062] ;
[0063] is the timestamp of the first designated message of the sequence; i is the sequence code of the sequence; is the timestamp of the kth designated message; is the value of the sequence period in the field information of the sequence with the sequence code i; is the phase offset of the timestamp of the kth designated message relative to the sequence period position;
[0064] The phase offset of each designated message timestamp relative to the sequence period position corresponding to the sequence is counted, and the variance of the counted phase offset of the sequence is obtained;
[0065] Each statistical feature is normalized to scale it to the interval [0, 1] to obtain the normalized statistical feature;
[0066] The statistical features include: variance of phase offset of the sequence, first feature of the sequence, second feature of the sequence;
[0067] The first feature = final period estimation value;
[0068] The second feature = IQR / median of sorted time interval sequence;
[0069] The normalized statistical features are combined to form a feature vector, and the feature vector is written into the field information of the sequence storage unit corresponding to the sequence in the third state.
[0070] Preferably, in some embodiments of the present application, the keep-alive unit clusters and groups each sequence based on the feature vectors extracted by the plurality of sequence calculation units, and establishes a periodic keep-alive channel between the gateway device and the target server in the Internet of Things topology according to the clustering result, so that the gateway device acquires the cellular network IP address as the source address, and sends keep-alive probe requests to each target server according to the sending time slot, specifically including:
[0071] The keep-alive unit obtains the sequence feature vector of each sequence in the third state and whose sequence period field is not -1 from the sequence storage unit;
[0072] The distance metric of each sequence is calculated by using the following formula:
[0073] + + ;
[0074] is the distance metric of the sequence with sequence code i; is the first proportion parameter; is the second proportion parameter; is the third proportion parameter; is the normalized first feature corresponding to the sequence with sequence code i; is the first feature of the initial centroid of the K-means algorithm corresponding to the sequence with sequence code j; is the normalized second feature corresponding to the sequence with sequence code i; is the second feature of the initial centroid of the K-means algorithm corresponding to the sequence with sequence code j; is the normalized variance of phase offset corresponding to the sequence with sequence code i; is the variance of phase offset of the initial centroid of the K-means algorithm corresponding to the sequence with sequence code j;
[0075] The clustering effect under different K values is evaluated based on the elbow rule to determine the optimal clustering number K to minimize the within-cluster sum of squares error.
[0076] The K-means clustering method is used to divide the sequences into K clustering groups, and the clustering result is updated to the keep-alive group of each sequence in the sequence storage unit.
[0077] The keep-alive unit determines the keep-alive sending period of each keep-alive channel according to the sequence period of the sequences in each clustering group, and the keep-alive sending period takes the value of the minimum sequence period in the clustering group.
[0078] An initial keep-alive sending queue is established in each keep-alive channel, and the length of the keep-alive sending queue is equal to the value of the minimum sequence period in the clustering group.
[0079] Each sending time slot in the keep-alive sending queue corresponds to a unique target server IP in the clustering group.
[0080] The length of the sending time slot is: the value of the minimum sequence period in the group ÷ the number of target server IPs in the group.
[0081] The keep-alive unit sorts each sequence timestamp in the sending queue in chronological order, takes the cellular network IP address obtained by the gateway device as the source IP, and sends the proxy keep-alive probe request to each target server IP in the queue according to the sending time slot.
[0082] At the end of each sending time slot, the keep-alive unit updates the keep-alive state field of all sequences in the group according to the received response, and the keep-alive state field is normal or abnormal.
[0083] When the keep-alive unit does not receive a response from the target server in the current sending time slot, and the sending time slot is not exhausted, the keep-alive unit repeatedly sends the proxy keep-alive request in the sending time slot to form intensive probes until the target server response is received or the sending time slot is exhausted.
[0084] When the target server response is received, the keep-alive unit updates the keep-alive state field and the keep-alive reply information field of each sequence in the group according to the response result, and if the keep-alive state is normal, generates a keep-alive response data corresponding to the protocol and forwards it to the node.
[0085] Preferably, in some embodiments of the present application, the sequence calculation unit is also used to update the keep-alive state of the corresponding sequence based on the response result after receiving the response of the target server to the keep-alive probe request, and feed back the keep-alive state to the corresponding node in the Internet of Things topology, specifically including:
[0086] The sequence calculation unit is configured to update the keep-alive state field and the keep-alive reply information field of the sequence associated with the request based on the response of the target server to the keep-alive probe request after the response is received, and determine whether to feed back keep-alive response information to the corresponding node according to the keep-alive state of the sequence.
[0087] If the keep-alive state field is normal, the sequence calculation unit constructs a keep-alive response data packet corresponding to the protocol type used by the node and sends it to the node, specifically including:
[0088] When the protocol type corresponding to the specified message is the Internet Control Message Protocol, a network connectivity test response data packet for answering is constructed, the source IP address of the data packet is the destination IP of the sequence header, the destination IP address is the node IP address, and the response delay is set based on the keep-alive reply information field.
[0089] When the protocol type corresponding to the specified message is the Domain Name System Protocol, a Domain Name System response data packet for responding to a query request is constructed, the source IP address of the data packet is the destination IP of the sequence header, the destination IP address is the node IP address, and the domain name resolution result is set based on the keep-alive reply information field.
[0090] If the keep-alive state field is abnormal, the keep-alive response data packet is not sent to the node.
[0091] When the protocol type corresponding to the specified message is the Internet Control Message Protocol, the network connectivity test response data packet for answering is constructed, and the packet length field of the corresponding sequence is adapted and filled to simulate the preset return packet corresponding to the original network connectivity test request probe message initiated by multiple nodes.
[0092] When the protocol type corresponding to the specified message is the Domain Name System Protocol, a Domain Name System response data packet for responding to a query request is constructed, and the domain name resolution result in the Domain Name System request body is fed back to multiple nodes.
[0093] In a second aspect, the embodiment also provides a cellular Internet of Things multi-node keep-alive communication method, which is executed by the cellular Internet of Things multi-node keep-alive communication system of the first aspect, and includes:
[0094] The first module intercepts and copies the uplink and downlink data streams of multiple nodes in the Internet of Things topology structure forwarded through the gateway device to obtain data packets containing complete protocol content, and extracts specified messages from the data packets respectively.
[0095] The second module receives the specified messages extracted by the first module and performs the following operations:
[0096] matching the specified message with a pre-stored sequence, if the matching is successful, updating the field information of the matched sequence and determining the sequence state thereof;
[0097] updating the sequence state and the sequence period of the sequence based on the specified message matched with the sequence;
[0098] extracting the feature vector of the sequence based on the specified message matched with the sequence and the sequence period corresponding to the sequence, and clustering the sequences by using the feature vectors of the sequences;
[0099] establishing a periodic keep-alive channel between the gateway device and the target server in the Internet of Things topology according to the clustering result, and sending a keep-alive probe request to each target server according to the sending time slot by taking the cellular network IP address obtained by the gateway device as the source address;
[0100] The sending time slot is determined by the sequence period of the sequence in the clustering group.
[0101] After receiving the response of the target server to the keep-alive probe request, updating the keep-alive state of the sequence according to the response result, and feeding back the keep-alive state to the corresponding node in the Internet of Things topology.
[0102] (Three) beneficial effects
[0103] The cellular Internet of Things multi-node keep-alive communication system and method provided by the present application can intercept and copy the uplink and downlink data streams of multiple nodes forwarded by the gateway device in a bypass manner through the first module, obtain data packets containing complete protocol content, and extract specified messages by multiple protocol filtering units. The second module performs sequence matching, state updating and period calculation on the extracted specified messages by multiple sequence calculation units, and clusters based on the feature vectors, so that the keep-alive messages with similar period characteristics sent by multiple nodes in the Internet of Things can be automatically identified, the grouping management of keep-alive sequences can be completed, and the systematicness and accuracy of keep-alive processing can be improved.
[0104] The periodic keep-alive channel established based on the clustering result by the cellular Internet of Things multi-node keep-alive communication system provided by the present application can take the cellular network IP address obtained by the gateway device as the source address, and send a proxy keep-alive probe request to the target server according to the sending time slot in the clustering group. By sharing one keep-alive probe request by multiple sequences, the combined transmission of keep-alive probes is realized, the repeated communication in the cellular network is significantly reduced, and the occupation of network resources is reduced. BRIEF DESCRIPTION OF DRAWINGS
[0105] Figure 1 The structure schematic diagram of the cellular Internet of Things multi-node keep-alive communication system according to an embodiment of the present application;
[0106] Figure 2A kind of Internet of Things topology schematic diagram in prior art;
[0107] Figure 3 It is the specific structure schematic diagram of cellular Internet of Things multi-node keep-alive communication system in the embodiment of the application;
[0108] Figure 4 Suppose the protocol type of data packet in the embodiment is internet control message protocol type, the specified message extracted;
[0109] Figure 5 It is the schematic diagram of cellular Internet of Things multi-node keep-alive communication system according to the embodiment of the application is deployed in Internet of Things topology structure. DETAILED DESCRIPTION
[0110] In order to better explain the present application, so as to facilitate understanding, the present application is described in detail below by specific embodiments, combined with the drawings.
[0111] In related art, the keep-alive communication of multi-node in cellular Internet of Things usually relies on each node independently to send internet control message protocol, domain name system protocol type of probe message in a periodic or event triggered manner to maintain the active state of network connection. However, referring to Figure 2In a network topology where a large number of nodes access the Internet through the same gateway device, the existing keep-alive mechanism has several significant deficiencies: first, the keep-alive probes independently initiated by each node repeatedly establish a large number of connections between the gateway device and the server, resulting in redundant communication, excessive occupation of the bandwidth resources of the cellular network, and additional cost consumption; second, due to the lack of coordination mechanism among nodes, the time distribution of their keep-alive probes is random and seriously overlapping, which easily causes the peak value of bandwidth usage to rise, thereby increasing the peak-to-average ratio of the communication link and affecting the overall bandwidth utilization and business transmission stability; third, the existing technology lacks the use of the local connection characteristics of the gateway device and the nodes, and fails to take advantage of the stable node-gateway connection and the billing-free advantage to alleviate the pressure on the cellular link; fourth, when the network quality decreases, the keep-alive probe packets are queued with other business data packets in the gateway device, and without being given a priority control mechanism, they are easily lost in transmission, misleading the nodes to judge that the current link has been disconnected, and thereby causing unnecessary interruption risks. To this end, the cellular Internet of Things multi-node keep-alive communication system and method provided by the present application realizes the bypass interception of node uplink and downlink communication data and the extraction of specified messages based on the first module of the gateway device, matches the specified messages with the pre-stored sequences by means of the second module, and realizes the clustering grouping of multiple sequences through periodic identification and feature vector extraction, on the basis of which a periodic keep-alive channel is established, and the gateway uniformly proxies the keep-alive probe request to the remote server. This scheme not only avoids the redundant behavior of repeated detection by multiple nodes and reduces the peak bandwidth impact caused by overlapping detection, but also supports the execution of intensive detection on demand when the detection fails, improves the response success rate, and returns the keep-alive state feedback information through the local connection, thereby realizing the centralized management, dynamic scheduling and state monitoring of the node keep-alive communication behavior, and having the advantages of more controllable communication load, more timely response feedback, and more efficient network resource utilization, and being suitable for cellular Internet of Things application scenarios such as multi-node intensive deployment and limited link resources.
[0112] In order to better understand the above technical solutions, the exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided to enable a clearer, more thorough understanding of the present application and to convey the complete scope of the present application to those skilled in the art.
[0113] The present embodiment provides a cellular Internet of Things multi-node keep-alive communication system, which is deployed in a gateway device in an Internet of Things topology to form a cellular Internet of Things multi-node keep-alive communication system as shown in Figure 5 The cellular Internet of Things multi-node keep-alive communication system is deployed in a schematic diagram of an Internet of Things topology, and the existing Internet of Things topology in the present embodiment is as shown in Figure 2As shown, the cellular Internet of Things multi-node keep-alive communication system, like Figure 1 As shown, comprising:
[0114] The first module is configured to intercept and copy, in a bypass manner, uplink and downlink data streams of a plurality of nodes in an Internet of Things topology structure forwarded through the gateway device, to obtain data packets containing complete protocol content, and extract specified messages from the data packets;
[0115] Specifically, referring to Figure 3 In the specific structure of the cellular Internet of Things multi-node keep-alive communication system, the first module includes a data duplication unit and a plurality of protocol filtering units; wherein the data duplication unit is configured to intercept and copy, in a bypass manner, uplink and downlink data streams of a plurality of nodes in an Internet of Things topology structure forwarded through the gateway device, to obtain data packets containing complete protocol content, and identify the protocol type of the data packets, and distribute the data packets to the protocol filtering unit corresponding to the protocol type thereof;
[0116] The plurality of protocol filtering units are respectively configured for different protocol types, and each protocol filtering unit is configured to receive data packets of the corresponding protocol type, and extract specified messages therefrom, and send the specified messages to the second module; the specified messages include a time stamp of a reception time, a packet header source IP, a packet header destination IP, a message type, and a packet length obtained from the extracted data packets.
[0117] It should be noted that the protocol type of the data packet in the present embodiment includes but is not limited to the Internet Control Message Protocol and the Domain Name System protocol type. For example, assuming that the protocol type of the data packet in the present embodiment is the Internet Control Message Protocol, then the specified messages extracted from the data packet of the Internet Control Message Protocol include a time stamp, a packet header source IP, a packet header destination IP, a message type, and a packet length, as shown in Figure 4 .
[0118] The present embodiment realizes that the configuration of the protocol filtering unit corresponds to the protocol type of the data packet one by one by setting the data duplication unit and the plurality of protocol filtering units corresponding to the protocol types in the first module, and directly extracting the "specified message" field based on the standard protocol packet header structure, which has good modularity and scalability. The currently listed Internet Control Message Protocol and Domain Name System protocol are standard protocols, the packet structure is stable, the field format is fixed, and other common protocols (such as HTTP, MQTT, CoAP, etc.) can be easily extended. Each protocol filtering unit in the first module can quickly extract the specified message by identifying the standard protocol header field (such as source IP, destination IP, message type, packet length, etc.), avoiding deep analysis of the protocol body or complex load, saving computing resources, and improving processing efficiency.
[0119] The second module is configured to receive the specified message extracted by the first module and perform the following operations:
[0120] matching the specified message with a pre-stored sequence, updating field information of the matched sequence and determining a sequence state of the sequence if the matching is successful;
[0121] updating the sequence state and a sequence period of the sequence based on the specified message matched with the sequence;
[0122] extracting a feature vector of the sequence based on the specified message matched with the sequence and the sequence period corresponding to the sequence, and clustering and grouping the sequences by using the feature vectors of the sequences;
[0123] establishing a periodic keep-alive channel between the gateway device and a target server in the Internet of Things topology according to the clustering and grouping result, sending a keep-alive probe request to each target server by using the cellular network IP address obtained by the gateway device as a source address and according to a sending time slot determined by the sequence period of the sequence in the clustering and grouping, updating a keep-alive state of the sequence according to a response result after receiving a response of the target server to the keep-alive probe request, and feeding back the keep-alive state to a corresponding node in the Internet of Things topology.
[0124] Referring to Figure 3 In the specific structure of the cellular Internet of Things multi-node keep-alive communication system, the second module includes a sequence storage unit, a keep-alive unit, and a plurality of sequence calculation units.
[0125] The plurality of sequence calculation units respectively correspond to the plurality of protocol filtering units in the first module one by one, and each sequence calculation unit is configured to receive a specified message of a protocol type corresponding to the sequence calculation unit and perform the following operations:
[0126] matching the specified message with a pre-stored sequence in the sequence storage unit, updating field information of the matched sequence and determining a sequence state of the sequence if the matching is successful;
[0127] updating the sequence state and a sequence period of the sequence based on the specified message matched with the sequence;
[0128] extracting a feature vector of the sequence based on the specified message matched with the sequence and the sequence period corresponding to the sequence;
[0129] The keep-alive unit is configured to cluster and group the sequences by using the feature vectors extracted by the plurality of sequence calculation units, and establish a periodic keep-alive channel between the gateway device and a target server in the Internet of Things topology according to the clustering result, send a keep-alive probe request to each target server by using the cellular network IP address obtained by the gateway device as a source address and according to a first time interval;
[0130] The sequence calculation unit is further configured to update a keep-alive state of a corresponding sequence based on a response result after receiving a response of the target server to the keep-alive detection request, and feed back the keep-alive state to a corresponding node in the Internet of Things topology.
[0131] In the embodiment, the second module includes a plurality of sequence calculation units corresponding to different types of specified messages output by the protocol filtering units in the first module. Each sequence calculation unit processes its own protocol type message and uses a unified data structure for matching and analysis, thereby having good protocol expansion and adaptability. No matter what kind of protocol type message is added, only the corresponding sequence calculation unit needs to be added, without the need to reconstruct the overall logic.
[0132] Specifically, the sequence storage unit pre-stores at least one sequence, wherein each sequence includes the following field information:
[0133] an update time for recording a time stamp of the last time the specified message of the sequence is matched; a sequence code for identifying a unique code field of the sequence; a source IP list of a packet header for storing a source IP address obtained by a node in the Internet of Things topology from a gateway device; a destination IP of a packet header for identifying a target server IP address in the Internet of Things topology; a packet length for recording a data packet length;
[0134] a sequence state for indicating a current state of the sequence, the sequence state including a first state, a second state, a third state, and a fourth state; a message type for indicating a message protocol type field; a domain name system request body for storing a domain name list initiated by a node in a domain name system protocol type keep-alive; a sequence period for recording a sequence keep-alive period field; a remaining survival time for indicating a remaining time for waiting for the next specified message to arrive; a keep-alive state for indicating a keep-alive state field of whether the last keep-alive detection request is successful; keep-alive reply information for storing information of a target server responding to a keep-alive detection request; a sequence feature vector for indicating a sequence feature vector extracted based on the specified message; and a keep-alive group for indicating a sequence belonging to a keep-alive cluster group field.
[0135] In the embodiment, the second module provides a set of lightweight sequence structure with clear structure, fixed field, and small calculation amount through the sequence storage unit, including, for example, update time, source / destination IP, message type, packet length, keep-alive state, feature vector, etc. The unified structure facilitates data sharing and operation among multiple modules, significantly reduces read / write and matching overhead, improves system response speed, and is particularly suitable for resource-limited gateway device operating environments.
[0136] The condition for the matching success is that the IP in the packet header destination, the message type and the packet length in the received specified message are all the same as the corresponding field information in any pre-stored sequence; specifically, based on the strategy of key field matching, the specified message is ensured to be accurately attributed, and when the specified message is processed, the key fields such as the destination IP, the message type and the packet length are used for sequence matching. This method can effectively distinguish the messages belonging to different keep-alive channels, ensure the uniqueness of the keep-alive sequence, and avoid misattribution, confusion and redundant analysis. When multiple nodes send keep-alive packets to the same target server through a gateway with the same protocol and content, the system attributes these specified messages to the same keep-alive sequence, and adds the source IP of the node to the packet header source IP list, indicating that these nodes share a keep-alive channel. This mechanism supports multi-node aggregation identification and centralized keep-alive, significantly reducing the detection frequency and network load.
[0137] The specified message is matched with the pre-stored sequence, and if the matching is successful, the field information of the matched sequence is updated and the sequence state thereof is determined, specifically including:
[0138] The packet header source IP in the specified message is added to the packet header source IP list field of the matched sequence;
[0139] The timestamp of the received packet in the specified message is updated to the update time in the field information of the matched sequence;
[0140] The remaining survival time in the field information of the matched sequence is reset to a preset initial value, and the remaining survival time is a decreasing timer, and when the value thereof decreases to 0, the following processing is performed:
[0141] If the sequence state of the matched sequence is the first state, the sequence is deleted from the sequence storage unit; if the sequence state is the second state, the sequence state is updated to the fourth state; if the sequence state is the third state, the current state is kept unchanged; and if the sequence state is the fourth state, the sequence state is updated to the first state;
[0142] Wherein, the first state indicates that the sequence currently receives only one specified message, and the sequence period in the field information of the sequence is set to -1; the second state indicates that the sequence receives multiple specified messages within the remaining time waiting for the next specified message to arrive, but the sequence period has not been confirmed, and the sequence period in the field information of the sequence is set to -1; the third state indicates that the sequence period has been confirmed, and the previous state thereof is the second state, and the sequence period in the field information of the sequence has a period value; and the fourth state indicates that the sequence period calculation is not completed because the number of received specified messages is less than the preset minimum value, and the sequence period in the field information of the sequence is set to -1;
[0143] The sequence calculation unit is further configured to generate a sequence corresponding to the specified message when the received specified message fails to match the pre-stored sequence in the sequence storage unit, and set a sequence state of the generated sequence as a first state.
[0144] The field information of the generated sequence is an initial value extracted from the specified message.
[0145] Preferably, in some embodiments of the present application, the sequence state and the sequence period of the sequence are updated based on the specified message matched with the sequence, specifically comprising:
[0146] extracting time stamps of k specified messages currently received by the sequence, and converting the time stamps into a relative time sequence based on a time stamp of a first specified message as a reference; wherein k is greater than a preset minimum value; for the relative time sequence, constructing a time interval sequence based on differences between adjacent time stamps;
[0147] sorting the time interval sequence, obtaining a first quartile Q1 and a third quartile Q3 of the sorted time interval sequence, and calculating a interquartile range IQR based on the first quartile Q1 and the third quartile Q3; regarding all time intervals less than a lower limit value or greater than an upper limit value as abnormal values and eliminating the abnormal values, and retaining the remaining data to form a non-jump time interval set; wherein IQR = Q3-Q1; the lower limit value = Q1-1.5*IQR; the upper limit value = Q3+1.5*IQR;
[0148] calculating an average value and a standard deviation based on the non-jump time interval set, and determining a coefficient of variation based on the average value and the standard deviation; the coefficient of variation = standard deviation / average value; when the coefficient of variation is less than a set threshold value, it is determined that the current sequence has periodicity, and an initial period estimation value is taken as the average value of the non-jump time interval set; if the sequence satisfies the condition that the coefficient of variation is less than the threshold value in subsequent continuous M specified messages, the subsequent judgment is terminated in advance, and the initial period estimation value is taken as a final period estimation value; if the number of received specified messages reaches a preset maximum value and the final period estimation value is not obtained, it is considered that the sequence does not have periodicity characteristics;
[0149] the sequence calculation unit sends the periodicity determination result to the sequence storage unit:
[0150] if the sequence has periodicity, the sequence period in the field information of the sequence is updated to the final period estimation value, and the sequence state in the field information of the sequence is updated to a third state; if the sequence does not have periodicity, the sequence period in the field information of the sequence remains an initial value, and the sequence state in the field information of the sequence remains unchanged.
[0151] For example, in the embodiment, the sequence calculation unit realizes the identification and estimation of periodicity by normalizing the received specified message timestamps, statistical analysis and volatility judgment. Specifically, taking a certain sequence as an example, it is assumed that k = 12 Internet Control Message Protocol type specified messages have been received, the system first converts the original timestamp of each message into a relative time sequence with the first message timestamp as the reference, the unit is second, and the following results are obtained: T(k) = [0.0, 2.1, 4.3, 6.0, 8.2, 10.1, 12.0, 14.2, 16.0, 18.3, 20.1, 22.0]. Then, the time interval sequence t = [2.1, 2.2, 1.7, 2.2, 1.9, 1.9, 2.2, 1.8, 2.3, 1.8, 1.9] is calculated for adjacent timestamps. In order to eliminate abnormal jump values, the system sorts the time interval sequence, determines the effective interval of non-jump data according to the interquartile range (IQR) method, wherein Q1 is about 1.85, Q3 is about 2.2, IQR = 0.35, and then the lower limit value = 1.325 and the upper limit value = 2.725 are calculated. After removing the extreme values outside the range, the remaining non-jump time interval set is [2.1, 2.2, 2.2, 1.9, 1.9, 2.2, 1.8, 1.8, 1.9].
[0152] Based on the above non-jump time interval set, the system calculates that the average value of the set is about 2.0 seconds, and the standard deviation is about 0.15 seconds, so the coefficient of variation = 0.15 / 2.0 = 0.075. Since the coefficient of variation is less than the pre-set threshold value 0.1, it is determined that the current sequence has periodicity, and the initial period estimation value is taken as 2.0 seconds. In order to further verify the stability of the period, the system continuously monitors the time interval of the subsequent M (M ≥ 3) consecutive specified messages, and if the coefficient of variation is less than 0.1, it is considered that the period is stable, the subsequent judgment process can be terminated in advance, and 2.0 seconds is taken as the final period estimation value. If the sequence meets the above conditions in the subsequent M consecutive messages, the system updates the sequence period field to 2.0 seconds under the condition that the number of messages k ≥ the set minimum value, and updates the sequence state field to the third state, indicating that the sequence has stable periodicity. Otherwise, if the conditions are not met after the number of received specified messages reaches the pre-set maximum value, it is determined that the sequence does not have periodicity, the sequence period field remains the initial value, and the state remains unchanged.
[0153] Through the above steps, while effectively filtering abnormal data, the time interval fluctuation is quantitatively determined in combination with the coefficient of variation, which can improve the accuracy of periodicity determination and ensure the rational use of computing resources. After the periodicity determination is completed, the sequence calculation unit notifies the sequence storage unit of the calculation result, and the sequence storage unit updates or maintains the sequence period value and state, providing accurate basis for subsequent keep-alive probe period scheduling.
[0154] In the actual application of the embodiment, the feature vector of the sequence is extracted based on the specified message matched by the sequence and the sequence period corresponding to the sequence, specifically including:
[0155] The timestamp of the first specified message in the sequence is set as the zero moment; based on the sequence period in the field information of the sequence, the phase offset of the timestamp of each specified message relative to the sequence period position thereof is calculated using the following formula: ;
[0156] is the timestamp of the first specified message of the sequence; i is the sequence code of the sequence; is the timestamp of the kth specified message; is the value of the sequence period in the field information of the sequence with the sequence code i; is the phase offset of the timestamp of the kth specified message relative to the sequence period position thereof;
[0157] The phase offset of each specified message timestamp relative to the sequence period position thereof corresponding to the sequence is counted, and the variance of the counted phase offset of the sequence is obtained;
[0158] Each statistical feature is normalized to scale it to the interval [0, 1] to obtain the normalized statistical feature;
[0159] The statistical features include: the variance of the phase offset of the sequence, the first feature of the sequence, and the second feature of the sequence; the first feature = the final period estimation value; the second feature = IQR / median of the sorted time interval sequence;
[0160] The normalized statistical features are combined to form a feature vector, which is written into the field information of the sequence in the sequence storage unit corresponding to the sequence in the third state.
[0161] For example, in the actual application of the embodiment, in order to more comprehensively represent the behavior characteristics of periodic sequences, the system extracts the corresponding feature vector based on the specified message sequence determined to have periodicity and writes it into the sequence storage unit. The construction of the feature vector mainly depends on the statistical law of the phase characteristics and the period structure of the sequence, and the specific process is as follows.
[0162] Firstly, the time stamp of the first designated message in the periodic sequence is set to zero moment, and all the time stamps of the sequence are translated to obtain the relative time stamp sequence. For example, if a sequence number is i, the period estimation value is 2.0 seconds, and the time stamps of the k = 8 matched designated messages are 0.0, 2.0, 3.9, 5.8, 8.0, 9.9, 12.0, and 14.1 (units: seconds) in turn, then after the relative processing, the relative time stamp of the sequence is [0.0, 2.0, 3.9, 5.8, 8.0, 9.9, 12.0, 14.1]. Secondly, the system calculates each designated message according to the following phase offset formula to obtain the phase offset of the message relative to the period position: For example, the calculated phase offset values are [0.0, 0.0, -0.1, -0.2, 0.0, -0.1, 0.0, 0.1] (units: seconds) in turn. Then, the variance of the phase offset sequence is calculated to measure the consistency of the alignment of each message in the sequence with the ideal period. The phase offset variance of the above sequence is about 0.0075, which is a small value, indicating that the period structure of the sequence is stable. In addition, to further enrich the description of periodic behavior, the system introduces two additional statistical features: the first feature is the final period estimation value of the sequence (assuming it is 2.0); the second feature is the dispersion degree of the time interval sequence, which is calculated by dividing the interquartile range (IQR) of the sorted time interval sequence by the median. In this example, the time interval sequence is [2.0, 1.9, 1.9, 2.2, 1.9, 2.1, 2.1], and after sorting, Q1 = 1.9, Q3 = 2.1, IQR = 0.2, and the median = 2.0, so the second feature is 0.1. Then, the above three statistical features are normalized to make their values fall within the [0, 1] interval to ensure the consistency and comparability of each feature dimension. Assuming that after normalization, the normalized value of the phase offset variance is 0.08, the first feature is normalized to 0.67, and the second feature is normalized to 0.12. The three normalized values are combined into a three-dimensional feature vector [0.08, 0.67, 0.12], and this vector is written into the field information of the sequence in the third state, which is used for subsequent sequence clustering, similar behavior identification, or period trend modeling modules.
[0163] Through the extraction and archiving of the above feature vectors, the periodic behavior can be quantitatively expressed based on only time series data, which improves the efficiency and accuracy of the behavior modeling and analysis of Internet of Things nodes.
[0164] Preferably, in some embodiments of the present application, the keep-alive unit clusters each sequence based on the feature vectors extracted by the plurality of sequence calculation units, and establishes a periodic keep-alive channel between the gateway device and the target servers in the Internet of Things topology according to the clustering result, so that the gateway device sends keep-alive probe requests to each target server according to the sending time slot, taking the cellular network IP address obtained by the gateway device as the source address, specifically including:
[0165] The keep-alive unit obtains the sequence feature vector of each sequence in the third state and whose sequence period field is not -1 from the sequence storage unit;
[0166] The distance metric of each sequence is calculated by the following formula:
[0167]
[0168] is the distance metric of the sequence with sequence code i; is the first proportion parameter; is the second proportion parameter; is the third proportion parameter; is the normalized first feature corresponding to the sequence with sequence code i; is the first feature of the initial centroid of the K-means algorithm corresponding to the sequence with sequence code j; is the normalized second feature corresponding to the sequence with sequence code i; is the second feature of the initial centroid of the K-means algorithm corresponding to the sequence with sequence code j; is the normalized variance of the phase offset corresponding to the sequence with sequence code i; is the variance of the phase offset of the initial centroid of the K-means algorithm corresponding to the sequence with sequence code j; in the present embodiment, is 0.5; is 0.3; is 0.2.
[0169] The clustering effect under different K values is evaluated based on the elbow rule to determine the optimal clustering number K to minimize the intra-cluster sum of squared error;
[0170] The K-means clustering method is used to divide the sequences into K clustering groups, and the clustering results are updated to the keep-alive group of each sequence in the sequence storage unit. In this embodiment, in order to determine a reasonable number of clusters, the elbow rule is used to evaluate the within-cluster sum of squares error under different cluster numbers, and the cluster number corresponding to the significant decrease in error is selected as the optimal cluster number. Subsequently, based on the K-means algorithm, all sequences are divided into several clustering groups, and the clustering results of each sequence are updated to the keep-alive group field in the sequence storage unit.
[0171] The keep-alive unit determines the keep-alive sending period of each keep-alive channel according to the sequence period of the sequences in each clustering group, and the keep-alive sending period takes the value of the minimum sequence period in the clustering group;
[0172] An initial keep-alive sending queue is established in each keep-alive channel, and the length of the keep-alive sending queue is equal to the value of the minimum sequence period in the clustering group;
[0173] Each sending time slot in the keep-alive sending queue corresponds to a unique target server IP in the clustering group.
[0174] The length of the sending time slot is: the value of the minimum sequence period in the group ÷ the number of target server IPs in the group.
[0175] The keep-alive unit sorts each sequence timestamp in the sending queue in chronological order, takes the cellular network IP address obtained by the gateway device as the source IP, and sends the proxy keep-alive probe request to each target server IP in the queue according to the sending time slot.
[0176] At the end of each sending time slot, the keep-alive unit updates the keep-alive state field of all sequences in the group according to the received response, and the keep-alive state field is normal or abnormal.
[0177] When the keep-alive unit does not receive a response from the target server in the current sending time slot, and the sending time slot is not exhausted, the keep-alive unit repeatedly sends the proxy keep-alive request in the sending time slot to form intensive probes until the target server response is received or the sending time slot is exhausted.
[0178] When the target server response is received, the keep-alive unit updates the keep-alive state field and the keep-alive reply information field of each sequence in the group according to the response result, and if the keep-alive state is normal, generates a keep-alive response data corresponding to the protocol and forwards it to the node.
[0179] For example, the embodiment is for each clustering group, the keep-alive unit takes the smallest sequence period in the group as the keep-alive sending period of the group, and establishes a corresponding periodic keep-alive channel. In each keep-alive channel, the keep-alive unit divides the sending period into a plurality of sending time slots according to the number of target servers in the clustering group, and each time slot corresponds to a unique target server IP. The keep-alive unit takes the cellular network IP address obtained by the gateway device as the source address, and sequentially sends a proxy keep-alive probe request to the corresponding target server according to the sending time slot, simulating the keep-alive behavior of each node.
[0180] During the sending process, if no response of the target server is received in a time slot, the keep-alive unit repeatedly sends a keep-alive request in the remaining time of the time slot to form intensive probes until a response is received or the time slot ends. After receiving the response, the keep-alive unit updates the keep-alive state field and the keep-alive reply information field of all sequences in the clustering group in a timely manner, and if the response is normal, the keep-alive state is marked as normal, and a keep-alive response data corresponding to the protocol is generated and fed back to the Internet of Things node, so that the node can obtain the keep-alive result in real time.
[0181] The method realizes efficient proxying of periodic keep-alive probes of a large number of Internet of Things nodes by using a single public network IP address through clustering grouping and dynamic scheduling, significantly reduces the network resource occupation and management complexity, and ensures the timeliness and accuracy of the keep-alive probe, and is suitable for health management and state monitoring in a large-scale cellular Internet of Things environment.
[0182] For example, it is assumed that 5 sequences are clustered into 3 clustering groups: the first group: sequence 1, sequence 2 (assuming that the value of the smallest sequence period is 2 seconds); the second group: sequence 3, sequence 4 (assuming that the value of the smallest sequence period is 5.5 seconds); the third group: sequence 1 (assuming that the value of the smallest sequence period is 9 seconds); the keep-alive unit updates the clustering result to the field of each sequence and records it in the keep-alive group number field. Next, the keep-alive unit establishes a periodic keep-alive channel for each clustering group, takes the public network cellular IP obtained by the gateway device as the source IP, and initiates a keep-alive probe request to the target server in each group. Taking the first group as an example, the sending period of the keep-alive channel is set to the minimum period value in the group, i.e. 2.0 seconds.
[0183] Assuming that the target server of sequence 1 in the first group is IP1 (10.0.0.101) and the target server of sequence 2 is IP2 (10.0.0.102), the keep-alive sending queue duration is 2.0 seconds, containing two sending time slots: time slot 1: [0s-1s] sends to IP1; time slot 2: [1s-2s] sends to IP2. A round of sending cycle is performed every 2.0 seconds, and the keep-alive probe request packet is sent once in each time slot. If the keep-alive unit fails to receive a response from the target server in time within a sending time slot, for example, no response is received from IP2 in the second time slot, the system will continue to send repeatedly to form intensive detection in the remaining time (up to 1 second) until a response is received or the time slot is exhausted.
[0184] Once the target server response is successfully received, the keep-alive unit immediately updates the keep-alive state field of the corresponding sequence in the group to normal and records the response information (such as RTT, response code, etc.) to the "keep-alive reply information field"; if no response is received in the sending time slot, the corresponding sequence state is set to abnormal. In actual application, the gateway device only needs to use one public network IP to simulate the periodic heartbeat behavior of multiple nodes, effectively avoiding the resource waste and address allocation pressure brought by a large number of Internet of Things terminals directly accessing public network servers.
[0185] Preferably, in some embodiments of the present application, the sequence calculation unit is further configured to update the keep-alive state of the corresponding sequence based on the response result after receiving the response of the target server to the keep-alive probe request, and feed back the keep-alive state to the corresponding node in the Internet of Things topology structure, specifically including:
[0186] The sequence calculation unit is configured to update the keep-alive state field and the keep-alive reply information field of the sequence associated with the keep-alive probe request based on the response after receiving the response of the target server to the keep-alive probe request, and determine whether to feed back the keep-alive response information to the corresponding node according to the keep-alive state of the sequence;
[0187] If the keep-alive state field is normal, the sequence calculation unit constructs a keep-alive response data packet corresponding to the protocol type used by the node and sends it to the node, specifically including:
[0188] When the protocol type corresponding to the designated message is the Internet Control Message Protocol, a network connectivity test response data packet for reply is constructed, the source IP address of the data packet is the IP of the destination of the packet header of the sequence, the destination IP address is the node IP address, and the response delay is set based on the keep-alive reply information field; when the protocol type corresponding to the designated message is the Domain Name System, a Domain Name System response data packet for reply to the query request is constructed, the source IP address of the data packet is the IP of the destination of the packet header of the sequence, the destination IP address is the node IP address, and the domain name resolution result is set based on the keep-alive reply information field; if the keep-alive state field is abnormal, no keep-alive response data packet is sent to the node;
[0189] When the protocol type corresponding to the designated message is the Internet Control Message Protocol, a network connectivity test response data packet for reply is constructed, the source IP address of the data packet is the IP of the destination of the packet header of the sequence, the destination IP address is the node IP address, and the response delay is set based on the keep-alive reply information field; when the protocol type corresponding to the designated message is the Domain Name System, a Domain Name System response data packet for reply to the query request is constructed, the source IP address of the data packet is the IP of the destination of the packet header of the sequence, the destination IP address is the node IP address, and the domain name resolution result is set based on the keep-alive reply information field; if the keep-alive state field is abnormal, no keep-alive response data packet is sent to the node;
[0190] For example, in the embodiment, the sequence calculation unit is not only used to identify the sequence period, but also undertakes the key keep-alive state maintenance function. The specific process is as follows: when the gateway device initiates a proxy keep-alive request and successfully receives the response data of the target server, the sequence calculation unit first identifies the sequence to which the response corresponds to the keep-alive request, and immediately updates the keep-alive state field of the sequence to normal, and writes the related information (such as delay time, domain name resolution result, etc.) of the response into the keep-alive reply information field of the sequence. Subsequently, it is decided whether to feed back the constructed response data packet to the specific node in the Internet of Things topology according to the keep-alive state.
[0191] For example, assuming that node A periodically sends an Internet Control Message Protocol (ICMP) connectivity probe packet, after sequence extraction and period identification, this behavior is included in an ICMP protocol periodic sequence. The gateway device initiates a proxy connectivity probe request to the target server according to the keep-alive period, and successfully receives a response (for example, with a 15 ms delay). At this time, the sequence calculation unit updates the keep-alive state field of the ICMP sequence to normal, and records the 15 ms delay information in the keep-alive reply information field. The sequence calculation unit then constructs a network connectivity test response packet, with the source IP set to the destination IP in the original request (i.e., the public IP address of the target server), the destination IP set to the IP address of node A, and the response content containing a simulated 15 ms delay. At the same time, in order to ensure that the node receiving side can successfully identify the response, the response packet will be filled according to the length field in the original request packet to maintain the format and expected consistency, thereby achieving the effect of "pretending to be a real response" to enable node A to normally maintain its connection state.
[0192] Taking the domain name system (DNS) protocol as an example, assuming that node B periodically requests a DNS server configured by it to resolve the domain name "abc.device.net". This behavior is identified as a periodic DNS protocol sequence and a keep-alive relationship is established. After the keep-alive channel is established, the gateway device proxies node B to send a domain name resolution request to the target DNS server, and the request body includes the domain name to be resolved. The DNS server returns the resolution result (e.g., "abc.device.net" is resolved to 10.1.1.10), and the response is received by the gateway. The sequence calculation unit identifies the DNS resolution protocol sequence to which it belongs, updates the state field to normal, and records the resolution result "10.1.1.10" in the keep-alive reply information field.
[0193] Subsequently, the sequence calculation unit constructs a DNS response packet with the source IP as the IP of the DNS server and the destination IP as the IP of node B, and writes the requested "abc.device.net" and its corresponding resolution result "10.1.1.10" in the request body into the response body. In this way, the DNS response received by node B will completely conform to the format and content expected by its normal request behavior, and will not perceive any abnormalities. In particular, considering that each node may request different domain names, in actual application, the sequence calculation unit will construct individualized DNS response data according to the DNS request body content retained by each sequence, to support parallel processing of multiple nodes, multiple domain names, and multiple results, and to ensure that each node obtains the correct resolution result of its specific request.
[0194] It should be noted that if the target server does not respond at all within a keep-alive sending time slot, the sequence calculation unit updates the sequence keep-alive state to abnormal, and at this time, no simulated response is sent to the corresponding node to avoid the node misjudging the network state due to false data. This mechanism not only guarantees the consistency of the protocol stack behavior of the node, but also accurately simulates the actual network keep-alive state.
[0195] As can be seen from the above examples, the embodiment enables the gateway device to complete keep-alive interaction for a large number of Internet of Things terminal nodes by proxy in a cellular public network environment through a fine state judgment and protocol adaptation mechanism, guarantees system activity, reduces signaling burden, and improves the transparency and stability of node operation. In addition, the embodiment also provides a cellular Internet of Things multi-node keep-alive communication method, which is executed by the cellular Internet of Things multi-node keep-alive communication system in the above embodiment. The method includes: intercepting and copying, by a first module, uplink and downlink data streams of a plurality of nodes in an Internet of Things topology structure forwarded through the gateway device to obtain data packets containing complete protocol content, and extracting specified messages from the data packets respectively;
[0196] A second module receives the specified messages extracted by the first module and performs the following operations:
[0197] matching the specified messages with pre-stored sequences, if matching is successful, updating field information of the matched sequences and determining the sequence state thereof; updating the sequence state and the sequence period of the sequence based on the specified messages matched with the sequence; extracting a feature vector of the sequence based on the specified messages matched with the sequence and the sequence period corresponding to the sequence, and clustering the sequences using the feature vectors of the sequences; establishing a periodic keep-alive channel between the gateway device and target servers in the Internet of Things topology structure according to the clustering result, and sending keep-alive probe requests to the target servers in sending time slots using the cellular network IP address obtained by the gateway device as a source address; the sending time slots are determined by the sequence periods of the sequences in the clustering; and updating the keep-alive state of the sequence according to the response result after receiving the responses of the target servers to the keep-alive probe requests, and feeding back the keep-alive state to the corresponding node in the Internet of Things topology structure.
[0198] Although the embodiments of the present application have been shown and described above, it should be understood that the above embodiments are exemplary and should not be construed as limiting the present application, and those of ordinary skill in the art can make changes, modifications, replacements and variations to the above embodiments within the scope of the present application.
Claims
1. A multi-node keep-alive communication system for cellular Internet of Things (CIoT), characterized in that, The system is deployed in a gateway device in an Internet of Things topology, and the system comprises: A first module for intercepting and copying, in a bypass manner, uplink and downlink data streams of a plurality of nodes in the Internet of Things topology forwarded through the gateway device to obtain data packets containing complete protocol content, and extracting specified messages from the data packets; A second module for receiving the specified messages extracted by the first module and performing the following operations: Matching the specified messages with pre-stored sequences, and if a match is successful, updating field information of the matched sequence and determining a sequence state thereof; Based on the specified messages matched with the sequences, updating the sequence state and a sequence period of the sequence; Based on the specified messages matched with the sequences and the sequence period corresponding to the sequence, extracting a feature vector of the sequence, and clustering the sequences using the feature vectors of the sequences; According to the clustering grouping result, establishing a periodic keep-alive channel between the gateway device and target servers in the Internet of Things topology, and sending keep-alive probe requests to the target servers according to a sending time slot using a cellular network IP address obtained by the gateway device as a source address; The sending time slot is determined by the sequence period of the sequence in the clustering grouping; After receiving responses of the target servers to the keep-alive probe requests, updating a keep-alive state of the sequence according to the response result, and feeding back the keep-alive state to corresponding nodes in the Internet of Things topology.
2. The CNIoT multi-node keep-alive communication system of claim 1, wherein, The first module comprises a data copying unit and a plurality of protocol filtering units; The data copying unit is configured to intercept and copy, in a bypass manner, uplink and downlink data streams of a plurality of nodes in the Internet of Things topology forwarded through the gateway device to obtain data packets containing complete protocol content, identify protocol types of the data packets, and distribute the data packets to the protocol filtering units corresponding to the protocol types of the data packets; The plurality of protocol filtering units are respectively configured for different protocol types, and each protocol filtering unit is configured to receive data packets of a corresponding protocol type, extract specified messages from the data packets, and send the specified messages to the second module; The specified messages include a time stamp of a receiving time, a packet header source IP, a packet header destination IP, a message type, and a packet length obtained from the extracted data packets.
3. The CNIoT multi-node keep-alive communication system of claim 2, wherein, The second module comprises a sequence storage unit, a keep-alive unit, and a plurality of sequence calculation units; The plurality of sequence calculation units respectively correspond to the plurality of protocol filtering units in the first module, and each sequence calculation unit is configured to receive specified messages of a corresponding protocol type, and perform the following operations: Matching the specified messages with pre-stored sequences in the sequence storage unit, and if a match is successful, updating field information of the matched sequence and determining a sequence state thereof; Based on the specified messages matched with the sequences, updating the sequence state and a sequence period of the sequence; Based on the specified messages matched with the sequences and the sequence period corresponding to the sequence, extracting a feature vector of the sequence; The keep-alive unit is configured to cluster and group each sequence based on the feature vectors extracted by the plurality of sequence calculation units, and establish a periodic keep-alive channel between the gateway device and the target servers in the Internet of Things topology according to the clustering result, so that the gateway device sends keep-alive probe requests to each target server at a first time interval, taking the cellular network IP address obtained by the gateway device as the source address. The sequence calculation unit is further configured to update the keep-alive state of the corresponding sequence based on the response result after receiving the response of the target server to the keep-alive probe request, and feed back the keep-alive state to the corresponding node in the Internet of Things topology.
4. The cellular Internet of Things multi-node keep-alive communication system according to claim 3, wherein The sequence storage unit pre-stores at least one sequence, wherein each sequence includes the following field information: update time, used to record the timestamp of the last time the specified message matching the sequence; sequence code, used to identify the unique code field of the sequence; packet header source IP list, used to store the source IP address obtained by the node in the Internet of Things topology from the gateway device; packet header destination IP, used to identify the target server IP address in the Internet of Things topology; packet length, used to record the data packet length; sequence state, used to represent the current state of the sequence, the sequence state including first state, second state, third state, and fourth state; message type, used to represent the message protocol type field; domain name system request body, used to store the domain name list initiated by the node in the domain name system protocol type keep-alive; sequence period, used to record the sequence keep-alive period field; remaining survival time, used to indicate the remaining time until the next specified message arrives; keep-alive state, used to represent the keep-alive state field indicating whether the last keep-alive probe request is successful; keep-alive reply information, used to store the information of the target server responding to the keep-alive probe request; sequence feature vector, used to represent the sequence features extracted based on the specified message; keep-alive grouping, used to represent the sequence belonging to the keep-alive clustering group field.
5. The cellular Internet of Things multi-node keep-alive communication system according to claim 4, wherein The matching success condition is that the packet header destination IP, message type, and packet length in the received specified message are all the same as the corresponding field information in any pre-stored sequence; The specified message is matched with the pre-stored sequence, and if the matching is successful, the field information of the matched sequence is updated and its sequence state is determined, specifically including: adding the packet header source IP in the specified message to the packet header source IP list field of the matched sequence; updating the timestamp of the received packet in the specified message to the update time in the field information of the matched sequence; resetting the remaining survival time in the field information of the matched sequence to a pre-set initial value, the remaining survival time being a decreasing timer, and when its value decreases to 0, the following processing is performed: if the sequence state of the matched sequence is the first state, the sequence is deleted from the sequence storage unit; if the sequence state is the second state, it is updated to the fourth state; if the sequence state is the third state, the current state is kept unchanged; If the sequence state is the fourth state, the sequence state is updated to the first state; The first state indicates that the sequence currently receives only one designated message, and the sequence period in the field information of the sequence is set to -1; The second state indicates that the sequence receives multiple designated messages within the remaining time before the next designated message arrives, but the sequence period has not been confirmed, and the sequence period in the field information of the sequence is set to -1; The third state indicates that the sequence has confirmed the sequence period, and the last state of the sequence is the second state, and the sequence period in the field information of the sequence has a period value; The fourth state indicates that the period calculation is not completed because the number of received designated messages is less than the preset minimum value, and the sequence period in the field information of the sequence is set to -1; The sequence calculation unit is further configured to, when the received designated message fails to match the pre-stored sequence in the sequence storage unit, generate a sequence corresponding to the designated message, and set the sequence state of the generated sequence to the first state; The field information of the generated sequence is all initial values extracted from the designated message.
6. The CNIoT multi-node keep-alive communication system of claim 5, wherein, The sequence state and the sequence period of the sequence are updated based on the designated message matched with the sequence, and specifically include: extracting the time stamps of the k designated messages currently received by the sequence, and converting the time stamps into a relative time sequence based on the time stamp of the first designated message as a reference; wherein k is greater than a preset minimum value; constructing a time interval sequence based on the difference between adjacent time stamps for the relative time sequence; sorting the time interval sequence, obtaining the first quartile Q1 and the third quartile Q3 of the sorted time interval sequence, and calculating the interquartile range IQR based on the first quartile Q1 and the third quartile Q3; regarding all time intervals less than the lower limit value or greater than the upper limit value as abnormal values and eliminating them, and retaining the remaining data to form a non-jump time interval set; wherein IQR = Q3 - Q1; the lower limit value = Q1 - 1.5 * IQR; and the upper limit value = Q3 + 1.5 * IQR; calculating the average value and the standard deviation based on the non-jump time interval set, and determining the coefficient of variation based on the average value and the standard deviation; the coefficient of variation = standard deviation / average value; when the coefficient of variation is less than a set threshold, it is determined that the current sequence has periodicity, and the initial period estimation value is taken as the average value of the non-jump time interval set; if the sequence satisfies the condition that the coefficient of variation is less than the threshold in the subsequent M consecutive designated messages, the subsequent judgment is terminated in advance, and the initial period estimation value is taken as the final period estimation value; if the number of received designated messages has reached the preset maximum value but the final period estimation value has not been obtained, it is considered that the sequence does not have periodicity characteristics; the sequence calculation unit sends the periodicity judgment result to the sequence storage unit: if the sequence has periodicity, the sequence period in the field information of the sequence is updated to the final period estimation value, and the sequence state in the field information is updated to the third state; if the sequence does not have periodicity, the sequence period in the field information of the sequence remains the initial value, and the sequence state in the field information remains unchanged.
7. The CNIoT multi-node keep-alive communication system of claim 6, wherein, The feature vector of the sequence is extracted based on the designated message matched with the sequence and the sequence period corresponding to the sequence, and specifically includes: the time stamp of the first designated message in the sequence is zero moment. The phase offset of each specified message timestamp relative to its sequence period position is calculated based on the sequence period in the sequence field information using the following formula: ; is the timestamp of the first designated message of the sequence; i is the sequence encoding of the sequence; is the timestamp of the kth designated message of the sequence; is the value of the sequence period in the field information of the sequence with sequence encoding i; is the phase offset of the kth designated message timestamp relative to its position in the sequence period; The phase offset of each specified message timestamp relative to its sequence period position is calculated based on the sequence period in the sequence field information using the following formula: The phase offset of each specified message timestamp relative to its sequence period position is calculated based on the sequence period in the sequence field information using the following formula: The phase offset of each specified message timestamp relative to its sequence period position is calculated based on the sequence period in the sequence field information using the following formula: The statistical features include: the variance of the phase offset of the sequence, the first feature of the sequence, and the second feature of the sequence. The first feature = the final period estimation value. The second feature = IQR / the median of the sorted time interval sequence.
8. The CNIoT multi-node keep-alive communication system of claim 7, wherein, The normalized statistical features are combined to form a feature vector, and the feature vector is written into the sequence field information of the sequence in the sequence storage unit. The keep-alive unit clusters the sequences based on the feature vectors extracted by the multiple sequence calculation units, and establishes a periodic keep-alive channel between the gateway device and the target servers in the Internet of Things topology according to the clustering result, taking the cellular network IP address obtained by the gateway device as the source address, and sending keep-alive probe requests to each target server according to the sending time slot, specifically including: The keep-alive unit obtains the sequence feature vector of each sequence in the third state and whose sequence period field is not -1 from the sequence storage unit. + + ; is a distance metric for the sequence encoded as the sequence i; is a first proportionality parameter; is a second proportionality parameter; is a third proportionality parameter; is a normalized first feature corresponding to the sequence encoded as the sequence i; is a first feature of the initial centroid of the K-means algorithm corresponding to the sequence encoded as the sequence j; is a normalized second feature corresponding to the sequence encoded as the sequence i; is a second feature of the initial centroid of the K-means algorithm corresponding to the sequence encoded as the sequence j; is a normalized variance of the phase offset corresponding to the sequence encoded as the sequence i; is a variance of the phase offset of the initial centroid of the K-means algorithm corresponding to the sequence encoded as the sequence j; The distance metric of each sequence is calculated using the following formula: The elbow rule is used to evaluate the clustering effect under different K values to determine the optimal clustering number K to minimize the within-cluster sum of squares error. The K-means clustering method is used to divide the sequences into K clusters, and the clustering result is updated to the keep-alive grouping of each sequence in the sequence storage unit. The keep-alive unit determines the keep-alive sending period of each keep-alive channel based on the sequence period of the sequences in each cluster group, and the keep-alive sending period takes the value of the smallest sequence period in the cluster group. An initial keep-alive sending queue is established in each keep-alive channel, and the length of the keep-alive sending queue is equal to the value of the smallest sequence period in the cluster group. Each sending time slot in the keep-alive sending queue corresponds to a unique target server IP in the cluster group. The length of the sending time slot is: the value of the smallest sequence period in the group ÷ the number of target server IPs in the group. The keep-alive unit sorts each sequence timestamp in the sending queue in chronological order, takes the cellular network IP address obtained by the gateway device as the source IP, and sends proxy keep-alive probe requests to each target server IP in the queue according to the sending time slot. At the end of each sending time slot, the keep-alive unit updates the keep-alive state field of all sequences in the group based on the received responses, and the keep-alive state field is normal or abnormal. When the keep-alive unit does not receive a response from the target server in the current sending time slot, and the sending time slot is not exhausted, the keep-alive unit repeatedly sends proxy keep-alive requests in the sending time slot to form intensive probes until a response from the target server is received or the sending time slot is exhausted. When receiving the target server response, the keep-alive unit updates the keep-alive state field and the keep-alive reply information field of each sequence in the packet according to the response result, generates a keep-alive response data corresponding to the protocol if the keep-alive state is normal, and forwards the keep-alive response data to the node.
9. The cellular IoT multi-node keep-alive communication system of claim 8, wherein, The sequence calculation unit is further configured to update the keep-alive state of the corresponding sequence based on a response result of the target server to the keep-alive probe request after receiving the response, and feed back the keep-alive state to the corresponding node in the IoT topology structure, and specifically includes: The sequence calculation unit is configured to update the keep-alive state field and the keep-alive reply information field of the sequence associated with the keep-alive probe request based on the response of the target server to the keep-alive probe request after receiving the response, and determine whether to feed back the keep-alive response information to the corresponding node according to the keep-alive state of the sequence; If the keep-alive state field is normal, the sequence calculation unit constructs a keep-alive response data packet corresponding to the protocol type used by the node and sends the keep-alive response data packet to the node, and specifically includes: When the protocol type corresponding to the specified message is the Internet Control Message Protocol, a network connectivity test response data packet for answering is constructed, the source IP address of the data packet is the destination IP of the packet header of the sequence, the destination IP address is the IP address of the node, and the response delay is set based on the keep-alive reply information field; When the protocol type corresponding to the specified message is the Domain Name System protocol, a Domain Name System response data packet for responding to the query request is constructed, the source IP address of the data packet is the destination IP of the packet header of the sequence, the destination IP address is the IP address of the node, and the domain name resolution result is set based on the keep-alive reply information field; If the keep-alive state field is abnormal, the keep-alive response data packet is not sent to the node; When the protocol type corresponding to the specified message is the Internet Control Message Protocol, the network connectivity test response data packet for answering is constructed, and the packet length field of the corresponding sequence is adapted and filled to simulate the preset return packet corresponding to the original network connectivity test request message initiated by the multiple nodes; When the protocol type corresponding to the specified message is the Domain Name System protocol, the Domain Name System response data packet for responding to the query request is constructed, and the domain name resolution result in the Domain Name System request body is fed back to the multiple nodes. 10.A method for multi-node keep-alive communication in a cellular Internet of Things, the method comprising: The method is executed by the cellular IoT multi-node keep-alive communication system of any one of claims 1-9, and the method includes: A first module intercepts and copies the uplink and downlink data streams of multiple nodes in the IoT topology structure forwarded through the gateway device to obtain data packets containing complete protocol content, and extracts specified messages from the data packets respectively; A second module receives the specified messages extracted by the first module and performs the following operations: The specified messages are matched with pre-stored sequences, and if the matching is successful, the field information of the matched sequence is updated and the sequence state thereof is determined; The sequence state and the sequence period of the sequence are updated based on the specified messages matched with the sequence. Based on the specified message matched by the sequence and the sequence period corresponding to the sequence, a feature vector of the sequence is extracted, and the sequences are clustered and grouped by using the feature vectors of the sequences; According to the clustering and grouping result, a periodic keep-alive channel is established between the gateway device and the target servers in the Internet of Things topology, and a keep-alive probe request is sent to each target server according to a sending time slot by taking the cellular network IP address obtained by the gateway device as a source address; The sending time slot is determined by the sequence period of the sequence in the clustering and grouping; After receiving a response of the target server to the keep-alive probe request, the keep-alive state of the sequence is updated according to the response result, and the keep-alive state is fed back to the corresponding node in the Internet of Things topology.
Citation Information
Patent Citations
Dual-stack network adaptive scheduling method and system based on DNS analysis strategy
CN120017715A
Optimal service discovery method based on explicit multicast assistance, medium and equipment
CN120263717A