Sensor network packet loss method, system and device based on internet of things
Patent Information
- Application Number
- CN202611163706.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-03
- Publication Date
- 2026-10-09
AI Technical Summary
然而,上述方法在实际工业物联网传感器网络丢包场景中存在以下局限:第一,丢弃决策依赖全局队列统计量,难以感知数据包自身的属性特征与业务语义差异,无法依据传感器类型、测量值趋势或事件紧急性实施精细化丢包;第二,服务依赖静态头部标记分类,自适应能力弱,难以响应数据流特征的动态演化;第三,队列与丢弃策略的绑定关系固化,系统运行过程中无法根据数据流变化动态调整队列结构及策略参数
[0023]第三方面,本申请还提供了一种计算机设备,采用如下的技术方案:
Smart Images

Figure CN122891531A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of industrial Internet of Things (IoT), and in particular to IoT-based sensor network packet loss methods, systems, and devices. Background Technology
[0002] With the rapid development of the Industrial Internet of Things (IIoT), a large number of sensors are deployed on production sites, and the data they collect needs to be uploaded to the management platform via a sensor network platform. At edge computing nodes, data streams are characterized by strong bursts, large differences in business priorities, and limited cache resources. When network congestion occurs, if indiscriminate packet loss or an active queue management mechanism that relies solely on static priority marking is used, high-value critical data packets are easily discarded improperly, affecting the real-time performance and reliability of industrial control.
[0003] Existing proactive queue management technologies, such as Random Early Detection (RED) and its weighted version (WRED), CoDel, and PIE, primarily achieve congestion avoidance by monitoring queue length or queuing delay to implement probabilistic packet dropping. However, these methods have the following limitations in real-world industrial IoT sensor network packet loss scenarios: First, drop decisions rely on global queue statistics, making it difficult to perceive the data packet's own attribute characteristics and business semantic differences, and unable to implement refined packet dropping based on sensor type, measurement trend, or event urgency; Second, services rely on static header label classification, resulting in weak adaptability and difficulty in responding to the dynamic evolution of data stream characteristics; Third, the binding relationship between queues and drop policies is fixed, making it impossible to dynamically adjust queue structure and policy parameters according to data stream changes during system operation.
[0004] Therefore, in the edge computing environment of the Industrial Internet of Things, how to further improve the flexibility and rationality of packet loss decision-making has become an urgent technical problem to be solved. Summary of the Invention
[0005] To improve the flexibility of packet loss, this application provides a packet loss method, system, and device for sensor networks based on the Internet of Things.
[0006] Firstly, this application provides a method for packet loss in sensor networks based on the Internet of Things, employing the following technical solution: A sensor network packet loss method based on the Internet of Things (IoT) is applied to an industrial IoT system. The industrial IoT system includes a management platform, a sensor network platform, and an object platform that are sequentially connected in communication. The method is executed by an edge computing node of the sensor network platform, and at least two logical queues have been established in the edge computing node. The method includes: Obtain multiple data packets to be enqueued that have arrived at the edge computing node, and extract the attribute feature vector of each data packet to be enqueued. Cluster analysis is performed on the attribute feature vectors to obtain cluster feature vectors; Based on the clustering feature vector, the logical queue in the edge computing node is updated, and according to the association between the clustering feature vector and the logical queue, each data packet to be enqueued is inserted into the corresponding logical queue. For each of the logical queues, a differentiated discarding strategy parameter group is configured. The discarding strategy parameter group includes a discarding strategy type identifier and a corresponding strategy parameter. At least two of the logical queues correspond to different discarding strategy type identifiers, or correspond to the same discarding strategy type identifier but have different values for the strategy parameter. In response to an enqueue event in any of the logical queues, a discard decision is performed based on the discard policy parameter group corresponding to the logical queue to determine whether to discard the data packet to be enqueued that triggered the enqueue event.
[0007] By adopting the above technical solution, multiple data packets to be enqueued arriving at the edge computing node are obtained. The attribute feature vectors of each data packet to be enqueued are extracted, and then cluster analysis is performed on the attribute feature vectors to obtain cluster feature vectors. Based on the cluster feature vectors, the logical queues in the edge computing node are updated, and each data packet to be enqueued is inserted into the corresponding logical queue according to the association between the cluster feature vectors and the logical queues. Then, for each logical queue, a differentiated discarding policy parameter group is configured. The discarding policy parameter group includes a discarding policy type identifier and a corresponding policy parameter. At least two logical queues correspond to different discarding policy type identifiers, or correspond to the same discarding policy type identifier but with different values for the policy parameters. Then, in response to an enqueue event of any logical queue, a discarding decision is executed according to the discarding policy parameter group corresponding to that logical queue to determine whether to discard the data packet to be enqueued that triggered the enqueue event. This invention extracts the attribute features of data packets and performs cluster analysis, dynamically updates the logical queue and associates it with differentiated discarding strategies, enabling packet loss decisions to perceive the business semantics and attribute differences of the data packets themselves, rather than relying on global queue statistics. At the same time, the queue structure and strategy parameters can be adaptively adjusted according to the data flow characteristics, overcoming the problem of rigid strategy binding. In the scenario of limited edge caching in the Industrial Internet of Things, it can effectively improve the retention probability of high-value critical data packets and enhance the flexibility and rationality of packet loss.
[0008] Optionally, the step of obtaining multiple data packets to be enqueued arriving at the edge computing node and extracting the attribute feature vector of each data packet to be enqueued includes: Monitor the receive buffer of the edge computing node at the data link layer. When the number of data packets to be enqueued in the receive buffer reaches a preset batch processing threshold, batch acquire each of the data packets to be enqueued in the receive buffer. For each of the data packets to be enqueued in the batch, read the field value at a fixed offset position in the header field of the data packet to be enqueued; Based on the preset attribute mapping relationship, the read field values are parsed to obtain the attribute parameters of the data packet, wherein the attribute parameters include length value, sensor type identifier, priority flag value and generation timestamp; Based on the attribute parameters of the same data packet to be enqueued, a corresponding attribute feature vector is generated.
[0009] By adopting the above technical solution, in order to extract attribute feature vectors, the receiving buffer of the edge computing node at the data link layer is monitored. When the number of data packets to be enqueued in the receiving buffer reaches a preset batch processing threshold, each data packet to be enqueued in the receiving buffer is acquired in batches. Then, for each data packet to be enqueued in batches, the field value at a fixed offset position in the header field of the data packet is read. Then, based on the preset attribute mapping relationship, the read field value is parsed to obtain the attribute parameters of the data packet. The attribute parameters include length value, sensor type identifier, priority flag value and generation timestamp. Then, according to the attribute parameters of the same data packet to be enqueued, the corresponding attribute feature vector is generated.
[0010] Optionally, the step of performing cluster analysis on the attribute feature vector to obtain cluster feature vectors includes: Based on the attribute feature vectors of each of the data packets to be enqueued, a sample matrix is constructed, wherein the number of rows in the sample matrix is the number of data packets to be enqueued, and the number of columns is the dimension of the attribute feature vectors; The sample matrix is subjected to column normalization to obtain a column normalized matrix; Based on the clustering algorithm, clustering operation is performed on the column normalized matrix to obtain clustering results, wherein the clustering results include the number of cluster categories, the cluster category label of each data packet to be enqueued, and the cluster center vector of each cluster category. Based on the clustering results, a clustering feature vector is generated.
[0011] By adopting the above technical solution, in order to generate clustering feature vectors, a sample matrix is constructed based on the attribute feature vectors of each data packet to be enqueued. The number of rows in the sample matrix is the number of data packets to be enqueued, and the number of columns is the dimension of the attribute feature vectors. Then, the sample matrix is subjected to column normalization to obtain a column normalized matrix. Then, based on the clustering algorithm, a clustering operation is performed on the column normalized matrix to obtain the clustering result. The clustering result includes the number of clusters, the cluster label of each data packet to be enqueued, and the cluster center vector of each cluster. Then, based on the clustering result, a clustering feature vector is generated.
[0012] Optionally, the step of performing clustering operations on the column normalized matrix based on a clustering algorithm to obtain clustering results, wherein the clustering results include the number of clusters, the cluster category label of each data packet to be enqueued, and the cluster center vector of each cluster category, includes: K row vectors are randomly selected from the column normalized matrix to serve as K cluster center vectors, where K is the preset number of clusters; For each row vector in the column normalization matrix, calculate the Euclidean distance between the row vector and each of the cluster center vectors, and assign the row vector to the cluster represented by the cluster center vector with the smallest Euclidean distance; Based on all row vectors currently contained in each cluster, calculate the mean vector of each cluster in each feature dimension, update the cluster center vector based on the mean vector, and iterate until a preset iteration termination condition is met, wherein the iteration termination condition includes the convergence of the cluster center vector or the current iteration round reaching the preset maximum iteration round. The number of clusters at the end of the iteration, the category labels of each cluster, and the cluster center vector of each cluster category are output as the clustering results.
[0013] By adopting the above technical solution, in order to generate clustering results, K row vectors are randomly selected from the column normalization matrix as K cluster center vectors, where K is the preset number of clusters. Then, for each row vector in the column normalization matrix, the Euclidean distance between the row vector and each cluster center vector is calculated, and the row vector is assigned to the cluster represented by the cluster center vector with the smallest Euclidean distance. Then, based on all the row vectors currently contained in each cluster, the mean vector of each cluster in each feature dimension is calculated, and the cluster center vector is updated according to the mean vector. The iteration is iterated until the preset iteration termination condition is met. The iteration termination condition includes the convergence of the cluster center vectors or the current iteration round reaching the preset maximum iteration round. Then, the number of clusters at the time of iteration termination, the category label of each cluster, and the cluster center vector of each cluster category are output as the clustering result.
[0014] Optionally, the step of updating the logical queue in the edge computing node based on the clustering feature vector, and inserting each data packet to be enqueued into the corresponding logical queue according to the association between the clustering feature vector and the logical queue, includes: Extract the cluster center vector corresponding to each cluster category from the cluster feature vector, and obtain the existing cluster center vectors associated with the at least two logical queues; For each clustering category, the similarity between the cluster center vector of that clustering category and each of the existing cluster center vectors is calculated; If there is a logical queue with a similarity greater than the preset matching threshold, it is determined that the cluster category matches the logical queue successfully, the data packet to be enqueued corresponding to the cluster category is inserted into the logical queue, and the existing cluster center vector associated with the logical queue is updated to the cluster center vector of the cluster category. Otherwise, the matching is deemed to have failed, a new logical queue is created, the data packet to be enqueued corresponding to the cluster category is inserted into the new logical queue, and the cluster center vector of the cluster category is associated with the new logical queue.
[0015] By adopting the above technical solution, in order to update the logical queue, the cluster center vectors corresponding to each cluster category are extracted from the cluster feature vector, and at least two existing cluster center vectors associated with the logical queues are obtained. Then, for each cluster category, the similarity between the cluster center vector of the cluster category and each existing cluster center vector is calculated. If there is a logical queue with a similarity greater than a preset matching threshold, it is determined that the cluster category and the logical queue are successfully matched. The data packet to be enqueued corresponding to the cluster category is inserted into the logical queue, and the existing cluster center vector associated with the logical queue is updated to the cluster center vector of the cluster category. Otherwise, it is determined that the match is unsuccessful, a new logical queue is created, the data packet to be enqueued corresponding to the cluster category is inserted into the new logical queue, and the cluster center vector of the cluster category is associated with the new logical queue.
[0016] Optionally, the step of configuring differentiated discard policy parameter groups for each of the logical queues includes: For each logical queue, obtain the cluster center vector associated with that logical queue, and extract the sensor type identifier and priority identifier from the cluster center vector; Based on the sensor type identifier, the service type to which the logical queue belongs is determined, and a target discarding strategy type is selected from the basic discarding strategy types according to the service type. The basic discarding strategy types include tail discarding, random early detection discarding, and priority-based active discarding. Obtain the remaining cache space of the logical queue, and dynamically calculate the policy parameters corresponding to the target discard policy type based on the priority identifier and the remaining cache space. The policy parameters include at least the upper limit of the discard threshold, the lower limit of the discard threshold, and the maximum discard probability. Bind the target discard policy type with the corresponding policy parameter to generate the discard policy parameter group corresponding to the logical queue.
[0017] By adopting the above technical solution, in order to configure the drop policy parameter group, for each logical queue, the cluster center vector associated with the logical queue is obtained, and the sensor type identifier and priority identifier are extracted from the cluster center vector. Then, based on the sensor type identifier, the service type to which the logical queue belongs is determined, and the target drop policy type is selected from the basic drop policy type according to the service type. The basic drop policy types include tail drop, random early detection drop, and priority-based active drop. Then, the buffer space of the logical queue is obtained, and the policy parameters corresponding to the target drop policy type are dynamically calculated based on the priority identifier and the buffer space. The policy parameters include at least the upper limit of the drop threshold, the lower limit of the drop threshold, and the maximum drop probability. Then, the target drop policy type is bound with the corresponding policy parameters to generate the drop policy parameter group corresponding to the logical queue.
[0018] Optionally, the step of responding to an enqueue event of any of the logical queues and performing a discard decision based on the discard policy parameter group corresponding to the logical queue to determine whether to discard the data packet to be enqueued that triggered the enqueue event includes: In response to an enqueue event in any of the logical queues, calculate the current instantaneous queue length of that logical queue; If the discarding policy type of the logical queue is tail discard, then determine whether the instantaneous queue length is greater than or equal to the upper limit of the discarding threshold. If so, discard the newly arrived data packets to be enqueued in the logical queue until the instantaneous queue length is less than the upper limit of the discarding threshold. If the dropping policy type of the logical queue is random early detection dropping, then determine whether the instantaneous queue length is between the lower limit of the dropping threshold and the upper limit of the dropping threshold. If so, calculate the random dropping probability to be executed based on the maximum dropping probability, and perform probabilistic dropping on the newly arrived data packets to be enqueued in the logical queue based on the random dropping probability. If the instantaneous queue length is greater than or equal to the upper limit of the dropping threshold, then perform deterministic dropping on the newly arrived data packets to be enqueued in the logical queue. If the discarding policy type of the logical queue is priority-based active discarding, then it is determined whether the instantaneous queue length is greater than or equal to the upper limit of the discarding threshold. If so, the data packets to be enqueued in the logical queue are scanned, and the data packets to be enqueued with the lowest priority are discarded until the instantaneous queue length is less than the upper limit of the discarding threshold.
[0019] By adopting the above technical solution, in order to implement the execution of the discard decision, in response to the enqueue event of any logical queue, the current instantaneous queue length of the logical queue is calculated. If the discard policy type of the logical queue is tail discard, it is determined whether the instantaneous queue length is greater than or equal to the upper limit of the discard threshold. If so, the newly arrived data packets to be enqueued in the logical queue are discarded until the instantaneous queue length is less than the upper limit of the discard threshold. If the discard policy type of the logical queue is random early detection discard, it is determined whether the instantaneous queue length is between the lower limit and the upper limit of the discard threshold. If so, the random discard probability to be executed is calculated based on the maximum discard probability, and probabilistic discarding is performed on the newly arrived data packets to be enqueued in the logical queue based on the random discard probability. If the instantaneous queue length is greater than or equal to the upper limit of the discard threshold, deterministic discarding is performed on the newly arrived data packets to be enqueued in the logical queue. If the discard policy type of the logical queue is priority-based active discard, it is determined whether the instantaneous queue length is greater than or equal to the upper limit of the discard threshold. If so, the data packets to be enqueued in the logical queue are scanned, and the data packets to be enqueued in the lowest priority are discarded until the instantaneous queue length is less than the upper limit of the discard threshold.
[0020] Optionally, after the step of responding to an enqueue event of any of the logical queues and performing a discard decision based on the discard policy parameter group corresponding to the logical queue to determine whether to discard the data packet to be enqueued that triggered the enqueue event, the method further includes: Record the number of first data packets arriving in each logical queue within a preset statistical time window and the number of second data packets actually dropped, and calculate the packet loss rate of the logical queue based on the number of first data packets and the number of second data packets. The packet loss rate is compared with the packet loss tolerance threshold in the service quality requirements corresponding to the service type carried by the logical queue. If the packet loss rate exceeds the packet loss tolerance threshold, an adaptive correction operation is triggered on the drop policy parameter group, wherein the adaptive correction operation includes: reducing the maximum drop probability, increasing the upper limit of the drop threshold, and increasing the width of the interval between the lower limit of the drop threshold and the upper limit of the drop threshold.
[0021] By adopting the above technical solution, in order to adjust the packet loss strategy parameters according to the actual packet loss situation of the business, the number of first data packets arriving in each logical queue within a preset statistical time window and the number of second data packets actually dropped are recorded. Based on the number of first data packets and the number of second data packets, the packet loss rate of the logical queue is calculated. Then, the packet loss rate is compared with the packet loss tolerance threshold in the service quality requirements corresponding to the service type carried by the logical queue. If the packet loss rate exceeds the packet loss tolerance threshold, an adaptive correction operation is triggered on the drop policy parameter group. The adaptive correction operation includes: reducing the maximum drop probability, increasing the upper limit of the drop threshold, and increasing the width of the interval between the lower limit and the upper limit of the drop threshold.
[0022] Secondly, this application also provides a sensor network packet loss system based on the Internet of Things, which adopts the following technical solution: A sensor network packet loss system based on the Internet of Things (IoT) is applied to an industrial IoT system. The industrial IoT system includes a management platform, a sensor network platform, and an object platform that are sequentially connected in communication. The edge computing nodes of the sensor network platform have established at least two logical queues and are configured with: The attribute feature extraction module is used to acquire multiple data packets to be enqueued arriving at the edge computing node, and extract the attribute feature vector of each data packet to be enqueued. The clustering analysis module is used to perform clustering analysis on the attribute feature vectors to obtain clustering feature vectors. The queue update and enqueue module is used to update the logical queue in the edge computing node based on the clustering feature vector, and insert each data packet to be enqueued into the corresponding logical queue according to the association between the clustering feature vector and the logical queue. The discarding strategy configuration module is used to configure a differentiated discarding strategy parameter group for each of the logical queues. The discarding strategy parameter group includes a discarding strategy type identifier and a corresponding strategy parameter. At least two of the logical queues correspond to different discarding strategy type identifiers, or correspond to the same discarding strategy type identifier but have different values for the strategy parameter. The discard decision execution module is used to respond to an enqueue event of any of the logical queues, and execute a discard decision based on the discard policy parameter group corresponding to the logical queue, so as to determine whether to discard the data packet to be enqueued that triggered the enqueue event.
[0023] Thirdly, this application also provides a computer device, which adopts the following technical solution: A computer device includes a memory and a processor, the memory storing a computer program executable on the processor, the processor executing the computer program to implement the method described in the first aspect.
[0024] In summary, this application includes at least the following beneficial technical effects: acquiring multiple data packets to be enqueued upon arrival at the edge computing node, extracting attribute feature vectors for each data packet to be enqueued, performing cluster analysis on the attribute feature vectors to obtain cluster feature vectors, updating the logical queues in the edge computing node based on the cluster feature vectors, inserting each data packet to be enqueued into the corresponding logical queue according to the association between the cluster feature vectors and the logical queues, configuring differentiated discarding policy parameter groups for each logical queue, wherein the discarding policy parameter group includes a discarding policy type identifier and a corresponding policy parameter, and at least two logical queues correspond to different discarding policy type identifiers, or correspond to the same discarding policy type identifier but with different values for the policy parameter, and then, in response to an enqueue event of any logical queue, executing a discarding decision according to the discarding policy parameter group corresponding to that logical queue to determine whether to discard the data packet to be enqueued that triggered the enqueue event. This invention extracts the attribute features of data packets and performs cluster analysis, dynamically updates the logical queue and associates it with differentiated discarding strategies, enabling packet loss decisions to perceive the business semantics and attribute differences of the data packets themselves, rather than relying on global queue statistics. At the same time, the queue structure and strategy parameters can be adaptively adjusted according to the data flow characteristics, overcoming the problem of rigid strategy binding. In the scenario of limited edge caching in the Industrial Internet of Things, it can effectively improve the retention probability of high-value critical data packets and enhance the flexibility and rationality of packet loss. Attached Figure Description
[0025] Figure 1 This is a schematic diagram of the overall process of an embodiment of this application.
[0026] Figure 2 This is a structural diagram of one application scenario of the system in this application embodiment.
[0027] Figure 3 This is a structural diagram of another application scenario of the system according to an embodiment of this application.
[0028] Figure 4 This is a structural block diagram of the computer device described in this application. Detailed Implementation
[0029] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0030] This application discloses a method for packet loss in sensor networks based on the Internet of Things.
[0031] Reference Figure 1 A packet loss method for sensor networks based on the Internet of Things (IoT) is applied to an industrial IoT system. This system comprises a management platform, a sensor network platform, and an object platform connected sequentially. The method is executed by an edge computing node on the sensor network platform, which has at least two logical queues established within it. The method includes: Step S11: Obtain multiple data packets to be enqueued upon arrival at the edge computing node, and extract the attribute feature vectors of each data packet to be enqueued.
[0032] It should be noted that in step S11, the edge computing node receives multiple data packets to be enqueued from the object platform or sensor network interface. For each data packet to be enqueued, the edge computing node calls a preset feature extraction operator to parse and quantify the header fields, payload metadata, and context labels carried by the packet, and outputs a set of attribute feature vectors composed of multi-dimensional values. This attribute feature vector at least represents the source device type, service priority identifier, timestamp timeliness level, and data length distribution characteristics of the data packet. The extraction process is performed before the data packet enters the logical queue scheduling domain, and its output is used as the direct input for the clustering analysis in step S12.
[0033] Step S12: Perform cluster analysis on the attribute feature vectors to obtain cluster feature vectors.
[0034] It should be noted that the edge computing node uses the attribute feature vectors of all data packets to be enqueued generated in step S11 as the input sample set and runs an unsupervised clustering algorithm. This algorithm identifies several natural clusters in the current batch of traffic by iteratively calculating the feature space distance or density reachability between samples, and generates a statistical center representation of each cluster, i.e., a clustering feature vector. This clustering feature vector is a high-dimensional abstraction of the common features of the data packet attributes within the same cluster, reflecting the implicit business type division boundary and the expected feature value of each type of traffic in the current industrial IoT traffic.
[0035] Step S13: Based on the clustering feature vector, update the logical queue in the edge computing node, and insert each data packet to be enqueued into the corresponding logical queue according to the association between the clustering feature vector and the logical queue.
[0036] It should be noted that the edge computing node uses the clustering feature vectors obtained in step S12 to adaptively adjust the topology of the logical queues already established within the node. Specific adjustments include: calculating the similarity between each clustering feature vector and the preset feature templates of existing logical queues; maintaining the active state of the corresponding logical queue when the similarity meets the matching condition; triggering the creation of a new logical queue when a clustering feature vector cannot match any existing queue; and performing recycling or suspension operations for idle logical queues with no traffic matching for a long period. After completing the queue update, the node routes and inserts each data packet to the tail of the target logical queue with the highest correlation, based on the correlation measurement results between the attribute feature vectors of each data packet to be enqueued and the clustering feature vectors of each logical queue. This step establishes a dynamic mapping relationship between traffic characteristics and queue resources, ensuring that queue partitioning evolves synchronously with changes in business traffic.
[0037] Step S14: For each logical queue, configure a differentiated discard strategy parameter group. The discard strategy parameter group includes a discard strategy type identifier and the corresponding strategy parameter. At least two logical queues correspond to different discard strategy type identifiers, or correspond to the same discard strategy type identifier but have different values for the strategy parameter.
[0038] It should be noted that the edge computing nodes use the logical queues updated in step S13 as the configuration objects, setting an independent drop policy parameter set for each logical queue. This parameter set consists of a drop policy type identifier and a set of policy parameters. The drop policy type identifier specifies the type of active queue management algorithm used by the queue, such as tail-drop algorithm, random early detection algorithm, or its improved variants for industrial real-time applications. The set of policy parameters contains numerical thresholds and probability factors that control the algorithm's execution behavior, such as the maximum drop probability. For different logical queues, the nodes enforce differentiated configuration constraints: either the drop policy type identifiers are different between any two logical queues, or the type identifiers are the same but at least one policy parameter has a different value. This constraint ensures that data packets of different service categories face different drop risks when encountering congestion.
[0039] Step S15: In response to an enqueue event of any logical queue, execute a discard decision based on the discard policy parameter group corresponding to the logical queue to determine whether to discard the data packet to be enqueued that triggered the enqueue event.
[0040] It should be noted that the edge computing node is triggered to execute the discard decision process when an enqueue event occurs in any logical queue. An enqueue event is defined as follows: a data packet to be enqueued has completed the target queue association decision in step S13 and is about to be written to the cache space of the target logical queue. At the moment the event is triggered, the node immediately reads the discard policy parameter group corresponding to the target logical queue, and simultaneously collects the current cache occupancy status of the queue and the priority flag carried by the data packet to be enqueued. The node calls the corresponding discard decision function based on the read policy type identifier, using the queue status and data packet flag as function input parameters. The function output is a binary decision result: if the result is acceptance, the data packet is allowed to be written to the queue cache and the queue length count is updated; if the result is discard, the write request is rejected and the temporary memory buffer occupied by the data packet is immediately released. This step binds the discard behavior to a queue-level differentiated policy, achieving selective protection and eviction of different service data packets in congestion scenarios.
[0041] In the above implementation, multiple data packets to be enqueued arriving at the edge computing node are acquired, and the attribute feature vectors of each data packet to be enqueued are extracted. Then, cluster analysis is performed on the attribute feature vectors to obtain cluster feature vectors. Based on the cluster feature vectors, the logical queues in the edge computing node are updated, and each data packet to be enqueued is inserted into the corresponding logical queue according to the association between the cluster feature vectors and the logical queues. Then, for each logical queue, a differentiated discarding policy parameter group is configured. The discarding policy parameter group includes a discarding policy type identifier and a corresponding policy parameter. At least two logical queues correspond to different discarding policy type identifiers, or correspond to the same discarding policy type identifier but with different values for the policy parameters. Then, in response to an enqueue event of any logical queue, a discarding decision is executed according to the discarding policy parameter group corresponding to that logical queue to determine whether to discard the data packet to be enqueued that triggered the enqueue event. This invention extracts the attribute features of data packets and performs cluster analysis, dynamically updates the logical queue and associates it with differentiated discarding strategies, enabling packet loss decisions to perceive the business semantics and attribute differences of the data packets themselves, rather than relying on global queue statistics. At the same time, the queue structure and strategy parameters can be adaptively adjusted according to the data flow characteristics, overcoming the problem of rigid strategy binding. In the scenario of limited edge caching in the Industrial Internet of Things, it can effectively improve the retention probability of high-value critical data packets and enhance the flexibility and rationality of packet loss.
[0042] As a further implementation of the method, the step of obtaining multiple data packets to be enqueued upon arrival at the edge computing node and extracting the attribute feature vector of each data packet to be enqueued includes: Step S21: Monitor the receive buffer of the edge computing node at the data link layer. When the number of data packets to be enqueued in the receive buffer reaches the preset batch processing threshold, batch acquire each data packet to be enqueued in the receive buffer.
[0043] Step S22: For each data packet to be enqueued in the batch, read the field value at a fixed offset position in the header field of the data packet to be enqueued.
[0044] Step S23: Based on the preset attribute mapping relationship, the read field values are parsed to obtain the attribute parameters of the data packet. The attribute parameters include the length value, sensor type identifier, priority flag value, and generation timestamp.
[0045] Step S24: Generate corresponding attribute feature vectors based on the attribute parameters of the same data packets to be enqueued.
[0046] It should be noted that steps S21 to S24 explain how to construct attribute feature vectors for clustering analysis at the data packet level. Step S21, by setting a batch processing threshold, transforms the single-packet driven processing mode into batch aggregation processing, effectively reducing the impact of frequent interruptions on the forwarding performance of edge nodes in bursty traffic scenarios. Steps S22 and S23 penetrate the transport layer encapsulation, extracting fields such as length, sensor type, priority marker, and generation timestamp from a fixed offset position in the header, without relying on complex parsing of upper-layer protocols, ensuring rapid adaptation to lightweight industrial IoT sensor messages. Step S24 normalizes the discrete field values into a feature vector of uniform dimension, giving the originally isolated packet header values a computable and comparable semantic density. Based on the obtained attribute feature vector, the subsequent clustering algorithm can accurately capture the cohesion of data packets within the same logical queue in terms of business attributes and real-time requirements, thus providing a more perceptive input basis for differentiated discarding strategies and effectively distinguishing high-value critical data from regular background traffic.
[0047] In the above implementation, in order to extract attribute feature vectors, the receiving buffer of the edge computing node at the data link layer is monitored. When the number of data packets to be enqueued in the receiving buffer reaches a preset batch processing threshold, each data packet to be enqueued in the receiving buffer is acquired in batches. Then, for each data packet to be enqueued in batches, the field value at a fixed offset position in the header field of the data packet is read. Then, based on the preset attribute mapping relationship, the read field value is parsed to obtain the attribute parameters of the data packet. The attribute parameters include length value, sensor type identifier, priority flag value and generation timestamp. Then, according to the attribute parameters of the same data packet to be enqueued, the corresponding attribute feature vector is generated.
[0048] As a further implementation of the method, the step of performing cluster analysis on the attribute feature vectors to obtain cluster feature vectors includes: Step S31: Construct a sample matrix based on the attribute feature vectors of each data packet to be enqueued, wherein the number of rows in the sample matrix is the number of data packets to be enqueued, and the number of columns is the dimension of the attribute feature vectors.
[0049] Step S32: Perform column normalization on the sample matrix to obtain the column normalized matrix.
[0050] Step S33: Based on the clustering algorithm, perform clustering operations on the column normalized matrix to obtain the clustering results. The clustering results include the number of cluster categories, the cluster category label of each data packet to be enqueued, and the cluster center vector of each cluster category.
[0051] Step S34: Generate cluster feature vectors based on the clustering results.
[0052] It should be noted that from steps S31 to S34, step S31 organizes the feature vectors of multiple discrete data packets to be enqueued into a structured sample matrix, providing a unified mathematical input form for subsequent batch clustering analysis. Step S32 performs column normalization on the sample matrix, eliminating the differences in numerical scales of attribute parameters such as length values and timestamps, preventing the clustering algorithm from being dominated by a single dimension with an excessively large value range, and ensuring that each feature dimension has a balanced influence in distance calculation. Step S33 performs clustering operations based on the normalized matrix, which can automatically identify the naturally existing business category groups in the current traffic according to the distribution of the data packet's own attributes, rather than relying on a fixed classification that is statically divided in advance, thereby capturing the dynamic evolution trend of data flow characteristics in real time. Step S34 abstracts the clustering results into clustering feature vectors containing category division and center representation, providing a quantifiable adaptation basis for subsequent updating of the logical queue structure and establishing attribute association relationships, so that the queue division boundary always remains synchronized with the inherent distribution characteristics of the current sensor data, ensuring from the source that the difference discarding strategy can accurately apply to the correctly identified business data flows of the same type.
[0053] In the above implementation, in order to generate clustering feature vectors, a sample matrix is constructed based on the attribute feature vectors of each data packet to be enqueued. The number of rows in the sample matrix is the number of data packets to be enqueued, and the number of columns is the dimension of the attribute feature vectors. Then, the sample matrix is subjected to column normalization to obtain a column normalized matrix. Then, based on the clustering algorithm, a clustering operation is performed on the column normalized matrix to obtain the clustering result. The clustering result includes the number of clusters, the cluster label of each data packet to be enqueued, and the cluster center vector of each cluster. Then, based on the clustering result, a clustering feature vector is generated.
[0054] As a further implementation of the method, based on a clustering algorithm, a clustering operation is performed on the column normalized matrix to obtain the clustering result. The clustering result includes the number of clusters, the cluster label of each data packet to be enqueued, and the cluster center vector of each cluster. This includes the following steps: Step S41: Randomly select K row vectors from the column normalized matrix as K cluster center vectors, where K is the preset number of clusters.
[0055] Step S42: For each row vector in the column normalization matrix, calculate the Euclidean distance between the row vector and each cluster center vector, and assign the row vector to the cluster represented by the cluster center vector with the smallest Euclidean distance.
[0056] Step S43: Calculate the mean vector of each cluster in each feature dimension based on all row vectors currently contained in each cluster, update the cluster center vector based on the mean vector, and iterate until the preset iteration termination condition is met. The iteration termination condition includes the convergence of the cluster center vector or the current iteration round reaching the preset maximum iteration round.
[0057] Step S44: Output the number of clusters at the end of the iteration, the category labels of each cluster, and the cluster center vector of each cluster category as the clustering result.
[0058] It should be noted that from step S41 to step S44, the classic K-line algorithm is used. The MESSENGER algorithm implements the clustering operation in the following steps: Step S41 randomly initializes cluster centers, avoiding reliance on prior classification knowledge and ensuring that the clustering structure is entirely determined by the distribution of the attributes of the arriving data packets, thus meeting the needs of dynamically changing traffic characteristics in the Industrial Internet of Things (IIoT). Step S42 uses Euclidean distance to measure the similarity between row vectors and cluster centers, effectively capturing the numerical proximity between multi-dimensional features such as length values, priority labels, and timestamps, ensuring that data packets with similar business semantics are grouped into the same logical queue. Step S43 iteratively updates the centers based on the intra-cluster mean and sets convergence or maximum round termination conditions, ensuring the stability and reliability of the clustering results while controlling the computational overhead under the limited computing power of edge nodes. Finally, Step S44 outputs the number of categories, labels, and center vectors, which directly provide a basis for subsequent dynamic adjustment of the queue structure and establishment of the "clustering feature-logical queue" relationship, enabling the differentiated configuration of the discard strategy to closely follow the real-time changes in the intrinsic attributes of the data flow.
[0059] In the above implementation, to generate clustering results, K row vectors are randomly selected from the column normalization matrix as K cluster center vectors, where K is a preset number of clusters. Then, for each row vector in the column normalization matrix, the Euclidean distance between the row vector and each cluster center vector is calculated, and the row vector is assigned to the cluster represented by the cluster center vector with the smallest Euclidean distance. Then, based on all the row vectors currently contained in each cluster, the mean vector of each cluster in each feature dimension is calculated, and the cluster center vector is updated based on the mean vector. The iteration is iterated until a preset iteration termination condition is met, where the iteration termination condition includes the convergence of the cluster center vectors or the current iteration round reaching the preset maximum iteration round. Then, the number of clusters at the time of iteration termination, the category labels of each cluster, and the cluster center vectors of each cluster category are output as clustering results.
[0060] As a further implementation of the method, the steps of updating the logical queues in the edge computing nodes based on the clustering feature vectors and inserting each data packet to be enqueued into the corresponding logical queue according to the association between the clustering feature vectors and the logical queues include: Step S51: Extract the cluster center vector corresponding to each cluster category from the cluster feature vector, and obtain the existing cluster center vectors associated with at least two logical queues.
[0061] Step S52: For each cluster category, calculate the similarity between the cluster center vector of that cluster category and each existing cluster center vector.
[0062] Step S53: If there is a logical queue with a similarity greater than the preset matching threshold, it is determined that the cluster category is successfully matched with the logical queue. The data packet to be enqueued corresponding to the cluster category is inserted into the logical queue, and the existing cluster center vector associated with the logical queue is updated to the cluster center vector of the cluster category.
[0063] Step S54: Otherwise, the matching is determined to be unsuccessful, a new logical queue is created, the data packet to be enqueued corresponding to the cluster category is inserted into the new logical queue, and the cluster center vector of the cluster category is associated with the new logical queue.
[0064] It should be noted that from steps S51 to S54, steps S51 and S52 calculate the similarity between the cluster center vector obtained from the current batch clustering and the historical cluster center vector associated with the existing logical queue; step S53, when the similarity is higher than a preset matching threshold, assigns the newly arrived data packet to an existing queue and updates its associated center vector. This not only absorbs the latest trend in the current data packet attribute distribution but also avoids the disorderly expansion of the queue number due to small fluctuations, maintaining the relative stability of the queue structure; step S54 triggers the creation of a new queue when there is no matching queue, enabling the system to adaptively capture newly emerging sensor types or sudden event traffic in the industrial field, achieving dynamic expansion of the queue boundary. Overall, this mechanism makes the organization structure of the logical queue no longer dependent on static predefinition but adjusts synchronously with the evolution of the intrinsic characteristics of the sensor data stream, solving the problem of the rigid binding of queues and discarding strategies in existing technologies from an architectural perspective.
[0065] In the above implementation, in order to update the logical queue, the cluster center vectors corresponding to each cluster category are extracted from the cluster feature vector, and at least two existing cluster center vectors associated with the logical queues are obtained. Then, for each cluster category, the similarity between the cluster center vector of the cluster category and each existing cluster center vector is calculated. If there is a logical queue with a similarity greater than a preset matching threshold, it is determined that the cluster category and the logical queue are successfully matched. The data packet to be enqueued corresponding to the cluster category is inserted into the logical queue, and the existing cluster center vector associated with the logical queue is updated to the cluster center vector of the cluster category. Otherwise, it is determined that the match has failed, a new logical queue is created, the data packet to be enqueued corresponding to the cluster category is inserted into the new logical queue, and the cluster center vector of the cluster category is associated with the new logical queue.
[0066] As a further implementation of the method, the step of configuring a differentiated discard policy parameter group for each logical queue includes: Step S61: For each logical queue, obtain the cluster center vector associated with that logical queue, and extract the sensor type identifier and priority identifier from the cluster center vector.
[0067] Step S62: Determine the service type to which the logical queue belongs based on the sensor type identifier, and select the target discard strategy type from the basic discard strategy type according to the service type. The basic discard strategy types include tail discard, random early detection discard, and priority-based active discard.
[0068] Step S63: Obtain the remaining cache space of the logical queue, and dynamically calculate the policy parameters corresponding to the target discard policy type based on the priority identifier and the remaining cache space. The policy parameters include at least the upper limit of the discard threshold, the lower limit of the discard threshold, and the maximum discard probability.
[0069] Step S64: Bind the target discard policy type with the corresponding policy parameters to generate the discard policy parameter group corresponding to the logical queue.
[0070] It should be noted that steps S61 to S64 clarify the specific generation process of the differentiated discarding strategy parameter group, thereby directly mapping the business semantic features extracted by cluster analysis into executable queue management actions. Specifically, step S61 decouples the sensor type identifier and priority identifier from the cluster center vector, so that the configuration of the queue discarding strategy no longer depends on static ports or fixed tags, but accurately anchors the actual business attributes after the aggregation of data packets in the queue; step S62 determines the business affiliation based on the sensor type and selects one from basic strategies such as tail discarding, RED, or priority-based active discarding. For example, a more lenient early congestion avoidance strategy is selected for time-sensitive services such as vibration monitoring, while tail fast discarding is applied to background log streams, avoiding the improper discarding of high-value data from a mechanism level; step S63 further introduces The cache balance serves as a dynamic adjustment factor, which, combined with the priority identifier, calculates the drop threshold and maximum drop probability in real time. This enables the policy parameters to respond sensitively to transient changes in storage pressure at edge nodes. In the final step S64, the policy type and dynamic parameters are bound to a parameter group, forming a closed loop of "business-aware selection and state-driven parameter tuning." This ensures that each logical queue has a set of drop logic adapted to its own business level and real-time resource constraints, achieving a leap from indiscriminate packet loss to semantically aware and refined packet loss. This improves the reliability of critical industrial sensor data retention and the quality of network services in resource-constrained edge computing scenarios.
[0071] In the above implementation, in order to configure the drop policy parameter group, for each logical queue, the cluster center vector associated with the logical queue is obtained, and the sensor type identifier and priority identifier are extracted from the cluster center vector. Then, based on the sensor type identifier, the service type to which the logical queue belongs is determined, and the target drop policy type is selected from the basic drop policy type according to the service type. The basic drop policy types include tail drop, random early detection drop, and priority-based active drop. Then, the buffer space of the logical queue is obtained, and the policy parameters corresponding to the target drop policy type are dynamically calculated based on the priority identifier and the buffer space. The policy parameters include at least the upper limit of the drop threshold, the lower limit of the drop threshold, and the maximum drop probability. Then, the target drop policy type is bound with the corresponding policy parameters to generate the drop policy parameter group corresponding to the logical queue.
[0072] As a further implementation of the method, in response to an enqueue event of any logical queue, the step of performing a discard decision based on the discard policy parameter group corresponding to the logical queue to determine whether to discard the data packet to be enqueued that triggered the enqueue event includes: Step S71: In response to an enqueue event of any logical queue, calculate the current instantaneous queue length of that logical queue.
[0073] Step S72: If the dropping policy type of the logical queue is tail dropping, then determine whether the instantaneous queue length is greater than or equal to the upper limit of the dropping threshold. If so, drop the newly arrived data packets to be enqueued into the logical queue until the instantaneous queue length is less than the upper limit of the dropping threshold.
[0074] Step S73: If the dropping policy type of the logical queue is random early detection dropping, then determine whether the instantaneous queue length is between the lower limit and the upper limit of the dropping threshold. If so, calculate the random dropping probability to be executed based on the maximum dropping probability, and perform probabilistic dropping on the newly arrived data packets to be enqueued in the logical queue based on the random dropping probability. If the instantaneous queue length is greater than or equal to the upper limit of the dropping threshold, then perform deterministic dropping on the newly arrived data packets to be enqueued in the logical queue.
[0075] Step S74: If the discarding policy type of the logical queue is priority-based active discarding, then determine whether the instantaneous queue length is greater than or equal to the upper limit of the discarding threshold. If so, scan the data packets to be enqueued in the logical queue and discard the data packets to be enqueued with the lowest priority until the instantaneous queue length is less than the upper limit of the discarding threshold.
[0076] It should be noted that steps S71 to S74 provide three specific paths for executing precise congestion control based on pre-configured differentiated drop policy parameter groups at specific queuing moments, demonstrating a complete closed loop from policy configuration to decision execution. Specifically, step S71 uses the instantaneous queue length as a unified scalar for triggering evaluation, ensuring that the drop decision is directly linked to the actual cache pressure of the edge node; step S72 adopts a tail-drop strategy for low-value background traffic, quickly releasing tail space only when the queue reaches its upper limit, achieving simplicity and efficiency; step S73 enables random early detection drop for regular services, calculating the random drop probability based on the maximum drop probability when the queue is between the lower and upper limits, achieving early and gentle intervention in congestion and avoiding accidental damage to high-value data caused by global synchronization effects; step S74 adopts priority-based proactive drop for high-priority time-sensitive services, not dropping newly arrived potentially high-priority data when the queue is strained, but removing the lowest-priority existing packets from the already enqueued queue, maximizing the retention and timely forwarding of critical sensor data. From step S71 to step S74, by upgrading the packet dropping action from indiscriminate packet dropping that relies on global statistics to differentiated packet dropping based on business semantics and real-time queue depth, the rationality of packet dropping by industrial IoT edge nodes in high-burst and resource-constrained scenarios is improved.
[0077] In the above implementation, in order to execute the discard decision, in response to an enqueue event of any logical queue, the current instantaneous queue length of the logical queue is calculated. If the discard policy type of the logical queue is tail discard, it is determined whether the instantaneous queue length is greater than or equal to the upper limit of the discard threshold. If so, the newly arrived data packets to be enqueued are discarded until the instantaneous queue length is less than the upper limit of the discard threshold. If the discard policy type of the logical queue is random early detection discard, it is determined whether the instantaneous queue length is between the lower limit and the upper limit of the discard threshold. If so, the random discard probability to be executed is calculated based on the maximum discard probability, and probabilistic discarding is performed on the newly arrived data packets to be enqueued based on the random discard probability. If the instantaneous queue length is greater than or equal to the upper limit of the discard threshold, deterministic discarding is performed on the newly arrived data packets to be enqueued. If the discard policy type of the logical queue is priority-based active discard, it is determined whether the instantaneous queue length is greater than or equal to the upper limit of the discard threshold. If so, the data packets to be enqueued in the logical queue are scanned, and the data packets to be enqueued with the lowest priority are discarded until the instantaneous queue length is less than the upper limit of the discard threshold.
[0078] As a further implementation of the method, after the step of performing a discard decision based on the discard policy parameter group corresponding to the logical queue in response to an enqueue event of any logical queue to determine whether to discard the data packet to be enqueued that triggered the enqueue event, the method includes: Step S81: Record the number of first data packets arriving in each logical queue within a preset statistical time window and the number of second data packets actually dropped, and calculate the packet loss rate of the logical queue based on the number of first data packets and the number of second data packets.
[0079] Step S82: Compare the packet loss rate with the packet loss tolerance threshold in the quality of service requirements corresponding to the service type carried by the logical queue.
[0080] Step S83: If the packet loss rate exceeds the packet loss tolerance threshold, an adaptive correction operation is triggered on the drop policy parameter group. The adaptive correction operation includes: reducing the maximum drop probability, increasing the upper limit of the drop threshold, and increasing the width of the interval between the lower limit of the drop threshold and the upper limit of the drop threshold.
[0081] It should be noted that from steps S81 to S83, a feedback correction mechanism based on a statistical window is introduced after the drop decision, constructing a closed-loop evaluation link between policy configuration and execution effect. Specifically, step S81 calculates the actual packet loss rate by recording the number of arrivals and drops, quantifying the policy effect into a comparable service indicator; step S82 compares the measured packet loss rate with the packet loss tolerance threshold preset for the business type, realizing a quantitative judgment on whether the current drop policy is too aggressive; step S83 triggers adaptive correction when the packet loss rate exceeds the limit, actively mitigating the drop intensity by reducing the maximum drop probability, raising the drop threshold, or widening the random drop interval. This mechanism enables edge nodes to dynamically optimize between limited cache resources and business service quality assurance, preventing critical sensor data from being excessively dropped in the long term due to fixed policy parameters, further improving the flexibility of packet loss control and the adaptive level of business perception in industrial IoT scenarios.
[0082] In the above implementation, in order to adjust the packet loss policy parameters according to the actual packet loss situation of the service, the number of first data packets arriving in each logical queue within a preset statistical time window and the number of second data packets actually dropped are recorded. Based on the number of first data packets and the number of second data packets, the packet loss rate of the logical queue is calculated. Then, the packet loss rate is compared with the packet loss tolerance threshold in the service quality requirements corresponding to the service type carried by the logical queue. If the packet loss rate exceeds the packet loss tolerance threshold, an adaptive correction operation on the drop policy parameter group is triggered. The adaptive correction operation includes: reducing the maximum drop probability, increasing the upper limit of the drop threshold, and increasing the width of the interval between the lower limit and the upper limit of the drop threshold.
[0083] This application also discloses a packet loss system for sensor networks based on the Internet of Things.
[0084] refer to Figure 2 A sensor network packet loss system based on the Internet of Things (IoT) is applied to an industrial IoT system. This system comprises a management platform, a sensor network platform, and an object platform, which are sequentially connected. The edge computing nodes of the sensor network platform have established at least two logical queues and are configured with: The attribute feature extraction module is used to obtain multiple data packets to be enqueued upon arrival at the edge computing node, and extract the attribute feature vector of each data packet to be enqueued. The clustering analysis module is used to perform clustering analysis on attribute feature vectors to obtain cluster feature vectors; The queue update and enqueue module is used to update the logical queues in the edge computing nodes based on the clustering feature vectors, and insert each data packet to be enqueued into the corresponding logical queue according to the association between the clustering feature vectors and the logical queues. The discard strategy configuration module is used to configure a differentiated discard strategy parameter group for each logical queue. The discard strategy parameter group includes a discard strategy type identifier and the corresponding strategy parameter. At least two logical queues may have different discard strategy type identifiers or the same discard strategy type identifier but different values for the strategy parameter. The discard decision execution module is used to respond to an enqueue event of any logical queue and execute a discard decision based on the discard policy parameter group corresponding to that logical queue to determine whether to discard the data packet to be enqueued that triggered the enqueue event.
[0085] The overall framework of another application scenario of the IoT-based sensor network packet loss system of the present invention is as follows: Figure 3 As shown, it can include a user platform, service platform, management platform, sensor network platform, and object platform that interact sequentially, forming a five-platform architecture based on the Internet of Things. Among them, the edge computing nodes of the sensor network platform have established at least two logical queues, and the edge computing nodes include an attribute feature extraction module, a clustering analysis module, a queue update and enqueue module, a drop policy configuration module, and a drop decision execution module.
[0086] Specifically, the edge computing node is configured to: acquire multiple data packets to be enqueued arriving at the edge computing node, and extract the attribute feature vectors of each data packet; perform cluster analysis on the attribute feature vectors to obtain cluster feature vectors; update the logical queues in the edge computing node based on the cluster feature vectors, and insert each data packet to be enqueued into the corresponding logical queue according to the association between the cluster feature vectors and the logical queues; configure a differentiated discarding policy parameter group for each logical queue, wherein the discarding policy parameter group includes a discarding policy type identifier and a corresponding policy parameter, and at least two logical queues correspond to different discarding policy type identifiers, or correspond to the same discarding policy type identifier but with different values for the policy parameter; and, in response to an enqueue event of any logical queue, execute a discarding decision according to the discarding policy parameter group corresponding to that logical queue to determine whether to discard the data packet to be enqueued that triggered the enqueue event.
[0087] The IoT-based sensor network packet loss system of the present invention can implement any of the IoT-based sensor network packet loss methods, and the specific working process of the IoT-based sensor network packet loss system of the present invention can refer to the corresponding process in the above-mentioned IoT-based sensor network packet loss methods.
[0088] This application also discloses a computer device.
[0089] refer to Figure 4A computer device includes a memory and a processor, wherein the memory stores a computer program that can run on the processor, and the processor executes the computer program to implement any of the above-described methods for packet loss in sensor networks based on the Internet of Things.
[0090] The above are all preferred embodiments of this application and are not intended to limit the scope of protection of this application. Any feature disclosed in this specification (including the abstract and drawings) may be replaced by other equivalent or similar features unless specifically stated otherwise. That is, unless specifically stated otherwise, each feature is only one example of a series of equivalent or similar features.
Claims
1. A packet loss method for sensor networks based on the Internet of Things, characterized in that, The method is applied to an industrial Internet of Things (IIoT) system, which includes a management platform, a sensor network platform, and an object platform that are sequentially connected in communication. The method is executed by an edge computing node of the sensor network platform, where at least two logical queues have been established. The method includes: Obtain multiple data packets to be enqueued that have arrived at the edge computing node, and extract the attribute feature vector of each data packet to be enqueued. Cluster analysis is performed on the attribute feature vectors to obtain cluster feature vectors; Based on the clustering feature vector, the logical queue in the edge computing node is updated, and according to the association between the clustering feature vector and the logical queue, each data packet to be enqueued is inserted into the corresponding logical queue. For each of the logical queues, a differentiated discarding strategy parameter group is configured. The discarding strategy parameter group includes a discarding strategy type identifier and a corresponding strategy parameter. At least two of the logical queues correspond to different discarding strategy type identifiers, or correspond to the same discarding strategy type identifier but have different values for the strategy parameter. In response to an enqueue event in any of the logical queues, a discard decision is performed based on the discard policy parameter group corresponding to the logical queue to determine whether to discard the data packet to be enqueued that triggered the enqueue event.
2. The packet loss method for sensor networks based on the Internet of Things according to claim 1, characterized in that, The step of obtaining multiple data packets to be enqueued upon arrival at the edge computing node, and extracting the attribute feature vectors of each data packet to be enqueued, includes: Monitor the receive buffer of the edge computing node at the data link layer. When the number of data packets to be enqueued in the receive buffer reaches a preset batch processing threshold, batch acquire each of the data packets to be enqueued in the receive buffer. For each of the data packets to be enqueued in the batch, read the field value at a fixed offset position in the header field of the data packet to be enqueued; Based on the preset attribute mapping relationship, the read field values are parsed to obtain the attribute parameters of the data packet, wherein the attribute parameters include length value, sensor type identifier, priority flag value and generation timestamp; Based on the attribute parameters of the same data packet to be enqueued, a corresponding attribute feature vector is generated.
3. The packet loss method for sensor networks based on the Internet of Things according to claim 1, characterized in that, The step of performing cluster analysis on the attribute feature vectors to obtain cluster feature vectors includes: Based on the attribute feature vectors of each of the data packets to be enqueued, a sample matrix is constructed, wherein the number of rows in the sample matrix is the number of data packets to be enqueued, and the number of columns is the dimension of the attribute feature vectors; The sample matrix is subjected to column normalization to obtain a column normalized matrix; Based on the clustering algorithm, clustering operation is performed on the column normalized matrix to obtain clustering results, wherein the clustering results include the number of cluster categories, the cluster category label of each data packet to be enqueued, and the cluster center vector of each cluster category. Based on the clustering results, a clustering feature vector is generated.
4. The packet loss method for sensor networks based on the Internet of Things according to claim 3, characterized in that, The step of performing clustering operations on the column normalized matrix based on a clustering algorithm to obtain clustering results, wherein the clustering results include the number of clusters, the cluster category label of each data packet to be enqueued, and the cluster center vector of each cluster category, includes: K row vectors are randomly selected from the column normalized matrix to serve as K cluster center vectors, where K is the preset number of clusters; For each row vector in the column normalization matrix, calculate the Euclidean distance between the row vector and each of the cluster center vectors, and assign the row vector to the cluster represented by the cluster center vector with the smallest Euclidean distance; Based on all row vectors currently contained in each cluster, calculate the mean vector of each cluster in each feature dimension, update the cluster center vector based on the mean vector, and iterate until a preset iteration termination condition is met, wherein the iteration termination condition includes the convergence of the cluster center vector or the current iteration round reaching the preset maximum iteration round. The number of clusters at the end of the iteration, the category labels of each cluster, and the cluster center vector of each cluster category are output as the clustering results.
5. The packet loss method for sensor networks based on the Internet of Things according to claim 3, characterized in that, The step of updating the logical queue in the edge computing node based on the clustering feature vector, and inserting each data packet to be enqueued into the corresponding logical queue according to the association between the clustering feature vector and the logical queue, includes: Extract the cluster center vector corresponding to each cluster category from the cluster feature vector, and obtain the existing cluster center vectors associated with the at least two logical queues; For each clustering category, the similarity between the cluster center vector of that clustering category and each of the existing cluster center vectors is calculated; If there is a logical queue with a similarity greater than the preset matching threshold, it is determined that the cluster category matches the logical queue successfully, the data packet to be enqueued corresponding to the cluster category is inserted into the logical queue, and the existing cluster center vector associated with the logical queue is updated to the cluster center vector of the cluster category. Otherwise, the matching is deemed to have failed, a new logical queue is created, the data packet to be enqueued corresponding to the cluster category is inserted into the new logical queue, and the cluster center vector of the cluster category is associated with the new logical queue.
6. The packet loss method for sensor networks based on the Internet of Things according to claim 1, characterized in that, The step of configuring differentiated discard policy parameter groups for each of the logical queues includes: For each logical queue, obtain the cluster center vector associated with that logical queue, and extract the sensor type identifier and priority identifier from the cluster center vector; Based on the sensor type identifier, the service type to which the logical queue belongs is determined, and a target discarding strategy type is selected from the basic discarding strategy types according to the service type. The basic discarding strategy types include tail discarding, random early detection discarding, and priority-based active discarding. Obtain the remaining cache space of the logical queue, and dynamically calculate the policy parameters corresponding to the target discard policy type based on the priority identifier and the remaining cache space. The policy parameters include at least the upper limit of the discard threshold, the lower limit of the discard threshold, and the maximum discard probability. Bind the target discard policy type with the corresponding policy parameter to generate the discard policy parameter group corresponding to the logical queue.
7. The method for packet loss in IoT-based sensor networks according to claim 6, characterized in that, The step of responding to an enqueue event in any of the logical queues and performing a discard decision based on the discard policy parameter group corresponding to the logical queue to determine whether to discard the data packet to be enqueued that triggered the enqueue event includes: In response to an enqueue event in any of the logical queues, calculate the current instantaneous queue length of that logical queue; If the discarding policy type of the logical queue is tail discard, then determine whether the instantaneous queue length is greater than or equal to the upper limit of the discarding threshold. If so, discard the newly arrived data packets to be enqueued in the logical queue until the instantaneous queue length is less than the upper limit of the discarding threshold. If the dropping policy type of the logical queue is random early detection dropping, then determine whether the instantaneous queue length is between the lower limit of the dropping threshold and the upper limit of the dropping threshold. If so, calculate the random dropping probability to be executed based on the maximum dropping probability, and perform probabilistic dropping on the newly arrived data packets to be enqueued in the logical queue based on the random dropping probability. If the instantaneous queue length is greater than or equal to the upper limit of the dropping threshold, then perform deterministic dropping on the newly arrived data packets to be enqueued in the logical queue. If the discarding policy type of the logical queue is priority-based active discarding, then it is determined whether the instantaneous queue length is greater than or equal to the upper limit of the discarding threshold. If so, the data packets to be enqueued in the logical queue are scanned, and the data packets to be enqueued with the lowest priority are discarded until the instantaneous queue length is less than the upper limit of the discarding threshold.
8. The packet loss method for sensor networks based on the Internet of Things according to claim 6, characterized in that, Following the step of responding to an enqueue event in any of the logical queues and performing a discard decision based on the discard policy parameter group corresponding to the logical queue to determine whether to discard the data packet to be enqueued that triggered the enqueue event, the process includes: Record the number of first data packets arriving and the number of second data packets actually dropped in each logical queue within a preset statistical time window, and calculate the packet loss rate of the logical queue based on the number of first data packets and the number of second data packets. The packet loss rate is compared with the packet loss tolerance threshold in the service quality requirements corresponding to the service type carried by the logical queue. If the packet loss rate exceeds the packet loss tolerance threshold, an adaptive correction operation is triggered on the drop policy parameter group, wherein the adaptive correction operation includes: reducing the maximum drop probability, increasing the upper limit of the drop threshold, and increasing the width of the interval between the lower limit of the drop threshold and the upper limit of the drop threshold.
9. A sensor network packet loss system based on the Internet of Things, characterized in that, This is applied to an industrial Internet of Things (IIoT) system, which includes a management platform, a sensor network platform, and an object platform that are sequentially connected in communication. The edge computing nodes of the sensor network platform have established at least two logical queues and are configured with: The attribute feature extraction module is used to acquire multiple data packets to be enqueued arriving at the edge computing node, and extract the attribute feature vector of each data packet to be enqueued. The clustering analysis module is used to perform clustering analysis on the attribute feature vectors to obtain clustering feature vectors. The queue update and enqueue module is used to update the logical queue in the edge computing node based on the clustering feature vector, and insert each data packet to be enqueued into the corresponding logical queue according to the association between the clustering feature vector and the logical queue. The discarding strategy configuration module is used to configure a differentiated discarding strategy parameter group for each of the logical queues. The discarding strategy parameter group includes a discarding strategy type identifier and a corresponding strategy parameter. At least two of the logical queues correspond to different discarding strategy type identifiers, or correspond to the same discarding strategy type identifier but have different values for the strategy parameter. The discard decision execution module is used to respond to an enqueue event of any of the logical queues, and execute a discard decision based on the discard policy parameter group corresponding to the logical queue, so as to determine whether to discard the data packet to be enqueued that triggered the enqueue event.
10. A computer device, characterized in that, The method includes a memory and a processor, wherein the memory stores a computer program that can run on the processor, and the processor executes the computer program to implement the method of any one of claims 1 to 8.