Data stream batch processing method, device and equipment and computer storage medium

By standardizing and stream-processing real-time data from IoT devices, combined with a batch processing framework and a columnar database, the problem of low intelligence and decision-making efficiency of the data processing system is solved, and high concurrency and efficient data processing are achieved.

CN118585548APending Publication Date: 2024-09-03HAINA CLOUD IOT TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410605636.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-15
Publication Date
2024-09-03

AI Technical Summary

Technical Problem

Existing technology is difficult to support highly concurrent data writing, efficient data query, and massive data storage. At the same time, data alarm requirements are high, resulting in low intelligence and low decision-making efficiency of the data processing system.

Method used

By obtaining real-time data from IoT devices for standardized processing, and sending it to the Kafka message queue, using the streaming computing framework to consume the data, analyzing and processing it and writing it back to the queue, and using the batch processing computing framework to consume based on the rule base configuration information. data, and finally write the results into a columnar distributed database.

Benefits of technology

It improves the intelligence and decision-making efficiency of the data processing system, meets the needs of high concurrent writing and efficient query, and improves the real-time processing capability of data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118585548A
    Figure CN118585548A
Patent Text Reader

Abstract

The invention belongs to the technical field of data processing, and particularly relates to a data stream batch processing method, device and equipment and a computer storage medium, and the method comprises the steps: obtaining real-time data of Internet of Things equipment, carrying out the standardization processing of the real-time data of the Internet of Things equipment, obtaining the real-time data of the Internet of Things equipment after the standardization processing, and carrying out the batch processing of the data stream. Sending the standardized real-time data of the Internet of Things equipment to a kafka message queue, consuming the data in the kafka message queue by adopting a streaming processing calculation framework to obtain first consumption data, analyzing and processing the first consumption data to obtain analysis data, re-writing the analysis data back to the kafka message queue to obtain a new kafka message queue, and sending the new kafka message queue to the Internet of Things equipment. On the basis of configuration information in the rule base, the batch processing computing framework is adopted to consume data in the new kafka message queue to obtain second consumption data, and the second consumption data is written into a column type distributed database; according to the method, the data processing intelligence degree and decision-making efficiency of the data processing system are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of data processing technology, and specifically relates to a data stream batch processing method, device, equipment and computer storage medium. Background Art

[0002] As data processing has a wide range of applications in multiple fields, such as real-time speech recognition, video analysis, network traffic analysis, financial transaction detection, human activity recognition, etc., in these applications, data processing can analyze and process data in real time, improving the intelligence and decision-making efficiency of the data processing system.

[0003] In the existing technology, the characteristics of data stream batch processing are continuous data generation and batch data consumption, providing real-time, efficient and stable data processing; the core data of data stream batch processing is device data, the device data structure is diverse and the frequency of access to device data is very high, and massive data is generated every day. The RDMP structured database supports data writing, efficient data query and massive data storage. At the same time, device data will also generate alarm data according to rules, thereby performing data processing.

[0004] However, general RDMP structured databases are difficult to support high-concurrency data writing, efficient data query and massive data storage. At the same time, data will also generate alarm data according to rules, and the real-time requirements of data are very high. General microservice architectures are difficult to meet data processing needs, resulting in low intelligence and decision-making efficiency of data processing systems. Summary of the invention

[0005] The present application provides a data stream batch processing method, apparatus, device and computer storage medium to solve the problem of low intelligence level and decision-making efficiency in data processing by a data processing system.

[0006] In a first aspect, the present application provides a data stream batch processing method, comprising:

[0007] Acquire real-time data of the Internet of Things device, and perform standardized processing on the real-time data of the Internet of Things device to obtain the standardized processed real-time data of the Internet of Things device;

[0008] Send the standardized processed real-time data of the IoT device to a Kafka message queue, and use a stream processing computing framework to consume the data in the Kafka message queue to obtain first consumption data;

[0009] Analyze and process the first consumption data to obtain analysis data, and rewrite the analysis data back to the Kafka message queue to obtain a new Kafka message queue;

[0010] Based on the configuration information in the rule base, a batch computing framework is used to consume the data in the new Kafka message queue to obtain second consumption data, and the second consumption data is written into a columnar distributed database.

[0011] Optionally, before acquiring the real-time data of the IoT device, the method further includes:

[0012] Obtain the IoT device raw data and IoT device information corresponding to the preset IoT device;

[0013] Standardize the original data of the IoT device according to the IoT device information, and store the standardized IoT device original data in a cache database;

