Data processing and cleaning method and device for Internet of Things equipment
Through distributed processing architecture and machine learning algorithms, abnormal data can be detected and corrected in real time. Combining incremental and streaming processing technologies, it solves the problem of low data cleaning efficiency of IoT devices and achieves efficient, intelligent data processing and real-time performance. .
Patent Information
- Application Number
- CN202411297234.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-18
- Publication Date
- 2024-10-22
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing technology is difficult to effectively process and clean the data generated by massive IoT devices. The processing efficiency is low and it is difficult to meet real-time requirements.
It adopts distributed processing architecture and machine learning algorithms, receives data streams through the message queue system for pre-processing, allocates cleaning tasks to processing nodes, detects and corrects abnormal data in real time, and uses incremental data cleaning and streaming processing technology to achieve near real-time of data cleaning.
It improves data processing efficiency and system scalability, improves the intelligence level of data cleaning, meets the real-time requirements for data, and reduces unnecessary repeated calculations.
Smart Images

Figure CN118819867A_ABST
Abstract
Description
Technical Field
[0001] The invention discloses a data processing and cleaning method and device for Internet of Things equipment, and relates to the technical field of Internet of Things and big data processing. Background Art
[0002] With the rapid development of IoT technology, the number of devices connected to the network is growing exponentially. The massive data generated by these devices often have problems such as noise, duplication, incompleteness or inconsistency, which affects the quality and availability of the data. Existing data cleaning methods are often unable to cope with such large-scale and complex data, with low processing efficiency and difficulty in meeting real-time requirements. In order to effectively process and clean the data from massive IoT devices, an efficient and scalable data cleaning method is urgently needed. Summary of the invention
[0003] In view of the problems of the prior art, the present invention provides a data processing and cleaning method and device for IoT devices, and the technical solution adopted is: In a first aspect, a data processing and cleaning method for an Internet of Things device is provided, the method comprising: S1, receiving a data stream from an IoT device and transmitting the data through a message queue system; and preprocessing the data stream; S2, according to the pre-processed data stream, the data cleaning task is assigned to the corresponding processing node through the distributed processing architecture and processed; S3, according to the processing node, by loading the anomaly detection model, real-time detection is performed on the incoming data, and abnormal data is automatically identified and processed; and correction and replacement are performed according to the type of the abnormal data, and the abnormal data that cannot be corrected is marked; S4, based on the real-time detection results of the data, the newly added and changed data are processed through incremental data cleaning; S5: Based on the data cleaning results, data flow management is performed through stream processing.
[0004] In some implementations, the distributed processing architecture includes a distributed computing framework, a node manager, a distributed file system, and a load balancing algorithm; S2 specifically includes: S21, managing the processing nodes according to a distributed computing framework; S22, monitoring the status of the processing node, assigning tasks and adjusting the node according to the node manager; S23, splitting the data cleaning task into multiple subtasks, assigning each subtask to the corresponding processing node, and storing the data through a distributed file system; S24, performing load balancing processing according to the processing nodes through a load balancing algorithm; and performing real-time task allocation according to the processing capabilities and current load conditions of the processing nodes.
[0005] In some implementations, in S3, the anomaly detection model is implemented by a machine learning algorithm, specifically including: S31, collect historical data and mark abnormal data and normal data; S32, performing model training by using a random forest algorithm according to the abnormal data and the normal data to obtain an abnormality detection model; S33, deploying the anomaly detection model to each of the processing nodes.
[0006] In some implementations, the S4 specifically includes: S41, based on the real-time detection results of the data, detect the addition and change of the detection data through the log and version number mechanism; S42, merging the incremental cleaning result with the existing cleaning data.
[0007] In a second aspect, an embodiment of the present invention provides a data processing and cleaning device for an Internet of Things device, the device comprising: A preprocessing module is used to receive a data stream from an IoT device and transmit the data through a message queue system; and preprocess the data stream; A data distribution module is used to distribute data cleaning tasks to corresponding processing nodes and process them according to the pre-processed data stream through a distributed processing architecture; A data marking module is used to perform real-time detection on the incoming data by loading an anomaly detection model according to the processing node, automatically identify and process abnormal data; and perform correction and replacement according to the type of the abnormal data, and mark the abnormal data that cannot be corrected; The data cleaning module is used to process the newly added and changed data through incremental data cleaning according to the real-time detection results of the data; The data management module is used to manage data streams through streaming processing based on the data cleaning results.
[0008] In some implementations, the distributed processing architecture includes a distributed computing framework, a node manager, a distributed file system, and a load balancing algorithm; the data distribution module specifically includes: A node management unit, configured to manage the processing nodes according to a distributed computing framework; A node processing unit, used to monitor the status of the processing node, assign tasks and adjust the node according to the node manager; A task splitting unit, used for splitting the data cleaning task into multiple subtasks, assigning each subtask to the corresponding processing node, and storing the data through a distributed file system; The task allocation unit is used to perform load balancing processing according to the processing nodes through a load balancing algorithm; and to perform real-time task allocation according to the processing capacity and current load conditions of the processing nodes.
[0009] In some implementations, in the data labeling module, the anomaly detection model is implemented by a machine learning algorithm, specifically including: A marking unit, which is used to collect historical data and mark abnormal data and normal data; A training unit, used to perform model training by a random forest algorithm according to the abnormal data and normal data to obtain an abnormality detection model; A model deployment unit is used to deploy the anomaly detection model to each of the processing nodes.
[0010] In some implementations, the data cleaning module specifically includes: The real-time detection unit is used to detect the addition and change of detection data through log and version number mechanism according to the real-time detection results of the data; The data merging unit is used to merge the incremental cleaning result with the existing cleaning data.
[0011] In a third aspect, an embodiment of the present invention provides an electronic device, comprising a memory and a processor, wherein the memory is used to store one or more computer instructions, wherein when the one or more computer instructions are executed by the processor, the method described in the first aspect above is implemented.
[0012] In a fourth aspect, an embodiment of the present invention provides a computer storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it is used to implement the method described in the first aspect.
[0013] One or more embodiments of the present invention can at least bring about the following beneficial effects: the method of the present invention manages multiple processing nodes by using a distributed computing framework, and distributes data cleaning tasks to each node for parallel processing, so as to improve processing efficiency and system scalability; uses machine learning algorithms on each processing node to automatically identify and process abnormal data, thereby improving the intelligence level of data cleaning; by realizing incremental data cleaning, only new or changed data is processed, thereby reducing unnecessary repeated calculations; and adopts streaming processing technology to realize near real-time data cleaning to meet the requirements for data real-time performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0015] Figure 1 It is a data flow diagram of a method provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0016] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. The components of the embodiments of the present invention generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents the selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present invention.
[0017] Embodiment one:
[0018] Figure 1 A data flow diagram of a data processing and cleaning method for IoT devices is shown, such as Figure 1 As shown, the data processing and cleaning method for IoT devices provided in this embodiment includes: S1, receiving a data stream from an IoT device and transmitting the data through a message queue system; and preprocessing the data stream; S2, according to the pre-processed data stream, the data cleaning task is assigned to the corresponding processing node through the distributed processing architecture and processed; S3, according to the processing node, by loading the anomaly detection model, real-time detection is performed on the incoming data, and abnormal data is automatically identified and processed; and correction and replacement are performed according to the type of the abnormal data, and the abnormal data that cannot be corrected is marked; S4, based on the real-time detection results of the data, the newly added and changed data are processed through incremental data cleaning; S5: Based on the data cleaning results, data flow management is performed through stream processing.
[0019] First, according to S1, data streams are received from multiple IoT devices and transmitted through a message queue system (such as Kafka). The data acquisition module extracts, transforms, and loads (ETL) data for preliminary preprocessing. The collected data is converted into a unified format. Obvious invalid data and noise data are removed.
[0020] Next, according to S2, the pre-processed data is classified according to type or source or different classification algorithms, and distributed to different processing nodes using load balancing or data routers to optimize the efficiency and effect of data processing.
[0021] Specifically, the distributed processing architecture includes a distributed computing framework, a node manager, a distributed file system and a load balancing algorithm; the distributed computing framework includes but is not limited to Apache Hadoop, Apache Spark, and uses a distributed file system such as HDFS to store and distribute data.
[0022] More specifically, S2 specifically includes: S21, managing the processing nodes according to a distributed computing framework; S22, monitoring the status of the processing node, assigning tasks and adjusting the node according to the node manager; S23, splitting the data cleaning task into multiple subtasks, assigning each subtask to the corresponding processing node, and storing the data through a distributed file system; S24, performing load balancing processing according to the processing nodes through a load balancing algorithm; and performing real-time task allocation according to the processing capabilities and current load conditions of the processing nodes.
[0023] Use distributed computing frameworks (such as Apache Hadoop, Apache Spark) to manage multiple processing nodes according to S21.
[0024] According to S22, the node manager is responsible for monitoring node status, assigning tasks, and coordinating work between nodes.
[0025] According to S23, the data cleaning task is split into multiple subtasks, each subtask is assigned to a processing node, and a distributed file system (such as HDFS) is used to store data to ensure efficient distribution and access of data among nodes.
[0026] S24 uses a mature load balancing algorithm to ensure that the load of each node is balanced and avoid overloading of some nodes; dynamically adjust task allocation and allocate tasks in real time according to the processing capacity of the node and the current load situation.
[0027] Next, according to S3, on each processing node, use the pre-trained anomaly detection model to load it into the processing node, perform real-time detection on the incoming data, automatically identify and process abnormal data, correct and replace the abnormal data according to the type of anomaly, and mark the abnormal data that cannot be corrected to ensure the accuracy and reliability of the data.
[0028] Specifically, in S3, the anomaly detection model is implemented by a machine learning algorithm, specifically including: S31, collect historical data and mark abnormal data and normal data; S32, performing model training by using a random forest algorithm according to the abnormal data and the normal data to obtain an abnormality detection model; S33, deploying the anomaly detection model to each of the processing nodes.
[0029] Use machine learning algorithms to automatically identify and process abnormal data and improve the intelligence level of data cleaning. Through training models, the system can automatically detect abnormal values, noise, etc. in the data and process them accordingly.
[0030] By collecting a large amount of historical data, abnormal data and normal data are marked. The random forest algorithm is selected for model training. The trained model is deployed to each processing node. When processing data in real time, the model is used to detect anomalies, mark and process abnormal data. The model is updated regularly and retrained with the latest labeled data to ensure the accuracy and applicability of the model.
[0031] Next, according to S4, by implementing incremental data cleaning, only newly added or changed data is processed to reduce unnecessary repeated calculations; incremental data cleaning only processes newly added or changed data, reduces repeated calculations, and improves data cleaning efficiency.
[0032] Use log or version number mechanism to detect the addition and change of data. Compare the current data with the last cleaned data, mark the new or changed data, and design a special cleaning algorithm for the new or changed data to ensure that only the necessary data is processed. Implement incremental cleaning logic on the processing node to avoid repeated processing of the full amount of data. Merge the results of incremental cleaning with the existing cleaned data. Use efficient merging algorithms to ensure data consistency and integrity.
[0033] Specifically, the S4 specifically includes: S41, based on the real-time detection results of the data, detect the addition and change of the detection data through the log and version number mechanism; S42, merging the incremental cleaning result with the existing cleaning data.
[0034] Next, according to S5, streaming processing technology is used to achieve near real-time data cleaning to meet the requirements for data real-time performance.
[0035] Stream processing technology is used to manage data streams using a stream processing framework (such as Apache Kafka, Apache Flink, and ApacheStorm). The framework is responsible for receiving, distributing, and processing data streams, ensuring the real-time nature of data processing, implementing stream processing algorithms, and ensuring that data is processed immediately upon arrival. Data cleaning operations are embedded in the stream processing process to ensure the continuity and real-time nature of processing and achieve near-real-time data cleaning. Stream processing technology can process continuous data streams and process data immediately upon arrival.
[0036] Define the standard format and unit of data, standardize and consistency process the data, ensure the consistency of data format and unit, and improve the availability of data.
[0037] Use hash algorithms or other efficient duplicate detection algorithms to remove duplicate data, and merge the processed data into a unified data set to ensure the uniqueness and integrity of the data.
[0038] Define data validation rules, verify and evaluate the quality of cleaned data to ensure the accuracy and completeness of the data, and provide a reliable basis for subsequent data analysis and decision-making.
[0039] Embodiment 2:
[0040] An embodiment of the present invention provides a data processing and cleaning device for an Internet of Things device, the device comprising: A preprocessing module is used to receive a data stream from an IoT device and transmit the data through a message queue system; and preprocess the data stream; A data distribution module is used to distribute data cleaning tasks to corresponding processing nodes and process them according to the pre-processed data stream through a distributed processing architecture; A data marking module is used to perform real-time detection on the incoming data by loading an anomaly detection model according to the processing node, automatically identify and process abnormal data; and perform correction and replacement according to the type of the abnormal data, and mark the abnormal data that cannot be corrected; The data cleaning module is used to process the newly added and changed data through incremental data cleaning according to the real-time detection results of the data; The data management module is used to manage data streams through streaming processing based on the data cleaning results.
[0041] Specifically, the distributed processing architecture includes a distributed computing framework, a node manager, a distributed file system and a load balancing algorithm; the data distribution module specifically includes: A node management unit, configured to manage the processing nodes according to a distributed computing framework; A node processing unit, used to monitor the status of the processing node, assign tasks and adjust the node according to the node manager; A task splitting unit, used for splitting the data cleaning task into multiple subtasks, assigning each subtask to the corresponding processing node, and storing the data through a distributed file system; The task allocation unit is used to perform load balancing processing according to the processing nodes through a load balancing algorithm; and to perform real-time task allocation according to the processing capacity and current load conditions of the processing nodes.
[0042] Specifically, in the data labeling module, the anomaly detection model is implemented by a machine learning algorithm, specifically including: A marking unit, which is used to collect historical data and mark abnormal data and normal data; A training unit, used to perform model training by a random forest algorithm according to the abnormal data and normal data to obtain an abnormality detection model; A model deployment unit is used to deploy the anomaly detection model to each of the processing nodes.
[0043] Specifically, the data cleaning module specifically includes: The real-time detection unit is used to detect the addition and change of detection data through log and version number mechanism according to the real-time detection results of the data; The data merging unit is used to merge the incremental cleaning result with the existing cleaning data.
[0044] Embodiment three:
[0045] This embodiment further provides an electronic device, including a memory and a processor, wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions implement the method of embodiment 1 when executed by the processor; In practical applications, the processor can be an application specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field programmable gate array (FPGA), a controller, a microcontroller unit (MCU), a microprocessor or other electronic components to execute the methods in the above embodiments.
[0046] The method implemented in this embodiment is as described in Embodiment 1.
[0047] Embodiment 4:
[0048] This embodiment further provides a computer storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by one or more processors, the method of the first embodiment is implemented; Among them, the computer-readable 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), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.
[0049] The method implemented in this embodiment includes: The method implemented in this embodiment is as described in Embodiment 1.
[0050] In the several embodiments provided in the embodiments of the present invention, it should be understood that the disclosed system and method can also be implemented in other ways. The system and method embodiments described above are merely illustrative.
Claims
1. A data processing and cleaning method for Internet of Things devices, characterized in that: The method comprises: S1, receiving a data stream from an IoT device and transmitting the data through a message queue system; and preprocessing the data stream; S2, according to the pre-processed data stream, the data cleaning task is assigned to the corresponding processing node through the distributed processing architecture and processed; S3, according to the processing node, by loading the anomaly detection model, real-time detection is performed on the incoming data, and abnormal data is automatically identified and processed; and correction and replacement are performed according to the type of the abnormal data, and the abnormal data that cannot be corrected is marked; S4, based on the real-time detection results of the data, the newly added and changed data are processed through incremental data cleaning; S5: Based on the data cleaning results, data flow management is performed through stream processing.
2. The method according to claim 1, characterized in that The distributed processing architecture includes a distributed computing framework, a node manager, a distributed file system and a load balancing algorithm; S2 specifically includes: S21, managing the processing nodes according to a distributed computing framework; S22, monitoring the status of the processing node, assigning tasks and adjusting the node according to the node manager; S23, splitting the data cleaning task into multiple subtasks, assigning each subtask to the corresponding processing node, and storing the data through a distributed file system; S24, performing load balancing processing according to the processing nodes through a load balancing algorithm; and performing real-time task allocation according to the processing capabilities and current load conditions of the processing nodes.
3. The method according to claim 2, characterized in that In S3, the anomaly detection model is implemented by a machine learning algorithm, specifically including: S31, collect historical data and mark abnormal data and normal data; S32, performing model training by using a random forest algorithm according to the abnormal data and the normal data to obtain an abnormality detection model; S33, deploying the anomaly detection model to each of the processing nodes.
4. The method according to claim 3, characterized in that The S4 specifically includes: S41, based on the real-time detection results of the data, detect the addition and change of the detection data through the log and version number mechanism; S42, merging the incremental cleaning result with the existing cleaning data.
5. A data processing and cleaning device for Internet of Things equipment, characterized in that: The device comprises: A preprocessing module is used to receive a data stream from an IoT device and transmit the data through a message queue system; and preprocess the data stream; A data distribution module is used to distribute data cleaning tasks to corresponding processing nodes and process them according to the pre-processed data stream through a distributed processing architecture; A data marking module is used to perform real-time detection on the incoming data by loading an anomaly detection model according to the processing node, automatically identify and process abnormal data; and perform correction and replacement according to the type of the abnormal data, and mark the abnormal data that cannot be corrected; The data cleaning module is used to process the newly added and changed data through incremental data cleaning according to the real-time detection results of the data; The data management module is used to manage data streams through streaming processing based on the data cleaning results.
6. The device according to claim 5, characterized in that The distributed processing architecture includes a distributed computing framework, a node manager, a distributed file system and a load balancing algorithm; the data distribution module specifically includes: A node management unit, configured to manage the processing nodes according to a distributed computing framework; A node processing unit, used to monitor the status of the processing node, assign tasks and adjust the node according to the node manager; A task splitting unit, used for splitting the data cleaning task into multiple subtasks, assigning each subtask to the corresponding processing node, and storing the data through a distributed file system; The task allocation unit is used to perform load balancing processing according to the processing nodes through a load balancing algorithm; and to perform real-time task allocation according to the processing capacity and current load conditions of the processing nodes.
7. The device according to claim 6, characterized in that In the data labeling module, the anomaly detection model is implemented by a machine learning algorithm, specifically including: A marking unit, which is used to collect historical data and mark abnormal data and normal data; A training unit, used to perform model training by a random forest algorithm according to the abnormal data and normal data to obtain an abnormality detection model; A model deployment unit is used to deploy the anomaly detection model to each of the processing nodes.
8. The device according to claim 7, characterized in that The data cleaning module specifically includes: The real-time detection unit is used to detect the addition and change of detection data through log and version number mechanism according to the real-time detection results of the data; The data merging unit is used to merge the incremental cleaning result with the existing cleaning data.
9. An electronic device, characterized in that: The invention comprises a memory and a processor, wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions, when executed by the processor, implement the method as described in any one of claims 1 to 4.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it is used to implement the method as described in any one of claims 1 to 4 above.
Citation Information
Patent Citations
Data cleaning method and device
CN112925785A
Platform data cleaning method and device, storage medium and electronic equipment
CN116594991A
Distributed power transaction system anomaly detection method, system and device and medium
CN118350032A
Distributed anomaly detection method and device, equipment and medium
CN118432871A
