New energy automobile real-time data processing method based on Drools rule engine
By adopting a Drools rule engine method in real-time data processing of new energy vehicles, the problem of inflexible business rules configuration in the existing technology is solved, efficient and flexible data processing and automatic business logic triggering is achieved, and the intelligent development of the new energy vehicle industry has been promoted.
Patent Information
- Application Number
- CN202510155588.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-12
- Publication Date
- 2025-05-09
AI Technical Summary
The existing real-time data processing technology of new energy vehicles is difficult to achieve efficient and flexible configuration of business rules and cannot effectively adapt to rapidly changing business needs.
The real-time data processing method of new energy vehicles based on the Drools rule engine is adopted. By collecting and preprocessing the national standard data of new energy vehicles, business rules and standards are defined, and standardized real-time data flow is introduced into the Drools rule engine for matching, realizing automatic triggering of business logic.
It realizes efficient and flexible configuration of business rules, improves the accuracy and real-timeness of data processing, enhances the flexibility and scalability of the system, and supports the intelligent development of the new energy vehicle industry.
Smart Images

Figure CN119960857A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of new energy vehicle data processing, and in particular to a new energy vehicle real-time data processing method based on a Drools rule engine. Background Art
[0002] At present, the real-time data processing of new energy vehicles focuses on the use of stream processing technology to achieve efficient and instant processing of data streams. In this mode, business rules are often solidified in the code. Although this ensures the stability and predictability of processing to a certain extent, it also faces the challenge of inefficient and inflexible business rule management. To address this problem, it is necessary to further explore more flexible and configurable rule management systems in the future to better adapt to the rapidly changing business needs in the field of new energy vehicles. Summary of the invention
[0003] In view of the above technical problems, the present invention provides a real-time data processing method for new energy vehicles based on the Drools rule engine, and innovatively introduces a real-time data processing solution for new energy vehicles based on the Drools rule engine.
[0004] The present invention is implemented by adopting the following technical scheme: a real-time data processing method for new energy vehicles based on Drools rule engine, comprising the following steps: Step S1: Collect national standard data of new energy vehicles and pre-process the data to convert the collected data into data in a standard format; Step S2: define business rule standards according to the new energy vehicle data format obtained after processing, and set the rule file through a visual interface; Step S3: Introduce the standardized real-time data stream into the Drool rule engine, match it with the defined business rules, and generate warning data when the match is consistent.
[0005] Specifically, the data collection in step S1 specifically includes: the new energy vehicle transmits the national standard real-time data to the cloud through the telematics processor via the Internet of Vehicles technology.
[0006] Specifically, the telematics processor is preferably a T-box.
[0007] Specifically, the data preprocessing in step S1 specifically includes: Step S11: data format conversion, converting the binary code stream data into data in json string format according to the corresponding national standard protocol; Step S12: Data cleaning, removing abnormal values and null values in the data; Step S13: Standardize the data to form a real-time data stream with a unified format and valid data.
[0008] Specifically, step S2 includes the following sub-steps: Step S21: Determine the business rule standard and determine the vehicle signal range through the data format corresponding to the signal range; Step S22: Setting business rules through a visual interface to create, modify and delete business rules; Step S23: convert the business rule format to generate a file executable by the Drool rule engine.
[0009] Specifically, the step S21 determines the business rule standard as follows: judging the business rule by the vehicle signal quantity threshold, and also includes judging by a combination of multiple signals.
[0010] Specifically, step S3 includes the following sub-steps: Step S31: The real-time data stream with a unified format generated in step S13 is introduced into the work content of the Drool rule engine through Kafka; Step S32: Load the business rule file generated in step S23 into the rule base of the Drool rule engine; Step S33: The Drools inference engine performs rule matching in real time based on the incoming data, and automatically triggers the corresponding business logic or action instructions when the data meets the business rule conditions.
[0011] The beneficial effects of the present invention are as follows: the present invention innovatively introduces a real-time data processing solution for new energy vehicles based on the Drools rule engine, which aims to achieve efficient and flexible configuration of business rules and improve the accuracy and real-time performance of data processing. Through the Drools rule engine, complex business logic is abstracted into a series of simple rules, which can be dynamically adjusted and optimized according to actual needs, greatly enhancing the flexibility and scalability of the system. The real-time data processing solution for new energy vehicles based on the Drools rule engine provides strong support for the intelligent development of the new energy vehicle industry through its efficient and flexible configuration capabilities and accurate and real-time data processing performance. In future development, this solution will play an increasingly important role in promoting the new energy vehicle industry to move towards a more intelligent and efficient direction. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying creative work.
[0013] Figure 1 This is a general architecture diagram of a real-time data processing method for new energy vehicles based on the Drools rule engine in an embodiment of the present invention; Figure 2 This is a schematic diagram of a new energy vehicle data preprocessing module in an embodiment of the present invention; Figure 3 A schematic diagram of a business rule generation module in an embodiment of the present invention; Figure 4 It is a schematic diagram of the drool rule engine execution module in one embodiment of the present invention. DETAILED DESCRIPTION
[0014] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, 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 part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0015] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0016] The following is combined with Figures 1 to 4 , some embodiments of the present invention are described in detail. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0017] The present invention proposes a real-time data processing method for new energy vehicles based on the Drools rule engine. In a preferred embodiment, the method specifically includes the following steps: Step S1: Collect national standard data of new energy vehicles and pre-process the data to convert the collected data into data in a standard format; Step S2: define business rule standards according to the new energy vehicle data format obtained after processing, and set the rule file through a visual interface; Step S3: Introduce the standardized real-time data stream into the Drool rule engine, match it with the defined business rules, and generate warning data when the match is consistent.
[0018] In this embodiment, the data collection in step S1 specifically includes: the new energy vehicle transmits the national standard real-time data to the cloud through the telematics processor via the Internet of Vehicles technology.
[0019] In this embodiment, the telematics processor is preferably a T-box.
[0020] In this embodiment, the data preprocessing in step S1 specifically includes: Step S11: data format conversion, converting the binary code stream data into data in json string format according to the corresponding national standard protocol; Step S12: Data cleaning, removing abnormal values and null values in the data; Step S13: Standardize the data to form a real-time data stream with a unified format and valid data.
[0021] In this embodiment, step S2 includes the following sub-steps: Step S21: Determine the business rule standard and determine the vehicle signal range through the data format corresponding to the signal range; Step S22: Setting business rules through a visual interface to create, modify and delete business rules; Step S23: convert the business rule format to generate a file executable by the Drool rule engine.
[0022] In this embodiment, the step S21 determines the business rule standard specifically as follows: judging the business rule by the vehicle signal quantity threshold, and also includes judging by a combination of multiple signals.
[0023] In this embodiment, step S3 includes the following sub-steps: Step S31: The real-time data stream with a unified format generated in step S13 is introduced into the work content of the Drool rule engine through Kafka; Step S32: Load the business rule file generated in step S23 into the rule base of the Drool rule engine; Step S33: The Drools inference engine performs rule matching in real time based on the incoming data, and automatically triggers the corresponding business logic or action instructions when the data meets the business rule conditions.
[0024] In another embodiment, if Figure 1 , showing the architecture diagram of the real-time data processing of new energy vehicles based on the Drools rule engine of the present invention, specifically including: S100: Collect national standard data of new energy vehicles and process them into standard format data, such as Figure 2 As shown, the specific steps are as follows: S110: Raw data collection: New energy vehicles transmit the real-time data of GB 32906 to the cloud through the Internet of Vehicles technology via T-box.
[0025] S120: Data format conversion: According to the national standard 32960 protocol, the binary code stream data is converted into data in json string format, for example {"speed":"150"}.
[0026] S130: Data cleaning: removing outliers, null values, etc. in the data.
[0027] S140: Standardized data: Form a real-time data stream with unified format and valid data.
[0028] S200: Define business rule standards according to the new energy vehicle data format, and flexibly set rule files through a visual interface, such as Figure 3 As shown, the specific steps are as follows: S210: Determine the business rule standard: define the business rule to be determined by the vehicle signal threshold, and multiple signals can be combined; determine the signal range to be the vehicle signal range determined by the data format of S120, and the comparison operators can use >, >=, <, <=, ==, !, and the logical operators can use &&, ||, !. For example: set the speeding rule: speed>=120, which means that when the vehicle speed is greater than 120 km / h, the speeding warning data is extracted.
[0029] S220: Setting business rules through a visual interface: Business rules can be flexibly created, modified, and deleted through a visual interface.
[0030] S230: Generate business rule file: convert the business rules into a file format executable by the Drool rule engine to facilitate system call and execution.
[0031] S300: Introduce the standardized real-time data stream into the Drool rule engine and match it with the business rules. If the match is consistent, then generate warning data. Figure 4 As shown, the specific steps are as follows: S310: The real-time data stream in a unified format generated by S140 is introduced into the work content of the Drool rule engine through Kafka.
[0032] S320: Load the business rule file generated in S230 into the rule base of the Drool rule engine.
[0033] S330: The Drools inference engine performs rule matching in real time based on the incoming data. Once the data meets the business rule conditions, the corresponding business logic or action instructions are automatically triggered, such as filtering out early warning data that matches the conditions.
[0034] This paper proposes a real-time data processing solution for new energy vehicles based on the Drools rule engine. Through its efficient and flexible configuration capabilities and accurate and real-time data processing performance, it provides strong support for the intelligent development of the new energy vehicle industry. In the future development, this solution will play an increasingly important role and promote the new energy vehicle industry to move towards a more intelligent and efficient direction.
[0035] For the aforementioned embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the order of the actions described, because according to the present application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily required by the present application.
[0036] The above embodiments describe the basic principles and main features of the present invention and the advantages of the present invention. Those skilled in the art should understand that the present invention is not limited by the above embodiments, and the above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the changes and modifications made by those skilled in the art shall be within the scope of protection of the appended claims of the present invention without departing from the spirit and scope of the present invention.
Claims
1. A real-time data processing method for new energy vehicles based on Drools rule engine, characterized in that: The following steps are involved: Step S1: Collect national standard data of new energy vehicles and pre-process the data to convert the collected data into data in a standard format; Step S2: define business rule standards according to the new energy vehicle data format obtained after processing, and set the rule file through a visual interface; Step S3: Introduce the standardized real-time data stream into the Drool rule engine, match it with the defined business rules, and generate warning data when the match is consistent.
2. A method for processing real-time data of new energy vehicles based on Drools rule engine as claimed in claim 1, characterized in that: The data collection of step S1 specifically includes: the new energy vehicle transmits the national standard real-time data to the cloud through the telematics processor via the Internet of Vehicles technology.
3. A method for processing real-time data of new energy vehicles based on Drools rule engine as claimed in claim 2, characterized in that: The telematics processor is preferably a T-box.
4. A method for processing real-time data of new energy vehicles based on Drools rule engine as claimed in claim 1, characterized in that: The data preprocessing in step S1 specifically includes: Step S11: data format conversion, converting the binary code stream data into data in json string format according to the corresponding national standard protocol; Step S12: Data cleaning, removing abnormal values and null values in the data; Step S13: Standardize the data to form a real-time data stream with a unified format and valid data.
5. A method for processing real-time data of new energy vehicles based on Drools rule engine as claimed in claim 4, characterized in that: The step S2 comprises the following sub-steps: Step S21: Determine the business rule standard and determine the vehicle signal range through the data format corresponding to the signal range; Step S22: Setting business rules through a visual interface to create, modify and delete business rules; Step S23: convert the business rule format to generate a file executable by the Drool rule engine.
6. A method for processing real-time data of new energy vehicles based on Drools rule engine as claimed in claim 5, characterized in that: The step S21 determines the business rule standard specifically by: judging the business rule by the vehicle signal quantity threshold, and also includes judging by a combination of multiple signals.
7. A method for processing real-time data of new energy vehicles based on Drools rule engine as claimed in claim 6, characterized in that: The step S3 comprises the following sub-steps: Step S31: The real-time data stream with a unified format generated in step S13 is introduced into the work content of the Drool rule engine through Kafka; Step S32: Load the business rule file generated in step S23 into the rule base of the Drool rule engine; Step S33: The Drools inference engine performs rule matching in real time based on the incoming data, and automatically triggers the corresponding business logic or action instructions when the data meets the business rule conditions.