[0014] The data in the cache database is analyzed to generate configuration information, and a rule base is constructed according to the configuration information.

[0015] Optionally, the analysis data includes: serializing original data and alarm data, analyzing and processing the first consumption data to obtain analysis data, and rewriting the analysis data back to the Kafka message queue to obtain a new Kafka message queue, including:

[0016] Performing serialization structure processing on the first consumption data to obtain the serialized original data;

[0017] Acquire the alarm rule in the rule base, and perform alarm rule judgment on the first consumption data according to the alarm rule to obtain alarm data;

[0018] The serialized original data and the alarm data are rewritten back to the Kafka message queue to obtain a new Kafka message queue.

[0019] Optionally, based on the configuration information in the rule base, using a batch computing framework to consume the data in the new Kafka message queue to obtain second consumption data includes:

[0020] Obtaining configuration information in the rule base;

[0021] Based on the configuration information in the rule base, the batch computing framework is used to consume the data in the new Kafka message queue to obtain batch consumption data;

[0022] The batch consumption data is deserialized to obtain second consumption data.

[0023] Optionally, writing the second consumption data into a column-based distributed database includes:

[0024] Performing online data analysis on the second consumption data to obtain second consumption data after data analysis;

[0025] Acquire data in a column-based distributed database, and perform offline data analysis on the data in the column-based distributed database to obtain a database after data analysis;

[0026] The second consumption data after the data analysis and the data in the database after the data analysis are written into a column-type distributed database to obtain a new database.

[0027] Optionally, before the stream processing computing framework is used to consume the data in the Kafka message queue and obtain the first consumption data, the method further includes:

[0028] The real-time data of the Internet of Things device is written into a cache database, and the rule base is updated in real time to obtain a new rule base.

[0029] In a second aspect, the present application provides a data stream batch processing device, comprising:

[0030] Acquisition module, used to obtain real-time data of IoT devices;

[0031] A processing module, used for performing standardized processing on the real-time data of the Internet of Things devices to obtain the standardized real-time data of the Internet of Things devices;

[0032] A sending module is used to send the standardized processed real-time data of the IoT device to the Kafka message queue;

[0033] The processing module is further used to consume the data in the Kafka message queue using a stream processing computing framework to obtain first consumption data;

[0034] The processing module is further used to analyze and process the first consumption data to obtain analysis data;

[0035] A determination module is used to rewrite the analysis data back to the Kafka message queue to obtain a new Kafka message queue;

[0036] The processing module is also used to consume the data in the new Kafka message queue based on the configuration information in the rule base using a batch computing framework to obtain second consumption data, and write the second consumption data into a column-based distributed database.

[0037] Optionally, the acquisition module is further used to acquire the IoT device original data and IoT device information corresponding to the preset IoT device;

[0038] The processing module is further used to perform standardization processing on the original data of the IoT device according to the IoT device information, and store the standardized IoT device original data into a cache database;

[0039] The processing module is further used to analyze the data in the cache database, generate configuration information, and build a rule base according to the configuration information.

[0040] Optionally, the processing module is further used to perform serialization structure processing on the first consumption data to obtain the serialized original data;

[0041] The acquisition module is further used to acquire the alarm rules in the rule base;

[0042] The processing module is further used to perform alarm rule judgment on the first consumption data according to the alarm rule to obtain alarm data;

[0043] The processing module is also used to rewrite the serialized original data and alarm data back to the Kafka message queue to obtain a new Kafka message queue.

[0044] Optionally, the acquisition module is further used to acquire configuration information in the rule base;

[0045] The processing module is further used to consume the data in the new Kafka message queue using the batch computing framework based on the configuration information in the rule base to obtain batch consumption data;

[0046] The processing module is further used to perform deserialization processing on the batch consumption data to obtain second consumption data.

[0047] Optionally, the processing module is further used to perform online data analysis on the second consumption data to obtain the analyzed second consumption data;

[0048] The acquisition module is also used to acquire data in a column-based distributed database;

[0049] The processing module is further used to perform offline data analysis on the data in the column-based distributed database to obtain a database after data analysis;

[0050] The processing module is further used to write the second consumption data after the data analysis and the data in the database after the data analysis into a column-based distributed database to obtain a new database.

[0051] Optionally, the processing module is further used to write the real-time data of the Internet of Things device into a cache database, and update the rule base in real time to obtain a new rule base.

[0052] In a third aspect, the present application provides a data stream batch processing device, comprising:

[0053] Memory;

[0054] processor;

[0055] Wherein, the memory stores computer-executable instructions;

