An Internet of Things gateway data processing method based on edge computing
By deploying intelligent sensing nodes and edge gateways in IoT gateways, combining distributed computing frameworks, encryption processing, adaptive compression and distributed AI training frameworks, the problem of inefficient data security and resource allocation in edge computing is solved, and efficient and secure IoT gateway data processing is achieved.
Patent Information
- Application Number
- CN202510388844.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-31
- Publication Date
- 2025-06-20
- Estimated Expiration
- 2045-03-31
AI Technical Summary
The existing edge computing solutions have shortcomings in data security, computing resource allocation and data compression, and are difficult to meet the requirements of real-time and low latency.
By deploying sensors of smart sensing nodes, the edge gateway is connected to the sensor, and the IoT gateway data is collected in real time using the MQTT protocol and perform preliminary processing. Based on gateway data, we select to use a distributed computing framework to allocate computing tasks among multiple edge gateways, and encrypt the allocated gateway data. The encrypted data is compressed, a compressed packet is formed and uploaded to the cloud server, and the data changes in the edge gateway are monitored in combination with the HTTPS protocol, and the global view is updated and optimization measures are generated using the distributed AI training framework.
It significantly improves data security, optimizes the allocation of computing resources, reduces data transmission volume and storage costs, reduces the storage pressure of cloud servers, and improves response speed and service quality.
Smart Images

