An intelligent gateway data distribution method based on edge computing
By using edge inference computing and state inversion algorithm models, combined with link quality and node load information from network state monitoring services, the data distribution path and format are dynamically calculated, solving the problem of insufficient decision optimization in existing technologies and achieving more efficient data distribution.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- LANJING TECH (NANJING) CO LTD
- Filing Date
- 2026-03-26
- Publication Date
- 2026-06-19
AI Technical Summary
Existing edge computing smart gateways fail to effectively utilize intermediate feature representations for decision optimization during data distribution. Network status monitoring services are not involved in distribution configuration, resulting in data distribution paths, priorities, and encapsulation formats being set out of real-time network operating conditions, making it impossible to achieve personalized computing and decision fusion.
The edge inference computing engine generates preliminary decision results and intermediate feature representations. Combined with the state inversion algorithm model, it infers the historical hidden state of the terminal device. Combined with the link quality matrix and downstream node load vector, it dynamically calculates the distribution configuration scheme of transmission path, priority and data encapsulation format.
It achieves the fusion of historical status-related information of decision data, links the distribution configuration scheme with the real-time network status, and ensures that the transmission path, priority and data encapsulation format are adapted to network operating conditions, thereby improving the efficiency and accuracy of data distribution.
Smart Images

Figure CN122247913A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of edge computing gateway technology, specifically a smart gateway data distribution method based on edge computing. Background Technology
[0002] Existing edge computing smart gateways primarily process terminal sensor data by directly forwarding the results after real-time inference. The data distribution process relies on pre-defined subscription relationships to match downstream nodes, and transmission parameters are determined statically. During gateway operation, link and load information collected by network status monitoring services is not involved in distribution configuration calculations, and intermediate feature representations generated by inference calculations serve only as supplementary data for inference, without participating in subsequent decision optimization.
[0003] Real-time decision-making results are generated solely based on current sensor data, without considering the historical operating status of terminal devices. The information dimension of the decision data is limited to the characteristics of the currently collected data. The transmission path, priority, and encapsulation format settings for data distribution are detached from real-time network operating conditions. The distribution configuration is unrelated to link transmission status and node load. The potential data value represented by intermediate features is not explored, and network status data is only used at the monitoring level.
[0004] The intermediate feature representations output by the inference process cannot be used to invert the historical implicit state of the terminal and achieve the fusion and optimization of decision results. The data distribution configuration cannot be combined with the real-time link quality matrix and the downstream node load vector to complete personalized calculation and setting. Summary of the Invention
[0005] This invention aims to solve at least one of the technical problems existing in the prior art; Therefore, this invention proposes a smart gateway data distribution method based on edge computing, comprising: Receive raw sensor data streams from one or more terminal devices, process the raw sensor data streams to form a data packet to be computed, and load the data packet to be computed into an edge inference computing engine built based on a pre-trained model; Using the edge inference computing engine, real-time inference computing is performed on the data packet to be computed, generating preliminary decision results and intermediate feature representations; The preliminary decision results and the intermediate feature representations are input together into the state inversion algorithm model; The state inversion algorithm model is run to inversely deduce the hidden state sequence of the terminal device at historical moments based on the intermediate feature representation, and the hidden state sequence is fused with the preliminary decision results to generate enhanced decision data that incorporates historical states. Based on the content type of the enhanced decision data and the preset subscription relationship, a list of downstream nodes that need to receive the enhanced decision data is dynamically filtered out. The link quality matrix and downstream node load vector are obtained in real time from the network status monitoring service. Combining the link quality matrix and the downstream node load vector, a distribution configuration scheme including transmission path, priority and data encapsulation format is calculated for each node in the downstream node list; Based on the calculated distribution configuration scheme, the enhanced decision data is distributed to the corresponding nodes in the downstream node list.
[0006] Further, the original sensor data stream is processed to form a data packet to be calculated, including: Identify high-value data segments in the original sensor data stream that are related to a preset task; The identified high-value data segments are preprocessed, including data cleaning, timestamp alignment, and format standardization, to form a data package to be computed; The identification of high-value data segments related to the preset task in the original sensor data stream includes: Configure multiple task modes and set corresponding data feature trigger templates for each task mode; The original sensor data stream is divided into continuous data slices by a sliding window. Extract the feature vectors of each data slice in the time and frequency domains, and perform similarity matching calculations with the data feature trigger templates corresponding to all task modes; When the matching degree between the feature vector of a data slice and any data feature trigger template exceeds a dynamic threshold, the data slice is marked as the high-value data segment; All marked high-value data segments are cut from their original time-series locations, and a metadata header containing the original time range, data source identifier, and matching task pattern is attached to each high-value data segment.
[0007] Furthermore, the edge inference computing engine is used to perform real-time inference computing on the data packet to be computed, including: From the local model library, load the corresponding pre-trained model weights based on the task mode labels carried in the data packet to be computed; The data content in the data packet to be calculated is input into the pre-trained model loaded with weights, and forward propagation calculation is performed; Obtain the logical value of the final output layer of the pre-trained model, and map the logical value into a specific operation instruction through a decision function to form the preliminary decision result; Simultaneously, the feature map output of one or several layers in the middle of the pre-trained model is captured, and the feature map output is flattened and dimensionality reduced to form the intermediate feature representation.
[0008] Furthermore, the state inversion algorithm model is run to invert the implicit state sequence of the terminal device at historical moments based on the intermediate feature representation, including: A recurrent generative network is constructed as the main structure of the state inversion algorithm model; The intermediate feature representation at the current time step is input into the encoder of the recurrent generative network to obtain the hidden state encoding at the current time step. Starting from the hidden state encoding at the current moment, the decoder part of the recurrent generation network is driven to perform reverse temporal iteration; In each iteration, the decoder infers the hidden state of an earlier historical moment based on the hidden state predicted in the previous historical moment, and so on until the preset inversion time window length is covered. The hidden states at all historical moments inferred from the iterative steps are arranged in reverse chronological order to form the hidden state sequence.
[0009] Furthermore, the implicit state sequence is fused with the preliminary decision results to generate enhanced decision data that incorporates historical states, including: Attention weights are calculated on the sequence of hidden states to evaluate the importance of hidden states at different historical moments to the current decision. Based on the calculated attention weights, the hidden state sequence is weighted and summed to obtain a comprehensive historical state representation. The comprehensive historical state representation is concatenated with the vector representation corresponding to the preliminary decision result to form a fused feature vector; The fused feature vectors are then subjected to nonlinear transformation and dimensional adjustment through a fully connected network, ultimately outputting structured enhanced decision data.
[0010] Furthermore, based on the content type of the enhanced decision data and the preset subscription relationship, a list of downstream nodes that need to receive the enhanced decision data is dynamically filtered, including: Parse the metadata header of the enhanced decision-making data to obtain its content type tags; Query the locally maintained subscription configuration table, which records the content types subscribed to by different downstream nodes; The content type tags of the enhanced decision data are compared with the records in the subscription configuration table to filter out all downstream nodes that have subscribed to the content type indicated by the content type tag, forming an initial candidate node set; According to the preset node capability filtering rules, downstream nodes that do not have the ability to process the current enhanced decision data format or protocol are removed from the initial candidate node set, resulting in the downstream node list.
[0011] Furthermore, the step of obtaining the link quality matrix and downstream node load vector at the current moment from the network status monitoring service in real time includes: Periodically send probe packets to routers and downstream nodes in the network; Collect round-trip time, packet loss rate, and throughput information of the probe data packets; Based on the collected information, a matrix is constructed with smart gateways and downstream nodes as row and column indices. The matrix element values represent the quality scores of the corresponding links, forming the link quality matrix. Simultaneously, a status query request is sent to the nodes in the downstream node list, and the CPU utilization, memory usage and network queue length information returned by each node are received and parsed. The received and parsed information on CPU utilization, memory usage, and network queue length is normalized and combined into a multi-dimensional vector to form the downstream node load vector.
[0012] Furthermore, combining the link quality matrix and the downstream node load vector, a distribution configuration scheme including transmission path, priority, and data encapsulation format is calculated for each node in the downstream node list, including: For each node in the downstream node list, extract the direct link quality score from the smart gateway to the current node from the link quality matrix, as well as the comprehensive quality score of all potential paths that pass through other nodes to the current node. Extract the current load metric of the current node from the load vector of the downstream node; An optimization objective function is established, which aims to maximize the timeliness and reliability score of the final delivered data while minimizing the impact on high-load nodes. The optimization objective function is solved by taking the direct link quality score, the comprehensive quality score of potential paths, and the current load index of the node as inputs. The solution includes the selected transmission path, the transmission priority of node data, and the data encapsulation format adopted to adapt to the selected path, which together constitute the distribution configuration scheme of the node.
[0013] Further, the step of distributing the enhanced decision data to the corresponding nodes in the downstream node list according to the calculated distribution configuration scheme includes: According to the data encapsulation format specified in the distribution configuration scheme, the enhanced decision data is serialized and encapsulated to form transmission data units; Based on the sending priority set for different nodes in the distribution configuration scheme, the data units to be sent are sorted and placed into different sending queues; The sending thread is scheduled to process each data unit in turn according to the priority order of the sending queue. For each data transmission unit, based on the transmission path specified in its distribution configuration scheme, it is selected whether to send it via a direct link or to route it to a relay node for relay forwarding; After sending the data to all nodes in the downstream node list, log the distribution.
[0014] Furthermore, it also includes an adaptive optimization step after the initial distribution: Collect the actual transmission performance indicators of each link and the reception confirmation status of downstream nodes during this distribution process; The actual transmission performance metrics are compared with the performance metrics predicted based on the link quality matrix before distribution, and the prediction error is calculated. If the prediction error continues to exceed the tolerance threshold, it will trigger the adjustment of the parameters of the detection algorithm in the network status monitoring service or the update of the link quality assessment model. At the same time, based on the receipt confirmation status of downstream nodes, update the activity status and capability rating of nodes in the subscription configuration table; The adjusted parameters, model, and updated subscription configuration table are used in the subsequent data distribution decision-making process.
[0015] Compared with the prior art, the beneficial effects of the present invention are: The preliminary decision results generated by the edge inference computing engine and the intermediate feature representation are synchronously input into the state inversion algorithm model. Based on the intermediate feature representation, the inversion operation of the hidden state sequence of the terminal device at historical moments is completed. The hidden state sequence obtained by inversion and the preliminary decision results are fused together. The enhanced decision data formed after fusion processing incorporates relevant information from historical states. The constituent elements of the decision data cover the historical operating characteristics of the terminal device and the current data inference characteristics. The inherent data attributes of the intermediate feature representation are fully utilized. The introduction of the hidden state sequence expands the information composition of the decision data and enhances the correlation between the decision data and the actual operating state of the terminal device.
[0016] After the dynamic filtering of the downstream node list is completed, the real-time link quality matrix and downstream node load vector are retrieved from the network status monitoring service. Using the link quality matrix and downstream node load vector as calculation parameters, the distribution configuration scheme corresponding to the transmission path, priority and data encapsulation format is calculated for each node in the downstream node list. The generation process of the distribution configuration scheme is linked with the real-time network operation status. The distribution configuration content of each node matches the transmission characteristics of the corresponding link and the load status of the node itself. The generation logic of the distribution configuration changes from static setting to real-time dynamic calculation. The setting of transmission path, priority and data encapsulation format is in line with the real-time network operation conditions. Attached Figure Description
[0017] Figure 1 This is a flowchart illustrating the steps of a smart gateway data distribution method based on edge computing as described in this invention. Figure 2 A flowchart for generating decisions and intermediate features through real-time inference computation; Figure 3 A comparison chart of the number of nodes before and after filtering for different content types; Figure 4 Node load vector analysis diagram; Figure 5 A line graph for predictive error analysis. Detailed Implementation
[0018] The technical solution of the present invention will be clearly and completely described below with reference to the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0019] See Figure 1The smart gateway receives raw sensor data streams from one or more terminal devices, processes these streams to form a data packet to be computed, and loads this data packet into an edge inference computing engine built on a pre-trained model. Using this edge inference computing engine, real-time inference computation is performed on the data packet to generate preliminary decision results and intermediate feature representations. These preliminary decision results and intermediate feature representations are then input into a state inversion algorithm model. The state inversion algorithm model runs, deducing the implicit state sequence of the terminal devices at historical moments based on the intermediate feature representations. This implicit state sequence is then fused with the preliminary decision results to generate enhanced decision data incorporating historical states. Based on the content type of the enhanced decision data and preset subscription relationships, a list of downstream nodes that need to receive the enhanced decision data is dynamically selected. The link quality matrix and downstream node load vectors are obtained in real-time from the network status monitoring service. Combining the link quality matrix and downstream node load vectors, a distribution configuration scheme, including transmission path, priority, and data encapsulation format, is calculated for each node in the downstream node list. Based on the calculated distribution configuration scheme, the enhanced decision data is distributed to the corresponding nodes in the downstream node list.
[0020] In one embodiment of the present invention, the raw sensor data stream is processed to form a data packet to be computed. The raw sensor data stream comes from a terminal device such as a temperature sensor or a motion detector. Identifying high-value data segments in the raw sensor data stream that are related to a preset task involves configuring multiple task modes. In a smart home monitoring scenario, the task modes include an intrusion detection mode and an environmental anomaly mode. The data feature trigger template corresponding to the intrusion detection mode emphasizes motion frequency and signal strength features, while the data feature trigger template corresponding to the environmental anomaly mode emphasizes temperature gradient or humidity change features. Data comparison shows that when an intrusion event occurs, the matching degree between the feature vector of the raw sensor data stream of the motion sensor and the intrusion detection template increases from 0.3 to 0.9, while the matching degree of the temperature sensor data increases from 0.4 to 0.85 when the environment is abnormal. In some embodiments, the original sensing data stream is segmented into continuous data slices using a sliding window. The sliding window length is set to 100 milliseconds, and adjacent data slices overlap by 50 milliseconds. Feature vectors of each data slice are extracted in the time and frequency domains. In the time domain, the mean, variance, and peak value are extracted, and in the frequency domain, the dominant frequency component and energy distribution are extracted using a fast Fourier transform. The feature vectors are represented as follows:
[0021] in: It is a time-domain feature vector. These are frequency domain feature vectors. Data comparison shows that the feature vectors of high-value data segments are significantly higher than those of non-high-value data segments in terms of time domain variance and frequency domain energy.
[0022] In practice, the feature vector is compared with the data feature trigger templates corresponding to all task modes to calculate similarity. Cosine similarity is used as the matching metric for the feature vector of a data slice. A data feature trigger template The similarity matching calculation is defined by the following formula:
[0023] in: Representing the eigenvector With template Similarity between them It is the feature vector of the data slice. It is a task mode Corresponding data feature trigger template, symbol This represents the dot product operation of vectors. and Representing vectors respectively and Euclidean norm, in data comparison, intrusion detection template Similarity to motion data slices A value exceeding 0.8 is marked as a high-value data segment, while the similarity to the environmental anomaly template is... The value is below 0.5. This is understandable; the dynamic threshold is adaptively adjusted based on historical matching results. The initial dynamic threshold is set to 0.8. When the matching degree between the feature vector of a data slice and any data feature trigger template exceeds the dynamic threshold, the data slice is marked as a high-value data segment. The dynamic threshold is updated based on the mean and standard deviation of recent matching degrees; for example, the threshold is updated to the mean plus one standard deviation.
[0024] In practice, data slices with a matching degree exceeding a dynamic threshold are pruned and appended with metadata headers. These metadata headers contain the original time range, data source identifier, and matching task mode. The original time range records the start and end timestamps of the data slice within the original sensor data stream. The data source identifier indicates the terminal device number, and the matching task mode records the task mode type that triggered the high-value marker. Optionally, the data cleaning steps include removing noise points and invalid values from the original sensor data stream, timestamp alignment synchronizing data from different terminal devices to a unified time base, format standardization converting the data into floating-point arrays, and a comparison before and after data cleaning. Noise removal makes feature vector calculation more stable. Essentially, the identified high-value data segments, after preprocessing, form a data package to be calculated. The structure of this data package includes a metadata header and a standardized data body. The standardized data body contains the content of the high-value data segments after data cleaning, timestamp alignment, and format standardization. In some embodiments, the data feature trigger template is generated through machine learning training. The training data comes from historical high-value data segments, and the template update cycle is 24 hours. Similarity matching calculation is performed in parallel to improve processing speed. Optionally, the sliding window segmentation parameters are dynamically configured according to the characteristics of the data stream. In specific implementations, the original sensor data stream comes from multiple terminal devices, and the high-value data segment identification process is carried out independently. The original sensor data stream of each terminal device corresponds to a processing instance. Data comparison shows that the dynamically configured sliding window length ranges from 50 milliseconds to 200 milliseconds to adapt to different data rates.
[0025] In one embodiment of the present invention, an edge inference computing engine is used to perform real-time inference computing on the data packet to be computed. In an example scenario of smart home intrusion detection, the data packet to be computed carries an "intrusion detection" task mode label. (See also...) Figure 2The system loads corresponding pre-trained model weights from a local model library. This library stores pre-trained models for different tasks, such as convolutional neural network model weight files for image recognition. Data comparison shows that loading model weights optimized for intrusion detection, compared to loading general object detection model weights, results in a 25% higher confidence level for classifying moving objects under the same input. The data content from the data packet to be calculated is input into the pre-trained model with the loaded weights. The data content is a pre-processed video frame sequence. Forward propagation is performed, including convolution, pooling, and fully connected operations. The final output layer's logical value is obtained. This logical value is a multi-dimensional vector representing the probability of belonging to categories such as "personnel intrusion," "pet activity," or "no anomaly." This logical value is mapped to a specific operation command through a decision function. For example, when the probability of the "personnel intrusion" category exceeds 0.9, the decision function outputs the command "trigger alarm," forming a preliminary decision result. It is understandable that while generating preliminary decision results, the feature map outputs of one or more layers in the pre-trained model are captured. The intermediate layer is selected as the output of the last convolutional layer. The feature map output is a three-dimensional tensor. The feature map output is flattened and dimensionality reduced. The flattening operation unfolds the three-dimensional tensor into a one-dimensional vector. The dimensionality reduction operation maps the high-dimensional vector to the low-dimensional space through a preset projection matrix to form an intermediate feature representation. The intermediate feature representation is a 256-dimensional floating-point vector. Data comparison shows that the intermediate feature representation generated using the intermediate layer feature map can retain more dynamic information in the subsequent inversion task than using the original input data directly.
[0026] In practical implementation, the running state inversion algorithm model infers the hidden state sequence of the terminal device at historical moments based on intermediate feature representations. A recurrent generative network (RBN) is constructed as the main structure of the state inversion algorithm model. The RBN adopts an encoder-decoder architecture, where the encoder is a gated recurrent unit network (RON) and the decoder is another gated RRN network. The intermediate feature representation at the current moment is input into the encoder of the RBN. The gated RRN network of the encoder encodes the input intermediate feature representation to obtain the hidden state encoding at the current moment, which is a fixed-dimensional context vector. Starting from the hidden state encoding at the current moment, the decoder part of the RBN is driven to perform reverse temporal iteration. Reverse temporal iteration means that the decoder recursively extrapolates from the current moment to historical moments. In each iteration, the decoder infers the hidden state of an earlier historical moment based on the hidden state predicted at the previous historical moment. The hidden state describes the simplified internal state of the device at the corresponding moment, such as the speed and direction of movement. The inference process is described by the following formula:
[0027] in: Indicating a historical moment The inferred implicit state Indicates a historical moment closer to the present. The predicted hidden states, This represents the hidden state code at the current moment. The parameters represent the gated recurrent unit network of the decoder. This represents the decoder's state transition function, and this process is repeated until a preset inversion time window length of 10 time steps is covered. The historical latent states inferred from all iterations are then arranged in reverse chronological order, i.e., from... arrive The hidden states are arranged to form a sequence of 10 hidden state vectors.
[0028] In some embodiments, the hidden state sequence is fused with the preliminary decision results to generate enhanced decision data incorporating historical states. Attention weights are calculated on the hidden state sequence, comparing the current hidden state encoding with each historical hidden state in the sequence to assess the importance of hidden states at different historical moments to the current decision. This comparison operation is implemented through a trainable feedforward network, outputting a scalar weight. Data comparison shows that in scenarios where people are wandering, the sum of attention weights obtained from the hidden states at the three most recent historical moments exceeds 0.7. Based on the calculated attention weights, the hidden state sequence is weighted and summed. The weights are used to scale each vector in the hidden state sequence before summing to obtain a comprehensive historical state representation, which is a vector with the same dimension as a single hidden state. It can be understood that the comprehensive historical state representation is concatenated with the vector representation corresponding to the preliminary decision result. The vector representation corresponding to the preliminary decision result is the logistic value vector before the decision function mapping. The concatenation operation connects the two vectors along the feature dimension to form a fused feature vector. The dimension of the fused feature vector is the sum of the dimension of the comprehensive historical state representation and the dimension of the logistic value vector. The fused feature vector is then subjected to nonlinear transformation and dimension adjustment through a fully connected network. The fully connected network contains two hidden layers and uses the ReLU activation function, ultimately outputting structured enhanced decision data. The enhanced decision data is a data structure containing "enhanced decision instruction" and "historical state summary" fields. Optionally, in the environmental anomaly monitoring example, the intermediate feature representation comes from the temperature prediction model. The inverted hidden state sequence reflects the historical temperature change trend. After being fused with the preliminary "high temperature warning" decision, the enhanced decision data can distinguish between sudden high temperatures and continuous temperature rises.
[0029] In one embodiment of the present invention, based on the content type of the enhanced decision data and the preset subscription relationship, a list of downstream nodes that need to receive the enhanced decision data is dynamically filtered. In an example scenario of smart park management, the enhanced decision data includes two content types: "security alarm" and "energy efficiency optimization". The metadata header of the enhanced decision data is parsed. The metadata header is a structured field in the header of the data packet, and its content type tag is obtained. The content type tag is stored in the form of an enumeration value. For example, the value 1 represents "security alarm" and the value 2 represents "energy efficiency optimization". Data comparison shows that the content type tag of the metadata header of enhanced decision data generated by video analysis is "security alarm", while the content type tag of enhanced decision data generated by air conditioning sensor data is "energy efficiency optimization". The subscription configuration table maintained locally is queried. The subscription configuration table exists in the form of a database table or configuration file and records the downstream node identifier, node network address and its subscribed content type list. The subscription configuration table records the content types subscribed to by different downstream nodes. For example, the central console subscribes to "security alarm" and "energy efficiency optimization", the mobile terminal only subscribes to "security alarm", and the data analysis server subscribes to "energy efficiency optimization".
[0030] In some embodiments, the content type tag of the enhanced decision data is compared with records in the subscription configuration table. The comparison process involves traversing each record in the subscription configuration table, checking whether the content type tag is included in the content type list subscribed to by that record node, and filtering out all downstream nodes that have subscribed to the content type indicated by the content type tag to form an initial candidate node set. Data comparison shows that for enhanced decision data with the content type tag "security alarm", the central console and mobile terminals are added to the initial candidate node set after comparison, while for the "energy efficiency optimization" type, the central console and data analysis server are selected. It can be understood that, according to the preset node capability filtering rules, downstream nodes that do not have the ability to process the current enhanced decision data format or protocol are removed from the initial candidate node set. The node capability filtering rules define the minimum set of data formats or communication protocol versions that a node needs to support. For example, the rules require that the node must support the Protocol Buffers serialization format or the MQTT 5.0 protocol. In practice, for each node in the initial candidate node set, its capability description file is queried. This capability description file is provided during node registration. The predefined encapsulation format and protocol requirements of the enhanced decision data are compared with the node's capability description file to calculate the matching degree. The matching degree calculation formula is as follows: in: This indicates the overall degree of matching between node capabilities and data requirements. This indicates the total number of formats and protocol types considered. Indicates the node pair of the first Support for a particular format or protocol (1 for supported, 0 for unsupported). This indicates that the current augmented decision data is relevant to the first... The format or protocol requirement (1 for required, 0 for not required). It is a comparison function, when and Returns 1 if the condition is met, otherwise returns 0. It is the first The preset weights required by the format or protocol. When the matching degree... When the value falls below a preset threshold of 0.8, the node is considered to lack processing capability and is removed from the initial candidate node set, resulting in a downstream node list. Data comparison shows that a mobile terminal that only supports JSON format has a lower matching degree when faced with enhanced decision data requiring Protocol Buffers format. The value is 0, therefore it is removed.
[0031] Optionally, the subscription configuration table supports dynamic updates. New downstream nodes can add subscription relationships through registration requests, and existing nodes can modify their list of subscribed content types through update requests. In some embodiments, in addition to checking the format and protocol, the node capability filtering rules also check whether the node is currently in maintenance or overload state. Nodes in these states will be filtered out even if they have subscribed to content types. It can be understood that parsing the metadata header, querying the subscription configuration table, comparing and filtering, and capability filtering are pipeline operations performed sequentially. The final downstream node list is a data structure containing qualified node identifiers and network addresses. In specific implementations, the generation of the downstream node list for the same augmentation decision data is real-time and dynamic because the subscription configuration table or node capabilities may change. Data comparison shows that after a node's mobile terminal goes offline, its status is marked as inactive in the subscription configuration table, and subsequent filtering for "security alarms" will no longer include the mobile terminal. Optionally, content type tags can have a hierarchical structure, such as "security alerts.intrusion detection". The subscription relationship in the subscription configuration table supports wildcard matching, allowing downstream nodes to subscribe to all subtypes under a certain category, and enhancing the ability for content type tags of decision data to successfully match wildcard entries in the subscription configuration table.
[0032] See Figure 3This is a comparison chart of the number of nodes before and after filtering for different content types. It shows the change in the number of downstream nodes of the edge computing smart gateway before and after filtering for different content types, intuitively reflecting the effect of subscription matching and capability filtering. The initial candidate set contains 3 subscription nodes, and 2 remain after capability filtering. This indicates that 1 node was removed due to protocol / format mismatch or abnormal status, which conforms to the project's rule of "removing nodes with a matching degree below 0.8". The number of nodes before and after filtering is 3, with no change. This indicates that all nodes subscribed to this type meet the protocol / format requirements and are in normal status, requiring no filtering. The filtering process has played a precise role in tailoring the distribution nodes for "security alarm" data, avoiding sending data to nodes that do not have the processing capabilities. For "energy efficiency optimization" data, complete distribution is maintained, ensuring full coverage of subscription nodes.
[0033] In one embodiment of the present invention, the link quality matrix and downstream node load vector at the current moment are obtained in real time from the network status monitoring service. In the example scenario of a smart factory, the downstream nodes include a "control console", an "analysis server", and a "mobile terminal". The network status monitoring service is an independent background process that periodically sends probe packets to routers and downstream nodes in the network. The probe packets are lightweight Internet Control Message Protocol echo request packets, and the sending period is 1 second. The round-trip time, packet loss rate, and throughput information of the probe packets are collected. The round-trip time is calculated by recording the time difference between sending a request and receiving a reply. The packet loss rate is calculated by counting the number of packets sent and received. The throughput is calculated by measuring the amount of data successfully transmitted within a fixed time window. Based on the collected information, a matrix is constructed with the smart gateway and downstream nodes as row and column indices. The row index of the matrix is the smart gateway, and the column index is the downstream node identifier. The matrix element values represent the quality score of the corresponding link. The quality score is calculated by weighting three indicators: round-trip time, packet loss rate, and throughput, forming a link quality matrix. Data comparison shows that when the network is congested, the round-trip time of the link from the smart gateway to the "analysis server" increases from 20 milliseconds to 150 milliseconds, and the corresponding link quality score decreases from 0.95 to 0.60.
[0034] In some embodiments, status query requests are simultaneously sent to nodes in the downstream node list. These requests utilize a Simple Network Management Protocol (SMMP) query or a Remote Procedure Call (RPC). The system receives and parses the CPU utilization, memory usage, and network queue length information returned by each node. CPU utilization is expressed as a percentage, memory usage is expressed as the ratio of used memory to total memory, and the network queue length is expressed as the number of data packets currently awaiting transmission. The received and parsed CPU utilization, memory usage, and network queue length information are normalized and combined into a multi-dimensional vector. Normalization scales each original indicator value to the [0,1] interval, forming a downstream node load vector. Each dimension of the downstream node load vector corresponds to the normalized load value of a downstream node. For example, in a specific implementation, the data returned from a query, after parsing and normalization, is shown in Table 1, which contains the node load information.
[0035] Table 1: Node Load Information Table
[0036] In practical implementation, combining the link quality matrix and downstream node load vectors, a distribution configuration scheme including transmission path, priority, and data encapsulation format is calculated for each node in the downstream node list. For each node in the downstream node list, such as the "analysis server," the direct link quality score from the smart gateway to the "analysis server" is extracted from the link quality matrix, along with the comprehensive quality score of all potential paths to the "analysis server" through other nodes. Other nodes include the "console," and the potential path is "smart gateway -> console -> analysis server." Its comprehensive quality score is the minimum of the link quality scores of the two segments on the path. The current load index of the current node is extracted from the downstream node load vector; the current load index is the node's normalized load value. An optimization objective function is established, aiming to maximize the timeliness and reliability score of the finally delivered data while minimizing the impact on high-load nodes. The optimization objective function is defined as follows: in: Indicates the candidate path and destination node The optimization target value, Representing a path The timeliness score is obtained by normalizing the inverse of the end-to-end delay of the path. Representing a path The reliability score is obtained by normalizing the inverse of the packet loss rate of the path. Indicates the destination node Current load metrics These are preset positive weighting coefficients used to balance the relative importance of timeliness, reliability, and load impact. It can be understood that, taking the quality score of the direct link, the comprehensive quality score of potential paths, and the current load metric of the node as input, the optimization objective function is solved. The solution process involves calculating the optimization objective value for each candidate path (including direct links and all feasible transit paths) from the smart gateway to the target node. And choose to make The candidate path with the highest value is selected as the transmission path. The solution includes the selected transmission path, the transmission priority of node data, and the data encapsulation format adopted to adapt to the selected path, which together constitute the node distribution configuration scheme. Data comparison shows that for the high-load "analysis server" (load 0.87), even if its direct link quality score (0.60) is acceptable, the optimization objective function may prefer to choose a path with a lower load ("console" load 0.52) via "console", because this choice can reduce the direct impact on the high-load node "analysis server", thereby obtaining a higher overall optimization objective value. .
[0037] Optionally, the choice of data encapsulation format depends on the characteristics of the selected transmission path. When the path involves low-bandwidth links, an encapsulation format with a high compression ratio is selected; when the path has extremely high real-time requirements, an encapsulation format with low header overhead is selected. In some embodiments, the sending priority of node data is positively correlated with the urgency of the content type of the enhanced decision data and negatively adjusted by the node's current load indicators. For example, "safety alarm" type data has a higher sending priority than "energy efficiency report" type data, but the priority of "safety alarms" sent to high-load nodes will be appropriately reduced. It can be understood that the weight coefficients in the optimization objective function... It can be dynamically adjusted according to network policies, increasing bandwidth efficiency during bandwidth-sensitive periods. Weighting increases during periods of pursuing stability. Weighting. In practice, the overall quality score calculation for potential paths takes into account the processing and forwarding latency of the relay nodes themselves, which is estimated from historical data from the network status monitoring service.
[0038] See Figure 4This is a node load vector analysis chart used to assess the load status of downstream nodes of the smart gateway. The analysis server's CPU utilization (85%), memory usage (75%), and network queue length (120 packets) are all high, with a normalized load value of 0.88, indicating a high-load node. Its priority should be reduced or it should be avoided as a relay node during data distribution. The console's indicators are at a medium level, with a normalized load value of 0.52, classifying it as a medium-load node, capable of normal data distribution. The mobile terminal's indicators are all low, with a normalized load value of only 0.25, classifying it as a low-load node, suitable for priority distribution or relay. The normalized load value integrates CPU, memory, and network queue metrics into a single score, intuitively reflecting the overall node load and providing a quantitative basis for data distribution path selection and priority allocation. The high load value of the analysis server suggests a potential processing bottleneck; high-priority data should be avoided when configuring it for distribution.
[0039] In one embodiment of the present invention, according to the calculated distribution configuration scheme, enhanced decision data is distributed to corresponding nodes in the downstream node list. In an example scenario of smart park security, the enhanced decision data includes "personnel intrusion alarm," and the downstream node list includes "central control console" and "security mobile terminal." The distribution configuration scheme specifies that the "central control console" uses high priority and sends ProtocolBuffers format data through a direct link, while the "security mobile terminal" uses medium priority and sends JSON format data through an edge server relay. According to the data encapsulation format specified in the distribution configuration scheme, the enhanced decision data is serialized and encapsulated to form transmission data units. For ProtocolBuffers format, a pre-compiled .proto structure definition is used for serialization and a custom protocol header is added. For JSON format, the data is converted to a string and a standard HTTP header is added to form transmission data units. Based on the sending priority set for different nodes in the distribution configuration scheme, the transmission data units to be sent are sorted and placed into different sending queues. The sending queues are divided into high, medium, and low priority queues. Data comparison shows that the "central control console" data units in the high-priority queue are processed first, and their queuing time is reduced by an average of 80% compared to the data units in the medium-priority queue.
[0040] In some embodiments, a sending thread is scheduled to process each transmitted data unit sequentially according to the priority order of the sending queue. The sending thread continuously checks the high-priority queue, and only processes the data units in the medium-priority queue when the high-priority queue is empty. For each transmitted data unit, based on the transmission path specified in its distribution configuration scheme, it is selected whether to send via a direct link or route to a relay node for relay forwarding. For the "Central Control Console" data unit specified for a direct link, the sending thread directly sends the data to the IP address and port of the "Central Control Console" via a TCP socket. For the "Security Mobile Terminal" data unit specified for relaying via an edge server, the sending thread sends the data to the specified relay service interface of the edge server, along with the final destination address information. After sending to all nodes in the downstream node list, a log of this distribution is recorded. The log entries include timestamp, target node, path used, encapsulation format, priority, data size, and sending status. Data comparison shows that the success rate of sending to the "Central Control Console" via a direct link is 99.5%, while the success rate of relaying to the "Security Mobile Terminal" via an edge server is 98.2%, with the latter slightly lower due to the additional hop in forwarding.
[0041] Understandably, the method also includes an adaptive optimization step after the initial distribution. This involves collecting the actual transmission performance metrics of each link and the reception acknowledgment status of downstream nodes during the distribution process. The actual transmission performance metrics include the end-to-end latency extracted from the sending thread record and the packet loss rate extracted from the receiver's acknowledgment packet. The reception acknowledgment status of the downstream node is the acknowledgment message sent back by the node after successful reception. The actual transmission performance metrics are compared with the performance metrics predicted based on the link quality matrix before distribution, and the prediction error is calculated. The calculation formula is:
[0042] in: This represents the average prediction error of this distribution batch over a single link. This indicates the number of data packets sent in this batch. Indicates the first before distribution The predicted value of the transmission delay of each data packet. Indicates the first The actual transmission delay measurement value of each data packet, the summation symbol indicates summation over all data packets in the batch, and the absolute value symbol indicates taking the absolute value of the difference between the predicted value and the actual value. If the prediction error continues to exceed the tolerance threshold, it triggers adjustments to the parameters of the probing algorithm in the network status monitoring service, or updates the link quality assessment model, for example, the average prediction error over three consecutive monitoring periods. If all exceed the tolerance threshold of 20 milliseconds, adjust the sending frequency of probe data packets from 1 second to 500 milliseconds, or update the weighting coefficients of latency and packet loss rate in the link quality assessment model.
[0043] Optionally, based on the reception confirmation status of downstream nodes, the activity status and capability rating of nodes in the subscription configuration table are updated. If a node fails to return reception confirmation multiple times consecutively, its activity status is marked as "offline" in the subscription configuration table. If the confirmation message returned by a node contains its processing delay information, this information is used to update the processing capability rating of that node in the subscription configuration table. In some embodiments, the adjusted parameters, model, and updated subscription configuration table are used for the decision-making process of subsequent data distribution. In a subsequent distribution of enhanced decision data for "device fault warning," the network status monitoring service uses an updated probe frequency, the link quality matrix is updated faster, and since the "security mobile terminal" has been marked as "offline," this node will no longer be included in the downstream node list. It can be understood that the calculation of prediction error and threshold comparison are performed periodically, and the logs of each distribution provide input data for adaptive optimization. Adjusting the probe parameters and updating the node status are mechanisms for dynamically adapting to changes in the network and nodes. In specific implementations, updating the link quality assessment model may involve retraining a regression model for mapping from probe indicators to quality scores. The training data consists of historical probe indicators and corresponding actual transmission performance indicators.
[0044] See Figure 5 This is a line chart analyzing prediction error, showing the trend of link performance prediction error over time after data distribution by the smart gateway, and comparing it with a preset tolerance threshold. It is a core monitoring indicator in the adaptive optimization phase. From period 1 to period 3, the prediction error continuously increases, reaching a peak of 25ms in period 3, exceeding the 20ms tolerance threshold for two consecutive periods. From period 3 to period 5, the prediction error decreases rapidly, falling back to 18ms in period 4 and further decreasing to 10ms in period 5, returning to a lower level. The consecutive exceedances of the threshold in periods 2 and 3 indicate that the system has triggered the optimization process, adjusting the prediction model / probing strategy, which directly led to a significant decrease in errors in periods 4 and 5. The error levels in periods 4 and 5 are far below the threshold, proving that this adaptive optimization effectively improved prediction accuracy, making the link quality assessment closer to actual transmission performance.
[0045] The above embodiments are only used to illustrate the technical methods of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical methods of the present invention without departing from the spirit and scope of the technical methods of the present invention.
Claims
1. An edge-computing-based intelligent gateway data distribution method, characterized in that, include: Receive raw sensor data streams from one or more terminal devices, process the raw sensor data streams to form a data packet to be computed, and load the data packet to be computed into an edge inference computing engine built based on a pre-trained model; Using the edge inference computing engine, real-time inference computing is performed on the data packet to be computed, generating preliminary decision results and intermediate feature representations; The preliminary decision results and the intermediate feature representations are input together into the state inversion algorithm model; The state inversion algorithm model is run to inversely deduce the hidden state sequence of the terminal device at historical moments based on the intermediate feature representation, and the hidden state sequence is fused with the preliminary decision results to generate enhanced decision data that incorporates historical states. Based on the content type of the enhanced decision data and the preset subscription relationship, a list of downstream nodes that need to receive the enhanced decision data is dynamically filtered out. The link quality matrix and downstream node load vector are obtained in real time from the network status monitoring service. Combining the link quality matrix and the downstream node load vector, a distribution configuration scheme including transmission path, priority and data encapsulation format is calculated for each node in the downstream node list; Based on the calculated distribution configuration scheme, the enhanced decision data is distributed to the corresponding nodes in the downstream node list.
2. The edge computing based intelligent gateway data distribution method of claim 1, wherein, The raw sensor data stream is processed to form a data packet to be computed, including: Identify high-value data segments in the original sensor data stream that are related to a preset task; The identified high-value data segments are preprocessed, including data cleaning, timestamp alignment, and format standardization, to form a data package to be computed; The identification of high-value data segments related to the preset task in the original sensor data stream includes: Configure multiple task modes and set corresponding data feature trigger templates for each task mode; The original sensor data stream is divided into continuous data slices by a sliding window. Extract the feature vectors of each data slice in the time and frequency domains, and perform similarity matching calculations with the data feature trigger templates corresponding to all task modes; When the matching degree between the feature vector of a data slice and any data feature trigger template exceeds a dynamic threshold, the data slice is marked as the high-value data segment; All marked high-value data segments are cut from their original time-series locations, and a metadata header containing the original time range, data source identifier, and matching task pattern is attached to each high-value data segment.
3. The smart gateway data distribution method based on edge computing as described in claim 2, characterized in that, Using the edge inference computing engine, real-time inference computing is performed on the data packet to be computed, including: From the local model library, load the corresponding pre-trained model weights based on the task mode labels carried in the data packet to be computed; The data content in the data packet to be calculated is input into the pre-trained model loaded with weights, and forward propagation calculation is performed; Obtain the logical value of the final output layer of the pre-trained model, and map the logical value into a specific operation instruction through a decision function to form the preliminary decision result; Simultaneously, the feature map output of one or several layers in the middle of the pre-trained model is captured, and the feature map output is flattened and dimensionality reduced to form the intermediate feature representation.
4. The smart gateway data distribution method based on edge computing as described in claim 3, characterized in that, Running the state inversion algorithm model, the implicit state sequence of the terminal device at historical moments is inverted based on the intermediate feature representation, including: A recurrent generative network is constructed as the main structure of the state inversion algorithm model; The intermediate feature representation at the current time step is input into the encoder of the recurrent generative network to obtain the hidden state encoding at the current time step. Starting from the hidden state encoding at the current moment, the decoder part of the recurrent generation network is driven to perform reverse temporal iteration; In each iteration, the decoder infers the hidden state of an earlier historical moment based on the hidden state predicted in the previous historical moment, and so on until the preset inversion time window length is covered. The hidden states at all historical moments inferred from the iterative steps are arranged in reverse chronological order to form the hidden state sequence.
5. The smart gateway data distribution method based on edge computing as described in claim 4, characterized in that, The implicit state sequence is fused with the preliminary decision results to generate enhanced decision data that incorporates historical states, including: Attention weights are calculated on the sequence of hidden states to evaluate the importance of hidden states at different historical moments to the current decision. Based on the calculated attention weights, the hidden state sequence is weighted and summed to obtain a comprehensive historical state representation. The comprehensive historical state representation is concatenated with the vector representation corresponding to the preliminary decision result to form a fused feature vector; The fused feature vectors are then subjected to nonlinear transformation and dimensional adjustment through a fully connected network, ultimately outputting structured enhanced decision data.
6. The smart gateway data distribution method based on edge computing as described in claim 5, characterized in that, Based on the content type of the enhanced decision data and the preset subscription relationship, a list of downstream nodes that need to receive the enhanced decision data is dynamically filtered, including: Parse the metadata header of the enhanced decision-making data to obtain its content type tags; Query the locally maintained subscription configuration table, which records the content types subscribed to by different downstream nodes; The content type tags of the enhanced decision data are compared with the records in the subscription configuration table to filter out all downstream nodes that have subscribed to the content type indicated by the content type tag, forming an initial candidate node set; According to the preset node capability filtering rules, downstream nodes that do not have the ability to process the current enhanced decision data format or protocol are removed from the initial candidate node set, resulting in the downstream node list.
7. The smart gateway data distribution method based on edge computing as described in claim 6, characterized in that, The step of obtaining the link quality matrix and downstream node load vector in real time from the network status monitoring service includes: Periodically send probe packets to routers and downstream nodes in the network; Collect round-trip time, packet loss rate, and throughput information of the probe data packets; Based on the collected information, a matrix is constructed with smart gateways and downstream nodes as row and column indices. The matrix element values represent the quality scores of the corresponding links, forming the link quality matrix. Simultaneously, a status query request is sent to the nodes in the downstream node list, and the CPU utilization, memory usage and network queue length information returned by each node are received and parsed. The received and parsed information on CPU utilization, memory usage, and network queue length is normalized and combined into a multi-dimensional vector to form the downstream node load vector.
8. The smart gateway data distribution method based on edge computing as described in claim 7, characterized in that, Combining the link quality matrix and the downstream node load vector, a distribution configuration scheme, including transmission path, priority, and data encapsulation format, is calculated for each node in the downstream node list, including: For each node in the downstream node list, extract the direct link quality score from the smart gateway to the current node from the link quality matrix, as well as the comprehensive quality score of all potential paths that pass through other nodes to the current node. Extract the current load metric of the current node from the load vector of the downstream node; An optimization objective function is established, which aims to maximize the timeliness and reliability score of the final delivered data while minimizing the impact on high-load nodes. The optimization objective function is solved by taking the direct link quality score, the comprehensive quality score of potential paths, and the current load index of the node as inputs. The solution results include the selected transmission path, the transmission priority of node data, and the data encapsulation format adopted to adapt to the selected path, which together constitute the distribution configuration scheme of the node.
9. The smart gateway data distribution method based on edge computing as described in claim 8, characterized in that, The step of distributing the enhanced decision data to the corresponding nodes in the downstream node list according to the calculated distribution configuration scheme includes: According to the data encapsulation format specified in the distribution configuration scheme, the enhanced decision data is serialized and encapsulated to form transmission data units; Based on the sending priority set for different nodes in the distribution configuration scheme, the data units to be sent are sorted and placed into different sending queues; The sending thread is scheduled to process each data unit in turn according to the priority order of the sending queue. For each data transmission unit, based on the transmission path specified in its distribution configuration scheme, it is selected whether to send it via a direct link or to route it to a relay node for relay forwarding; After sending the message to all nodes in the downstream node list, log the distribution.
10. The smart gateway data distribution method based on edge computing as described in claim 9, characterized in that, It also includes an adaptive optimization step after the initial distribution: Collect the actual transmission performance indicators of each link and the reception confirmation status of downstream nodes during this distribution process; The actual transmission performance metrics are compared with the performance metrics predicted based on the link quality matrix before distribution, and the prediction error is calculated. If the prediction error continues to exceed the tolerance threshold, it will trigger the adjustment of the parameters of the detection algorithm in the network status monitoring service or the update of the link quality assessment model. At the same time, based on the receipt confirmation status of downstream nodes, update the activity status and capability rating of nodes in the subscription configuration table; The adjusted parameters, model, and updated subscription configuration table are used in the subsequent data distribution decision-making process.