[0056] The processor executes the computer-executable instructions stored in the memory to implement the data stream batch processing method as described in the first aspect and various possible implementations of the first aspect.

[0057] In a fourth aspect, the present application provides a computer storage medium, characterized in that the computer storage medium stores computer execution instructions, and when the computer execution instructions are executed by a processor, they are used to implement the data stream batch processing method described in the first aspect and various possible implementations of the first aspect.

[0058] The data stream batch processing method provided by the present application obtains real-time data of Internet of Things devices, performs standardization processing on the real-time data of Internet of Things devices, obtains standardized real-time data of Internet of Things devices, sends the standardized real-time data of Internet of Things devices to a Kafka message queue, and consumes the data in the Kafka message queue using a streaming processing computing framework to obtain first consumption data, analyzes and processes the first consumption data to obtain analysis data, and writes the analysis data back to the Kafka message queue to obtain a new Kafka message queue. Based on the configuration information in the rule base, a batch processing computing framework is used to consume the data in the new Kafka message queue to obtain second consumption data, and the second consumption data is written into a column-based distributed database. The method improves the intelligence level and decision-making efficiency of data processing by the data processing system. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0060] Figure 1 This is the process of the data stream batch processing method provided by this application Figure 1 ;

[0061] Figure 2 This is the process of the data stream batch processing method provided by this application Figure 2 ;

[0062] Figure 3 It is a structural schematic diagram of a data stream batch processing device provided by the present application;

[0063] Figure 4 It is a structural diagram of the data stream batch processing device provided by this application.

[0064] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0065] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in this application will be clearly and completely described below in conjunction with the drawings in this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0066] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in sequences other than those illustrated or described herein, for example.

[0067] In the embodiments of the present application, the words "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0068] As data processing has a wide range of applications in multiple fields, such as real-time speech recognition, video analysis, network traffic analysis, financial transaction detection, human activity recognition, etc., in these applications, data processing can analyze and process data in real time, improving the intelligence and decision-making efficiency of the data processing system.

[0069] In the existing technology, the characteristics of data stream batch processing are continuous data generation and batch data consumption, providing real-time, efficient and stable data processing; the core data of data stream batch processing is device data, the device data structure is diverse and the frequency of access to device data is very high, and massive data is generated every day. The RDMP structured database supports data writing, efficient data query and massive data storage. At the same time, device data will also generate alarm data according to rules, thereby performing data processing.

[0070] However, general RDMP structured databases are difficult to support high-concurrency data writing, efficient data query and massive data storage. At the same time, data will also generate alarm data according to rules, and the real-time requirements of data are very high. General microservice architectures are difficult to meet data processing needs, resulting in low intelligence and decision-making efficiency of data processing systems.

[0071] In response to the above problems, the present application provides a data stream batch processing method, which obtains real-time data of IoT devices and standardizes the real-time data of IoT devices to make the query interface simple and easy to maintain, sends the standardized real-time data of IoT devices to a Kafka message queue, and uses a streaming processing computing framework to consume the data in the Kafka message queue to obtain first consumption data, analyzes and processes the first consumption data to obtain analysis data, and writes the analysis data back to the Kafka message queue to obtain a new Kafka message queue. Based on the configuration information in the rule base, a batch processing computing framework is used to consume the data in the new Kafka message queue to obtain second consumption data, and the second consumption data is written into a column-based distributed database; this method improves the intelligence level and decision-making efficiency of data processing by the data processing system.

[0072] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0073] Figure 1 This is the process of the data stream batch processing method provided by this application Figure 1 .like Figure 1 As shown, the data stream batch processing method provided in this embodiment includes:

[0074] S101: Acquire real-time data of Internet of Things devices, and perform standardization processing on the real-time data of Internet of Things devices to obtain the standardized real-time data of Internet of Things devices.

[0075] Among them, the real-time data of IoT devices refers to the data transmitted from IoT devices to the application end through the gateway.

[0076] Real-time data from the Internet of Things is an important source of data analysis. By mining and analyzing real-time data from the Internet of Things, we can discover potential patterns and trends in the data and provide support for business decision-making.

[0077] The message middleware Kafka message queue API interface provided according to the needs of the application side is used to connect to the IoT device to obtain real-time data of the IoT device.