Figure CN119892528B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of Internet of Things gateways, and particularly to a method for processing Internet of Things gateway data based on edge computing. Background Art
[0002] With the rapid development of Internet of Things (IoT) technology, more and more devices and sensors are deployed in various fields, such as smart homes, industrial automation, and smart cities. A large amount of data generated by these devices needs to be collected, processed, and transmitted through gateways. The traditional centralized cloud computing model is difficult to meet the requirements of real-time and low latency due to network latency and bandwidth limitations. Edge computing, as an emerging computing paradigm, can distribute computing resources and storage capabilities to locations close to data sources, significantly reducing data transmission latency and improving response speed. However, existing edge computing solutions still have deficiencies in aspects such as data security, computing resource allocation, and data compression. For example, existing methods usually rely on simple encryption algorithms and cannot provide high-intensity data security; in addition, the task allocation strategy between multiple edge gateways is not flexible enough, resulting in low resource utilization efficiency. Summary of the Invention
[0003] In view of the above existing problems, the present invention is proposed.
[0004] Therefore, the present invention provides a method for processing Internet of Things gateway data based on edge computing to solve the problems of improving data security and resource allocation efficiency in edge computing.
[0005] To solve the above technical problems, the present invention provides the following technical solutions:
[0006] In a first aspect, the present invention provides a method for processing Internet of Things gateway data based on edge computing, which includes,
[0007] Deploy sensors of intelligent sensing nodes, connect an edge gateway to the sensors, and collect Internet of Things gateway data in real time through the MQTT protocol and perform preliminary processing to obtain gateway data;
[0008] Based on the gateway data, calculate a risk score, evaluate the risk level, and according to the evaluation result, select to use a distributed computing framework to allocate computing tasks between multiple edge gateways and perform encryption processing on the allocated gateway data to obtain encrypted data;
[0009] Compress the encrypted data to form a compressed package and upload it to a cloud server, and the cloud server aggregates the compressed packages received from multiple edge gateways to form a global view;
[0010] Monitor the data changes of the edge gateway through the HTTPS protocol, update the global view in combination with the distributed AI training framework, and generate and execute optimization measures according to the monitoring results.
[0011] As a preferred solution of the method for processing data of the Internet of Things gateway based on edge computing according to the present invention, wherein: the sensors include a temperature sensor, a humidity sensor, and a GPS positioning device;
[0012] The data of the Internet of Things gateway includes sensor readings, the number of sensors, sensor power consumption, sensor working duration, timestamps, and the number of lost sensor data.
[0013] As a preferred solution of the method for processing data of the Internet of Things gateway based on edge computing according to the present invention, wherein:
[0014] The preliminary processing includes the following steps,
[0015] Use the cyclic redundancy check algorithm to calculate the check value of the read data of the Internet of Things gateway, and send the MQTT message with the check value to the edge gateway;
[0016] When the edge gateway receives the MQTT message, extract the data of the Internet of Things gateway and the check value in the MQTT message, and verify whether the data of the Internet of Things gateway is lost;
[0017] Use the sliding window algorithm to detect duplicate data and delete the duplicate data, use the Z-score method to detect abnormal data, and use the interpolation method to fill in the abnormal data to obtain the gateway data.
[0018] As a preferred solution of the method for processing data of the Internet of Things gateway based on edge computing according to the present invention, wherein:
[0019] The risk score is calculated by the following formula,
[0020] ;
[0021] Wherein, represents the risk score, represents the number of lost sensor data, represents the total number of all sensor data sent, represents the th timestamp when the sensor data arrives at the edge gateway, represents the th timestamp when the sensor data is sent from the sensor, represents the number of sensor data, represents the index of the sensor data, represents the th power consumption of the sensor, Indicates the working duration of the nth sensor, Indicates the number of sensors, Indicates the index of the sensor, Indicates the maximum latency allowed by the edge gateway, Indicates the maximum energy consumption allowed by the edge gateway;
[0022] Set the risk threshold according to the historical risk score;
[0023] When the risk score is less than or equal to the risk threshold, it is determined that the gateway data belongs to low risk;
[0024] When the risk score is greater than the risk threshold, it is determined that the gateway data belongs to high risk.
[0025] As a preferred solution of the method for processing Internet of Things gateway data based on edge computing according to the present invention, wherein:
[0026] According to the evaluation results, select to use a distributed computing framework to allocate computing tasks among multiple edge gateways, and encrypt the allocated gateway data to obtain encrypted data, including the following steps,
[0027] When the gateway data is of low risk, collect the current resource usage of each edge gateway, calculate the resource load index of each edge gateway using the weighted average method, and allocate the gateway data to the edge gateway with the lowest resource load index for processing;
[0028] When the gateway data is of high risk, use the distributed computing framework to dynamically allocate tasks to different edge gateways according to the level of the risk score, and give priority to processing the computing tasks with high risk scores;
[0029] Use the QRNG library in Python to generate a random key, and use the generated random key to encrypt the high-risk gateway data to obtain encrypted data.
[0030] As a preferred solution of the method for processing Internet of Things gateway data based on edge computing according to the present invention, wherein:
[0031] When forming the compressed package, generate a sampling matrix based on adaptive perception, dynamically adjust the sampling matrix according to the sparsity of the compressed package, and use the adjusted sampling matrix to compress the compressed package;
[0032] The aggregation refers to merging the compressed packages from different edge gateways into a data set on the basis of being consistent in time.
[0033] As a preferred solution of the method for processing Internet of Things gateway data based on edge computing according to the present invention, wherein:
[0034] Monitor data changes of the edge gateway through the HTTPS protocol, update the global view in combination with the distributed AI training framework, and generate and execute optimization measures according to the monitoring results. The steps are as follows:
[0035] Select Horovod as the distributed AI training framework, start Horovod processes on multiple edge gateways, and configure the corresponding environment variables. Each edge gateway calculates gradients locally and synchronizes the gradients through MPI to update the global view;
[0036] Based on the monitoring results and the updated global view, define the trigger conditions and execution actions, and use the execution actions to carry out optimization measures.
[0037] In a second aspect, the present invention provides a computer device, including a memory and a processor. The memory stores a computer program, wherein: when the computer program is executed by the processor, any step of the method for processing Internet of Things gateway data based on edge computing as described in the first aspect of the present invention is implemented.
[0038] In a third aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored, wherein: when the computer program is executed by the processor, any step of the method for processing Internet of Things gateway data based on edge computing as described in the first aspect of the present invention is implemented.
[0039] The beneficial effects of the present invention are as follows: Through the quantum random number generator technology, high-strength random keys are generated for data encryption, greatly improving the data security and effectively preventing data from being leaked or tampered with in a complex network environment. Secondly, using distributed computing frameworks (such as Apache Spark, Apache Flink, and Kubernetes), tasks are dynamically assigned to the corresponding edge gateways according to the risk scores, optimizing the allocation of computing resources, not only improving the resource utilization rate but also better coping with sudden high-load situations. In addition, the adaptive compressive sensing technology is used to compress the encrypted data, significantly reducing the data transmission volume and storage cost, saving network bandwidth and reducing the storage pressure on the cloud server. Finally, due to the adoption of the edge computing architecture, the data processing process is closer to the data source, reducing the data transmission delay. Combining with the HTTPS protocol to monitor the data changes of the edge gateway and using the distributed AI model for collaborative training, automatically generating and executing optimization measures to provide a personalized service experience. In summary, through a series of innovative technical means, the present invention significantly improves data security, resource utilization rate, response speed, and service quality, providing a solid foundation and an efficient solution for edge computing applications. Description of the Drawings
[0040] To more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0041] Figure 1 It is a flowchart of the data processing method of the Internet of Things gateway based on edge computing in Embodiment 1. Specific embodiments
[0042] To make the above objects, features, and advantages of the present invention more obvious and understandable, the following will provide a detailed description of the specific embodiments of the present invention with reference to the drawings in the specification.
[0043] In the following description, many specific details are set forth to fully understand the present invention. However, the present invention can also be implemented in other ways different from those described herein. Those skilled in the art can make similar generalizations without departing from the connotation of the present invention. Therefore, the present invention is not limited by the specific embodiments disclosed below.
[0044] Secondly, the so-called "one embodiment" or "embodiment" herein refers to a specific feature, structure, or characteristic that can be included in at least one implementation manner of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment that is mutually exclusive with other embodiments.
[0045] Embodiment 1, referring to Figure 1 , is the first embodiment of the present invention. This embodiment provides a data processing method for an Internet of Things gateway based on edge computing, including the following steps:
[0046] S1. Deploy sensors of intelligent sensing nodes. The edge gateway is connected to the sensors, and the data of the Internet of Things gateway is collected in real time through the MQTT protocol and preliminarily processed to obtain gateway data, including the following steps.
[0047] S1.1. The sensors include temperature sensors, humidity sensors, and GPS positioning devices; the data of the Internet of Things gateway includes sensor readings, the number of sensors, sensor power consumption, sensor working duration, time stamps, and the number of lost sensor data.
[0048] S1.2. The intelligent sensing nodes read the data of the Internet of Things gateway at a set time interval (for example, once every 5 minutes) and encapsulate it into the MQTT (Message Queuing Telemetry Transport) message format.
[0049] It should be noted that the number and type of intelligent sensing nodes are determined, the MQTT client library is installed and configured on each intelligent sensing node to ensure communication with the edge gateway through the MQTT protocol, the MQTT broker server (such as Mosquitto, an open-source message broker) is configured, and the connection parameters (such as port number, username, password, etc.) are set to ensure security and stability;
[0050] The cyclic redundancy check algorithm is used to calculate the check value of the IoT gateway data read, and the MQTT message with the check value is sent to the edge gateway;
[0051] It should be noted that after reading data from the sensor, a check value is generated using the CRC (Cyclic Redundancy Check) algorithm. Then, the original data and the check value are packed into the MQTT message format and sent to the edge gateway through the MQTT protocol. This allows the data to be verified at the receiving end by recalculating the CRC and comparing it with the received check value to determine if data has been lost or corrupted during transmission;
[0052] When the edge gateway receives the MQTT message, the IoT gateway data and the check value in the MQTT message are extracted to verify if the IoT gateway data is lost;
[0053] Specifically, the IoT gateway data and the check value in the MQTT message are extracted, the cyclic redundancy check algorithm is used to recalculate the check value of the received IoT gateway data, and the calculated check value is compared with the check value carried in the MQTT message. If the check values are the same, the IoT gateway data has not been lost. If the check values are different, the IoT gateway data is discarded and an error log is recorded, and the sensor is required to read again;
[0054] The sliding window algorithm is used to detect duplicate data and delete the duplicate data. The Z-score method is used to detect abnormal data, and the interpolation method is used to fill in the abnormal data to obtain the gateway data.
[0055] It should be noted that by deploying sensors of intelligent sensing nodes, the edge gateway is connected to the sensors, and the IoT gateway data is collected in real time through the MQTT protocol, realizing the efficient collection and preliminary processing of data. This step ensures that sensor data (such as temperature, humidity, and GPS positioning) can be transmitted and verified in a standardized manner in real time, improving data integrity and accuracy. Using the CRC algorithm for data verification can effectively detect and correct errors during transmission, preventing data loss or corruption. Finally, this step ensures that subsequent steps can be processed based on accurate and complete data.
[0056] S2. Calculate the risk score based on the gateway data, evaluate the risk level, and according to the evaluation result, select to use a distributed computing framework to allocate computing tasks among multiple edge gateways, and encrypt the allocated gateway data to obtain encrypted data, including the following steps:
[0057] S2.1 Calculate the risk score based on the gateway data, expressed as:
[0058] ;
[0059] Where: represents the risk score; represents the number of lost sensor data; represents the total number of all sensor data sent; represents the timestamp when the th sensor data arrives at the edge gateway; represents the timestamp when the th sensor data is sent from the sensor; represents the number of sensor data; represents the index of the sensor data; represents the th sensor's power consumption; represents the th sensor's working duration; represents the number of sensors; represents the index of the sensor; represents the maximum delay allowed by the edge gateway; represents the maximum energy consumption allowed by the edge gateway;
[0060] It should be noted that: represents the proportion of data loss. When all data is lost, this value is 1; when no data is lost, this value is 0. represents the delay of each sensor data, and the delay is normalized between 0 and 1. represents the energy consumption of each sensor, and the energy consumption is normalized between 0 and 1;
[0061] Set the risk threshold according to the historical risk score;
[0062] Specifically, extract the gateway data for a period of time (such as the past 6 months), calculate the risk score for each period, plot the frequency distribution diagram or cumulative distribution function of the risk score, observe the data distribution, and set the risk threshold, and it can be set in combination with expert suggestions;
[0063] When the risk score is less than or equal to the risk threshold, it is determined that the gateway data belongs to low risk;
[0064] When the risk score is greater than the risk threshold, it is determined that the gateway data is of high risk.
[0065] S2.2. When the gateway data is of low risk, collect the current resource usage of each edge gateway, calculate the resource load index of each edge gateway using the weighted average method, and allocate the gateway data to the edge gateway with the lowest resource load index for processing;
[0066] When the gateway data is of high risk, use a distributed computing framework (Apache Spark (Apache Spark (open-source big data processing framework)), Apache Flink (Apache Flink (open-source stream processing framework)), and Kubernetes (Kubernetes (container orchestration platform))) to dynamically allocate tasks to different edge gateways according to the level of the risk score, and give priority to processing high-risk score computing tasks;
[0067] It should be noted that the characteristics of Apache Spark are that it supports large-scale data processing and has efficient in-memory computing capabilities; the applicable scenarios are suitable for scenarios that require batch processing or stream processing of a large amount of data; the characteristics of Apache Flink are that it focuses on stream processing and provides low-latency data processing capabilities; the applicable scenarios are suitable for real-time data processing and event-driven application scenarios; the characteristics of Kubernetes are that it is used for the automated deployment, scaling, and management of containerized applications; the applicable scenarios are suitable for scenarios that require flexible scheduling and management of computing resources;
[0068] S2.3. Use the QRNG library (quantum random number generator) in Python to generate a random key for data encryption, and use the generated random key to encrypt the high-risk gateway data to ensure the security of the data during transmission and storage, and obtain encrypted data.
[0069] It should be explained that by calculating the risk score, evaluating the risk level, and using a distributed computing framework to allocate computing tasks, the optimization of data security and resource utilization is achieved. This step calculates the risk score according to factors such as packet loss rate, latency, and energy consumption, and allocates tasks to appropriate edge gateways according to the score. For high-risk data, the quantum random number generator technology is used for encryption, further enhancing the security of the data. This dynamic task allocation mechanism not only improves the ability to handle sudden high loads but also protects sensitive data through efficient encryption means.
[0070] S3. Compress the encrypted data to form a compressed package and upload it to the cloud server. The cloud server aggregates the compressed packages received from multiple edge gateways to form a global view, including the following steps,
[0071] When forming a compressed package, a sampling matrix is generated based on adaptive perception, the sampling matrix is dynamically adjusted according to the sparsity of the compressed package, and the adjusted sampling matrix is used to compress the compressed package;
[0072] Specifically, using the encrypted data dimension and the desired compression ratio, a sampling matrix is generated. The sampling matrix is used to initially compress the encrypted data, and the sparsity after the initial compression is calculated by calculating the proportion of non-zero elements or using other sparsity measurement methods. According to the calculated sparsity, the sampling matrix is dynamically adjusted. If the data is very sparse, the density of the sampling matrix can be reduced; conversely, if the data is less sparse, the density of the sampling matrix needs to be increased. Adjusting the sampling matrix is achieved by changing the proportion of its non-zero elements. For example, the sparsity of the sampling matrix can be adjusted by increasing or decreasing the number of non-zero elements in the matrix, and re-compression is performed using the adjusted sampling matrix.
[0073] The compressed compressed package is saved in a file format, and the compressed package is uploaded to the cloud server using a secure transfer protocol (such as HTTPS, Hypertext Transfer Protocol Secure, Chinese full name: Hypertext Transfer Security Protocol);
[0074] The uploaded compressed package is read from the cloud storage, the compressed package is decompressed using a reconstruction algorithm, and the decompressed compressed package is decrypted using the same key to obtain the decrypted data;
[0075] The sliding window algorithm is used to detect and delete duplicate data, the Z-score method is used to detect abnormal data, and the interpolation method is used to fill in the abnormal data;
[0076] The decrypted data from different edge gateways is merged into a unified dataset, ensuring that the decrypted data of each edge gateway is consistent in time, avoiding errors caused by time offset, and generating a global view based on the aggregated decrypted data.
[0077] It should be noted that by compressing the encrypted data through adaptive compressive sensing technology and uploading it to the cloud server, the reduction of data transmission volume and the reduction of storage cost are achieved. Adaptive compressive sensing technology can dynamically adjust the sampling matrix according to the sparsity of the data, thereby achieving efficient data compression. This not only reduces the bandwidth required for data transmission but also reduces the storage pressure on the cloud server. In addition, by using the sliding window algorithm and the Z-score method to detect and process duplicate and abnormal data, the quality and consistency of the data are further improved.
[0078] S4. Monitor the data changes of the edge gateway through the HTTPS protocol, update the global view in combination with the distributed AI training framework, and generate and execute optimization measures according to the monitoring results, including the following steps,
[0079] S4.1. Select Horovod (a distributed deep learning training framework) as the distributed AI training framework. Start Horovod processes on multiple edge gateways and configure the corresponding environment variables. Each edge gateway calculates gradients locally and synchronizes gradients through MPI (Message Passing Interface), and updates the global view.
[0080] It should be noted that the reason for choosing Horovod as the distributed AI training framework is that it can efficiently calculate gradients in parallel on multiple edge gateways and synchronize gradients through MPI, thereby achieving fast and consistent global model parameter updates. At the same time, its optimized communication mechanism reduces training time and resource consumption, which is especially suitable for edge computing environments with limited resources and low latency requirements. Specifically, through its efficient multi-node and multi-GPU support and optimized AllReduce algorithm, Horovod can significantly reduce the time overhead of gradient synchronization when performing distributed training between multiple edge gateways.
[0081] S4.3. Based on the monitoring results and the updated global view, define trigger conditions and execution actions to perform optimization measures through the execution actions. The trigger condition is that when a certain metric exceeds the set threshold (such as the CPU usage rate exceeds 80%), the corresponding rule is triggered, and the execution action is to take corresponding optimization measures according to the trigger condition (such as increasing computing resources, restarting services, etc.).
[0082] Specifically, when the load of a certain edge gateway is too high, automatically allocate some tasks to other edge gateways with lower loads. Dynamically adjust the resource allocation of the gateway according to the model prediction results (such as increasing memory or the number of CPU cores). Send optimization commands (such as restarting services, adjusting resource configurations, etc.) to specific edge gateways through the central console. After the edge gateway executes the optimization command, feedback the execution result (success or failure) to the central monitoring platform and retry if necessary.
[0083] It should be noted that by monitoring the data changes of the edge gateway through the HTTPS protocol and using the distributed AI model for collaborative training, real-time monitoring and automatic optimization of the edge gateway status are achieved. This step centrally manages and displays the data from all edge gateways through the central monitoring platform, regularly pulls and decrypts data from each edge gateway, and uses the Horovod framework to calculate gradients in parallel on multiple edge gateways to quickly update the global model parameters. Based on the monitoring results and the model prediction results, define trigger conditions and execution actions to automatically adjust the resource allocation of the edge gateway.
[0084] This embodiment also provides a computer device, which is applicable to the case of the Internet of Things gateway data processing method based on edge computing, and includes: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the Internet of Things gateway data processing method based on edge computing as proposed in the above embodiment.
[0085] The computer device may be a terminal. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a carrier network, NFC (Near Field Communication), or other technologies. The display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device may be a touch layer covering the display screen, or a button, a trackball, or a touchpad provided on the outer shell of the computer device, or an external keyboard, a touchpad, or a mouse, etc.
[0086] This embodiment also provides a storage medium, on which a computer program is stored. When the program is executed by a processor, it implements the Internet of Things gateway data processing method based on edge computing as proposed in the above embodiment; the storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM for short), Electrically Erasable Programmable Read-Only Memory (EEPROM for short), Erasable Programmable Read Only Memory (EPROM for short), Programmable Red-Only Memory (PROM for short), Read-Only Memory (ROM for short), magnetic memory, flash memory, a magnetic disk, or an optical disc.
[0087] In summary, the present invention: generates high-strength random keys for data encryption through quantum random number generator technology, greatly improving data security and effectively preventing data from being leaked or tampered with in a complex network environment. Secondly, by using distributed computing frameworks (such as Apache Spark, Apache Flink, and Kubernetes), tasks are dynamically allocated to the corresponding edge gateways according to risk scores, optimizing the allocation of computing resources, not only improving resource utilization but also better coping with sudden high-load situations. In addition, the adaptive compressive sensing technology is used to compress the encrypted data, significantly reducing the data transmission volume and storage cost, saving network bandwidth and reducing the storage pressure on cloud servers. Finally, due to the adoption of the edge computing architecture, the data processing process is closer to the data source, reducing data transmission latency, and combining the HTTPS protocol to monitor data changes in the edge gateway, and using distributed AI models for collaborative training to automatically generate and execute optimization measures to provide a personalized service experience. In summary, through a series of innovative technical means, the present invention significantly improves data security, resource utilization, response speed, and service quality, providing a solid foundation and an efficient solution for edge computing applications.
[0088] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be modified or equivalently replaced without departing from the spirit and scope of the technical solutions of the present invention, and they should all be covered by the scope of the claims of the present invention.
Claims
1. A data processing method for an Internet of Things gateway based on edge computing, characterized in that: include, Deploy sensors of smart sensing nodes, connect edge gateways to sensors, collect IoT gateway data in real time through MQTT protocol, and perform preliminary processing to obtain gateway data; Based on the gateway data, the risk score is calculated and the risk level is evaluated. According to the evaluation results, the distributed computing framework is selected to distribute the computing tasks among multiple edge gateways, and the distributed gateway data is encrypted to obtain encrypted data. The risk score is calculated by the following formula: ; in, represents the risk score, Indicates the amount of lost sensor data, Indicates the total number of all sensor data sent, Indicates The timestamp of the sensor data arriving at the edge gateway, Indicates The timestamp of the sensor data when it is sent from the sensor, Indicates the amount of sensor data, represents the index of sensor data, Indicates The power consumption of each sensor, Indicates The working time of each sensor, represents the number of sensors, Indicates the index of the sensor, Indicates the maximum delay allowed by the edge gateway. Indicates the maximum energy consumption allowed by the edge gateway; Set risk thresholds based on historical risk scores; When the risk score is less than or equal to the risk threshold, the gateway data is judged to be of low risk; When the risk score is greater than the risk threshold, the gateway data is judged to be high risk; According to the evaluation results, we choose to use a distributed computing framework to distribute computing tasks among multiple edge gateways, and encrypt the distributed gateway data to obtain encrypted data, including the following steps: When the gateway data is low risk, the current resource usage of each edge gateway is collected, and the resource load index of each edge gateway is calculated using the weighted average method. The gateway data is assigned to the edge gateway with the lowest resource load index for processing; When the gateway data is high risk, the distributed computing framework is used to dynamically assign tasks to different edge gateways based on the risk score, giving priority to computing tasks with high risk scores. Use the QRNG library in Python to generate a random key, and use the generated random key to encrypt the high-risk gateway data to obtain encrypted data; Compress the encrypted data to form a compressed package and upload it to the cloud server. The cloud server aggregates the compressed packages received from multiple edge gateways to form a global view. The data changes of the edge gateway are monitored through the HTTPS protocol, the global view is updated in combination with the distributed AI training framework, and optimization measures are generated and executed based on the monitoring results.
2. The method for processing data of an Internet of Things gateway based on edge computing according to claim 1, characterized in that: The sensors include temperature sensors, humidity sensors and GPS positioning equipment; The IoT gateway data includes sensor readings, sensor quantity, sensor power consumption, sensor operating time, timestamp, and the amount of lost sensor data.
3. The method for processing data of an Internet of Things gateway based on edge computing according to claim 2, characterized in that: The preliminary processing includes the following steps: Use the cyclic redundancy check algorithm to calculate the checksum of the IoT gateway data read, and send the MQTT message with the checksum to the edge gateway; When the edge gateway receives the MQTT message, it extracts the IoT gateway data and checksum in the MQTT message to verify whether the IoT gateway data is lost; The sliding window algorithm is used to detect and delete duplicate data, the Z-score method is used to detect abnormal data, and the interpolation method is used to fill in the abnormal data to obtain the gateway data.
4. The method for processing data of an Internet of Things gateway based on edge computing according to claim 3, characterized in that: When forming a compressed packet, a sampling matrix is generated based on adaptive perception, the sampling matrix is dynamically adjusted according to the sparsity of the compressed packet, and the compressed packet is compressed using the adjusted sampling matrix; The aggregation refers to merging compressed packages from different edge gateways into a data set on the basis of maintaining consistency in time.
5. The method for processing data of an Internet of Things gateway based on edge computing according to claim 4, characterized in that: Monitor the data changes of the edge gateway through the HTTPS protocol, update the global view in combination with the distributed AI training framework, and generate and execute optimization measures based on the monitoring results, including the following steps: Horovod is selected as the distributed AI training framework. The Horovod process is started on multiple edge gateways and the corresponding environment variables are configured. Each edge gateway calculates the gradient locally and synchronizes the gradient through MPI to update the global view. Based on the monitoring results and the updated global view, define trigger conditions and execution actions, and use execution actions to perform optimization measures.
6. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the edge computing-based Internet of Things gateway data processing method described in any one of claims 1 to 5 are implemented.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the edge computing-based Internet of Things gateway data processing method described in any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Internet of Things data processing method and system based on intelligent edge gateway
CN117336137A
Medical instrument inventory intelligent allocation supervision system based on Internet of Things
CN118644182A