[0078] Since the real-time data of IoT devices have different formats and structures, it is necessary to parse the real-time data of IoT devices, extract data according to the data format specifications or API documents of IoT devices, and then clean the data (for example: check the integrity of the data, the correctness of the format, and the rationality of the scope), and convert the parsed and cleaned data into a unified format and structure. Based on the data conversion, the real-time data of IoT devices is standardized. The standardized real-time data of IoT devices is consistent and comparable, which makes data analysis easier and more accurate.

[0079] S102: Send the standardized real-time data of the IoT device to a Kafka message queue, and use a stream processing computing framework to consume the data in the Kafka message queue to obtain first consumption data.

[0080] Among them, the Kafka message queue is a distributed, high-throughput data processing platform. Kafka is mainly composed of producers, topics, partitions, consumers, consumer groups, and Brokers.

[0081] The stream processing computing framework is a computing framework for processing continuous and constantly generated data streams. It can provide efficient real-time data processing capabilities and is widely used in various fields. The stream processing computing framework usually divides the data stream into multiple partitions and distributes these partitions on different computing nodes to achieve parallel computing. Through the distributed architecture, the stream computing framework can process large-scale data and ensure real-time performance.

[0082] The first consumption data is used to indicate data processed by the IoT device in real time through the data stream.

[0083] As a producer, the IoT device is responsible for sending real-time data to the Kafka message queue (that is, the real-time data of the IoT device is written to the Kafka message queue). As a message category in Kafka, the producer sends messages to a specific topic. The application end, as a consumer, consumes messages from a specific topic. Each topic in Kafka can have multiple partitions. Partitions are physical concepts. Each partition physically corresponds to a folder, which stores all message data of this partition. On the application end that receives messages from Kafka, consumers subscribe to one or more topics and read messages from one or more partitions of the topic. Multiple consumer instances can form a consumer group to consume one or more topics together. Each consumer instance in the consumer group will be assigned to one or more partitions for consumption. Broker is one or more servers in the Kafka cluster, responsible for storing and forwarding messages.

[0084] S103: Analyze and process the first consumption data to obtain analysis data, and write the analysis data back to the Kafka message queue to obtain a new Kafka message queue.

[0085] The first message data is analyzed and processed to obtain analysis data, and the analysis data is written to a new Kafka topic. The data can be sent to the same partition as the original topic or to a different partition, depending on business requirements and Kafka's partitioning strategy.

[0086] S104: Based on the configuration information in the rule base, a batch processing computing framework is used to consume the data in the new Kafka message queue to obtain second consumption data, and the second consumption data is written into a column-based distributed database.

[0087] The configuration information in the rule base includes: rule information, decision information, change information and application information.

[0088] The second consumption data is the data after batch processing of the data in the Kafka message queue.

[0089] A column-oriented distributed database is a database that stores data in different physical locations.

[0090] Based on the configuration information in the rule base, the data in the new Kafka message queue is batched, and then the batch processing computing framework is used to consume the data in the new Kafka message queue to obtain second consumption data, and the second consumption data is written into the column-based distributed database.

[0091] The data stream batch processing method provided in this embodiment obtains real-time data of Internet of Things devices, performs standardization processing on the real-time data of Internet of Things devices to obtain standardized real-time data of Internet of Things devices, sends the standardized real-time data of Internet of Things devices to a Kafka message queue, and consumes the data in the Kafka message queue using a stream processing computing framework to obtain first consumption data, analyzes and processes the first consumption data to obtain analysis data, and writes the analysis data back to the Kafka message queue to obtain a new Kafka message queue, and based on the configuration information in the rule base, consumes the data in the new Kafka message queue using a batch processing computing framework to obtain second consumption data, and writes the second consumption data into a column-based distributed database; this method improves the intelligence level and decision-making efficiency of data processing by the data processing system.

[0092] Figure 2 This is the process of the data stream batch processing method provided by this application Figure 2 The execution subject of this embodiment is, for example, a data processing system, such as Figure 2 As shown, in this embodiment Figure 1 Based on the embodiment, the data stream batch processing method is described in detail. The data stream batch processing method shown in this embodiment includes:

[0093] S201: Obtain IoT device original data and IoT device information corresponding to a preset IoT device.

[0094] The preset IoT devices are used to indicate all devices corresponding to the products mapped by the device object model that meet the configuration threshold.

[0095] The raw data of IoT devices is used to indicate the data generated during the historical operation of IoT devices.

[0096] IoT device information includes: monitoring point, device code, upload timestamp, device type, device attribute value range and partition field.

[0097] Obtaining the IoT device original data and IoT device information corresponding to the preset IoT devices provides information support for the construction of the rule base.

[0098] S202: Standardize the original data of the IoT device according to the IoT device information, and store the standardized original data of the IoT device in a cache database.

[0099] Among them, the cache database can be a redis cache. Redis cache is a high-performance key-value storage system based on memory, which is used to cache data to improve the performance and response speed of applications. Redis supports multiple data structures, such as strings, hash tables, lists, sets, etc., and can store and operate various types of data. Since redis stores data in memory, the read and write speeds are very fast, which is suitable for scenarios that require fast access and processing of data. Redis cache is often used to store frequently accessed data, such as database query results, calculation results, session information, etc., to reduce the number of accesses to the database or other storage systems, thereby improving the performance and throughput of the system. By caching data in redis, applications can obtain data faster, reduce response time, and improve user experience.

[0100] Standardize the raw data of IoT devices, including data cleaning, data conversion, and data format operations, to ensure data consistency and availability. Select a cache database, redis, suitable for storing real-time data. These databases usually have fast read and write speeds and high performance. Store the standardized raw data of IoT devices in the selected cache database for subsequent fast access and processing.

[0101] The original data of IoT devices can be standardized according to the monitoring points, device codes, upload timestamps, device types, device attribute value domains and partition fields of IoT devices, and the standardized original data of IoT devices can be stored in the cache database.

[0102] S203: Analyze the data in the cache database, generate configuration information, and build a rule base according to the configuration information.

[0103] Among them, configuration information is used to indicate the settings and parameter information for defining and managing the functions, communications, and security of IoT devices.

[0104] First, the data in the cache database needs to be analyzed, including data structure, field meaning, associations, etc. This can be achieved through database queries, data visualization tools, or custom scripts; then, based on the results of the data analysis, configuration information can be generated, including the meaning of the data field, data type, data range, and associations. The configuration information can be saved in the form of documents, tables, or files in a specific format; finally, based on the generated configuration information, a rule library is built to define rules for data processing, validation, conversion, etc. The rule library can include data validation rules, data conversion rules, and data processing logic.

[0105] S204: Acquire real-time data of the Internet of Things devices, and perform standardization processing on the real-time data of the Internet of Things devices to obtain the standardized real-time data of the Internet of Things devices.

[0106] Optionally, after acquiring the real-time data of the IoT device, the real-time data of the IoT device is written into a cache database, and the rule base is updated in real time to obtain a new rule base.

[0107] The real-time data obtained from IoT devices will affect the composition of the rule base, and a new rule base will be obtained. The rules in the new rule base will be used as rule standards to process data during the next data processing by IoT devices. This time, the rules in the unupdated rule base will still be used as rule standards for data processing.

[0108] S205: Send the standardized real-time data of the IoT device to a Kafka message queue, and use a stream processing computing framework to consume the data in the Kafka message queue to obtain first consumption data.

[0109] Among them, step S205 is similar to step S102 and will not be repeated here.

[0110] S206: Perform serialization structure processing on the first consumption data to obtain the serialized original data.

[0111] Among them, serialization structure processing refers to converting the data structure into a format that can be stored or transmitted.

[0112] The main purposes of serializing the structure of the first consumption data include:

[0113] (1) Data transmission: After the first consumption data structure is serialized into a specific format, it can be transmitted on the network, for example, to exchange data between the application end and the IoT device.

[0114] (2) Persistent storage: After the first consumer data structure is serialized, it can be stored in a file system, database, or memory so that it can be reloaded and used when needed.

[0115] (3) Cross-platform interaction: Through serialized structure processing, data interaction and communication between different platforms and programming languages ​​can be achieved.

[0116] S207: Acquire the alarm rules in the rule base, and perform alarm rule judgment on the first consumption data according to the alarm rules to obtain alarm data.

[0117] Among them, the alarm rules can be stored in the rule base. The alarm rules can clearly describe the conditions for triggering the alarm. For example, there is an alarm rule that triggers an alarm when the temperature exceeds a certain threshold.

[0118] It can be understood that, first, the defined alarm rules need to be obtained from the rule library. These rules may include thresholds or logical conditions for determining whether the first message data triggers an alarm; secondly, the alarm rule judgment is performed on the first consumption data: the first consumption data is subjected to rule judgment according to the obtained alarm rules. The first consumption data is compared with the threshold or condition defined in the alarm rule to determine whether an alarm is triggered; finally, if the first consumption data meets a certain alarm rule, the corresponding alarm data can be generated. The alarm data generally includes the data information of the triggering rule, the alarm level, the timestamp and other information.

[0119] S208: writing the serialized original data and the alarm data back to the Kafka message queue to obtain a new Kafka message queue.

[0120] Get the information that needs to be rewritten from the serialized original data and alarm data. Reserialize this information into message format. Use the Kafka producer client to connect to the target Kafka cluster. Create a new Kafka topic to store the rewritten data. Send the serialized original data and alarm data as messages to the newly created Kafka topic.

[0121] S209: Acquire configuration information in the rule base.

[0122] First, you need to access the storage location of the rule base. The rule base is usually a collection stored in the rule base, containing a series of rules and configuration information. With the corresponding access rights, you can use query or retrieval functions to obtain the configuration information in the rule base. This may involve using SQL (or a database-specific query language) to query the table containing the configuration information.

[0123] S210: Based on the configuration information in the rule base, the batch computing framework is used to consume the data in the new Kafka message queue to obtain batch consumption data.

[0124] First, according to the configuration information in the rule base, determine the data type, consumption rules, and processing logic that need to be consumed; then, configure the batch computing framework to connect to the Kafka message queue and consume data. According to the configuration information in the rule base, set the data source and consumption rules. Write batch jobs or tasks to process the data obtained from the Kafka message queue according to the configuration information in the rule base. This may involve data cleaning, transformation, aggregation, or other computing operations. Run jobs in the batch computing framework to consume data in the Kafka message queue and execute the corresponding processing logic according to the configuration information in the rule base; finally, the data results of batch consumption are obtained, and the results can be stored in the database. This step can use the batch computing framework to effectively consume and process the data in the Kafka message queue according to the configuration information in the rule base, so as to realize the automation and efficiency of data processing.

[0125] S211: Deserialize the batch consumption data to obtain second consumption data.

[0126] Among them, deserialization is the process of converting serialized data back to the original data structure or object. In computer science, serialization is the conversion of data structures or objects into a specific format for efficient transmission or storage over the network. Deserialization is the process of converting these serialized data back to the original data structure or object so that the program can use or operate on the data. Deserialization usually involves the process of parsing and restoring serialized data to the original data structure or object.

[0127] It can be understood that batch consumption data is obtained from the Kafka message queue, and the batch data is converted into an operable data structure using a corresponding deserialization method (such as a JSON parser, an XML parser, etc.), and the second consumption data is extracted from the deserialized data structure.

[0128] S212: Performing online data analysis on the second consumption data to obtain analyzed second consumption data.

[0129] Use data analysis tools or programming languages ​​(such as SQL) to analyze the second consumption data. Various data analysis techniques can be applied, such as machine learning and data mining. Obtain the second consumption data after data analysis: According to the selected data analysis method and goal, obtain the second consumption data after analysis and processing.

[0130] S213: Acquire data in a column-based distributed database, and perform offline data analysis on the data in the column-based distributed database to obtain a database after data analysis.

[0131] First, extract data from the columnar distributed database, and use data analysis tools (such as SQL) to analyze the data offline. This may include data cleaning, transformation, and analysis operations.

[0132] S214: writing the second consumption data after the data analysis and the data in the database after the data analysis into a column-based distributed database to obtain a new database.

[0133] In order to write the second consumption data after data analysis and the data in the database after data analysis into the column-based distributed database, ensure that the data analysis has been completed and the second consumption data and the data in the database after data analysis have been obtained. Use an appropriate database connection tool or programming language to connect to the column-based distributed database. According to the data structure, create an appropriate table or column family to store the data. Ensure that the structure of the table matches the data format. Import the second consumption data after data analysis and the data in the database after data analysis into the corresponding table. This can be achieved by using the database import tool or writing SQL statements.

[0134] The data stream batch processing method provided in this embodiment obtains the original data and information of the Internet of Things device corresponding to the preset Internet of Things device, standardizes the original data of the Internet of Things device according to the Internet of Things device information, stores the standardized original data of the Internet of Things device in a cache database, analyzes the data in the cache database to generate configuration information, and builds a rule base according to the configuration information, obtains the real-time data of the Internet of Things device, standardizes the real-time data of the Internet of Things device to obtain the standardized real-time data of the Internet of Things device, sends the standardized real-time data of the Internet of Things device to a Kafka message queue, and consumes the data in the Kafka message queue using a streaming processing computing framework to obtain first consumption data, performs serialization structure processing on the first consumption data to obtain the serialized original data, obtains the alarm rules in the rule base, and performs the alarm processing on the first according to the alarm rules. The alarm rule is judged based on the consumption data to obtain the alarm data, the serialized original data and the alarm data are rewritten back to the Kafka message queue to obtain a new Kafka message queue, the configuration information in the rule base is obtained, and based on the configuration information in the rule base, the batch processing computing framework is used to consume the data in the Kafka message queue to obtain batch consumption data, the batch consumption data is deserialized to obtain second consumption data, the second consumption data is analyzed online to obtain second consumption data after data analysis, the data in the column-based distributed database is obtained, and the data in the column-based distributed database is analyzed offline to obtain the database after data analysis, the second consumption data after data analysis and the data in the database after data analysis are written into the column-based distributed database to obtain a new database; the method improves the intelligence level and decision-making efficiency of data processing by the data processing system.

[0135] Figure 3 Schematic diagram of the structure of the data stream batch processing device provided by this application. Figure 3 As shown, the present application provides a data stream batch processing device, and the data stream batch processing device 300 includes:

[0136] The acquisition module 301 is used to acquire real-time data of IoT devices;

[0137] The processing module 302 is used to perform standardized processing on the real-time data of the Internet of Things devices to obtain standardized real-time data of the Internet of Things devices;

[0138] A sending module 303 is used to send the standardized processed real-time data of the IoT device to a Kafka message queue;

[0139] The processing module 302 is further used to consume the data in the Kafka message queue using a stream processing computing framework to obtain first consumption data;

[0140] The processing module 302 is further used to analyze and process the first consumption data to obtain analysis data;

[0141] A determination module 304 is used to rewrite the analysis data back to the Kafka message queue to obtain a new Kafka message queue;

[0142] The processing module 302 is also used to consume the data in the new Kafka message queue based on the configuration information in the rule base using a batch computing framework to obtain second consumption data, and write the second consumption data into a column-based distributed database.

[0143] Optionally, the acquisition module 301 is further used to acquire the IoT device original data and IoT device information corresponding to the preset IoT device;

[0144] The processing module 302 is further used to perform standardization processing on the original data of the IoT device according to the IoT device information, and store the standardized IoT device original data into a cache database;

[0145] The processing module 302 is further used to analyze the data in the cache database, generate configuration information, and build a rule base according to the configuration information.

[0146] Optionally, the processing module 302 is further configured to perform serialization structure processing on the first consumption data to obtain the serialized original data;

[0147] The acquisition module 301 is also used to acquire the alarm rules in the rule base;

[0148] The processing module 302 is further configured to perform an alarm rule judgment on the first consumption data according to the alarm rule to obtain alarm data;

[0149] The processing module 302 is also used to rewrite the serialized original data and the alarm data back to the Kafka message queue to obtain a new Kafka message queue.

[0150] Optionally, the acquisition module 301 is further used to acquire configuration information in the rule base;

[0151] The processing module 302 is further used to consume the data in the new Kafka message queue using the batch computing framework based on the configuration information in the rule base to obtain batch consumption data;

[0152] The processing module 302 is further used to perform deserialization processing on the batch consumption data to obtain second consumption data.

[0153] Optionally, the processing module 302 is further used to perform online data analysis on the second consumption data to obtain the analyzed second consumption data;

[0154] The acquisition module 301 is also used to acquire data in a column-based distributed database;

[0155] The processing module 302 is further used to perform offline data analysis on the data in the column-based distributed database to obtain a database after data analysis;

[0156] The processing module 302 is further used to write the second consumption data after the data analysis and the data in the database after the data analysis into a column-based distributed database to obtain a new database.

[0157] Optionally, the processing module 302 is further used to write the real-time data of the Internet of Things device into a cache database, and update the rule base in real time to obtain a new rule base.

[0158] Figure 4 Schematic diagram of the structure of the data stream batch processing device provided by this application. Figure 4 As shown, the present application provides a data stream batch processing device, and the data stream batch processing 400 includes: a receiver 401, a transmitter 402, a processor 403 and a memory 404.

[0159] Receiver 401, used for receiving instructions and data;

[0160] A transmitter 402, used for sending instructions and data;

[0161] Memory 404, for storing computer-executable instructions;

[0162] The processor 403 is used to execute the computer-executable instructions stored in the memory 404 to implement the various steps performed by the data stream batch processing method in the above embodiment. For details, please refer to the relevant description in the above data stream batch processing method embodiment.

[0163] Optionally, the memory 404 may be independent or integrated with the processor 403 .

[0164] When the memory 404 is independently provided, the electronic device further includes a bus for connecting the memory 404 and the processor 403 .

[0165] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, a data stream batch processing method as performed by the above-mentioned data stream batch processing device is implemented.

[0166] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those of ordinary skill in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0167] So far, the technical solution of the present application has been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it is easy for those skilled in the art to understand that the protection scope of the present application is obviously not limited to these specific embodiments, and the above embodiments are only used to illustrate the technical solution of the present application rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A data stream batch processing method, characterized in that: The method comprises: Acquire real-time data of the Internet of Things device, and perform standardized processing on the real-time data of the Internet of Things device to obtain the standardized real-time data of the Internet of Things device; Send the standardized processed real-time data of the IoT device to a Kafka message queue, and use a stream processing computing framework to consume the data in the Kafka message queue to obtain first consumption data; Analyze and process the first consumption data to obtain analysis data, and rewrite the analysis data back to the Kafka message queue to obtain a new Kafka message queue; Based on the configuration information in the rule base, a batch computing framework is used to consume the data in the new Kafka message queue to obtain second consumption data, and the second consumption data is written into a columnar distributed database.

2. The method according to claim 1, characterized in that Before obtaining the real-time data of the Internet of Things device, the method further includes: Obtain the IoT device raw data and IoT device information corresponding to the preset IoT device; Standardize the original data of the IoT device according to the IoT device information, and store the standardized IoT device original data in a cache database; The data in the cache database is analyzed to generate configuration information, and a rule base is constructed according to the configuration information.

3. The method according to claim 1, characterized in that The analysis data includes: serialized original data and alarm data, the analysis and processing of the first consumption data to obtain analysis data, and rewriting the analysis data back to the Kafka message queue to obtain a new Kafka message queue, including: Performing serialization structure processing on the first consumption data to obtain the serialized original data; Acquire the alarm rule in the rule base, and perform alarm rule judgment on the first consumption data according to the alarm rule to obtain alarm data; The serialized original data and the alarm data are rewritten back to the Kafka message queue to obtain a new Kafka message queue.

4. The method according to claim 1, characterized in that: The method of consuming the data in the new Kafka message queue based on the configuration information in the rule base using a batch computing framework to obtain second consumption data includes: Obtaining configuration information in the rule base; Based on the configuration information in the rule base, the batch computing framework is used to consume the data in the new Kafka message queue to obtain batch consumption data; The batch consumption data is deserialized to obtain second consumption data.

5. The method according to claim 1, characterized in that The step of writing the second consumption data into a column-based distributed database includes: Performing online data analysis on the second consumption data to obtain second consumption data after data analysis; Acquire data in a column-based distributed database, and perform offline data analysis on the data in the column-based distributed database to obtain a database after data analysis; The second consumption data after the data analysis and the data in the database after the data analysis are written into a column-type distributed database to obtain a new database.

6. The method according to claim 1, characterized in that Before the stream processing computing framework is used to consume the data in the Kafka message queue and obtain the first consumption data, the method further includes: The real-time data of the Internet of Things device is written into a cache database, and the rule base is updated in real time to obtain a new rule base.

7. A data stream batch processing device, characterized in that: include: Acquisition module, used to obtain real-time data of IoT devices; A processing module, used for performing standardized processing on the real-time data of the Internet of Things devices to obtain the standardized real-time data of the Internet of Things devices; A sending module is used to send the standardized processed real-time data of the IoT device to the Kafka message queue; The processing module is further used to consume the data in the Kafka message queue using a stream processing computing framework to obtain first consumption data; The processing module is further used to analyze and process the first consumption data to obtain analysis data; A determination module is used to rewrite the analysis data back to the Kafka message queue to obtain a new Kafka message queue; The processing module is also used to consume the data in the new Kafka message queue based on the configuration information in the rule base using a batch computing framework to obtain second consumption data, and write the second consumption data into a column-based distributed database.

8. The device according to claim 7, characterized in that include: The processing module is further used to perform serialization structure processing on the first consumption data to obtain the serialized original data; The acquisition module is further used to acquire the alarm rules in the rule base; The processing module is further used to perform alarm rule judgment on the first consumption data according to the alarm rule to obtain alarm data; The processing module is also used to rewrite the serialized original data and alarm data back to the Kafka message queue to obtain a new Kafka message queue.

9. A data stream batch processing device, characterized in that: include: Memory; processor; Wherein, the memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the data stream batch processing method according to any one of claims 1 to 6.

10. A computer storage medium, characterized in that: The computer storage medium stores computer execution instructions, which, when executed by a processor, are used to implement the data stream batch processing method according to any one of claims 1 to 6.