Rule engine execution method and device, vehicle, electronic equipment and storage medium

By filtering and storing signals different from previous signal data in the vehicle rule engine and only performing useful signal data, the inefficiency problem caused by the vehicle rule engine due to processing useless data is solved, and resource optimization and security guarantee are achieved.

CN120429043APending Publication Date: 2025-08-05BEIJING CO WHEELS TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410167185.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-02-05
Publication Date
2025-08-05

AI Technical Summary

Technical Problem

During operation, the vehicle rules engines are wasted computing resources and inefficient operation due to processing a large number of useless vehicle data signals.

Method used

By obtaining the signal data required to execute the target rule within the first time period, it is determined whether it is the same as the signal data obtained earlier. If it is different, the target rule will be stored and executed to realize the filtering and subscription of the signal data.

Benefits of technology

It reduces the operating burden of the rule engine, improves its operating efficiency, avoids the waste of computing resources, and can handle vehicle signals and events in real time to ensure driving safety.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120429043A_ABST
    Figure CN120429043A_ABST
Patent Text Reader

Abstract

The invention discloses a rule engine execution method and device, a vehicle, electronic equipment and a storage medium, and relates to the technical field of vehicles, and the method comprises the steps: obtaining first target signal data needed for executing a target rule in a first time period; judging whether the first target signal data is the same as second target signal data acquired in advance or not, wherein the second target signal data is signal data acquired in a second time period and required for executing a target rule; if the first target signal data is different from the second target signal data, storing the first target signal data; and calling the first target signal data to execute the target rule. Compared with the prior art, the method has the advantages that the first target signal data can be stored only under the condition that the first target signal data is determined to be different from the second target signal data, and the first target signal data is used for executing the target rule, so that the signal data is screened, and the operation burden of the rule engine is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of vehicle technology, and in particular to a method, device, vehicle, electronic device, and storage medium for executing a rule engine. Background Art

[0002] At present, the vehicle rule engine often obtains a massive amount of vehicle signal data during operation, and a large amount of vehicle signal data is stored in the vehicle rule engine, which will increase the burden of the vehicle rule engine. For example: the vehicle rule engine continuously obtains a large amount of vehicle data signals, and there are many useless vehicle data signals in the continuously obtained vehicle data signals. After the useless vehicle data signals are subscribed to by the vehicle rule engine, the vehicle rule engine processes the useless vehicle data signals, thereby increasing the burden of the vehicle rule engine and causing a waste of computing resources, which in turn leads to the problem of low operating efficiency of the vehicle rule engine. Summary of the Invention

[0003] The present disclosure provides a method, apparatus, vehicle, electronic device, and storage medium for executing a rule engine, the primary purpose of which is to address the current problem of low operational efficiency of vehicle-mounted rule engines.

[0004] According to a first aspect of the present disclosure, a method for executing a rule engine is provided, comprising:

[0005] Acquire first target signal data required to execute the target rule within a first time period;

[0006] determining whether the first target signal data is identical to previously acquired second target signal data, where the second target signal data is signal data acquired within a second time period and required for executing the target rule;

[0007] If the first target signal data is different from the second target signal data, storing the first target signal data;

[0008] The first target signal data is called to execute the target rule.

[0009] Optionally, calling the first target signal data to execute the target rule includes:

[0010] Determining whether the first target signal data is signal data required by other rules other than the target rule based on a preset signal rule mapping relationship, wherein the preset rule signal mapping relationship is a relationship in which at least one signal data is used in at least one rule;

[0011] If it is determined that the first target signal data is only the signal data required for executing the target rule, performing rule judgment on the first target signal data and the target rule to obtain a first target judgment result;

[0012] Determine whether to update the execution state of the first target program according to the first target judgment result, and the first target program subscribes to the target rule through a first preset interface function.

[0013] Optionally, after determining whether the first target signal data is signal data required by other rules other than the target rule based on the preset signal rule mapping relationship, the method further includes:

[0014] If the first target signal data is also signal data required by other rules in addition to the target rule, performing rule judgment on the first target signal data and the other rules to obtain a second target judgment result;

[0015] Determine whether to update the execution state of the second target program according to the second target judgment result, and the second target program subscribes to the other rules through a second preset interface function.

[0016] Optionally, performing rule judgment on the first target signal data and the target rule includes:

[0017] Determining whether the first target signal data satisfies a first preset condition included in the target rule, and obtaining the first target determination result;

[0018] The determining whether to update the execution state of the first target program according to the first target judgment result includes:

[0019] determining whether a third target determination result corresponding to the second target signal data is the same as the first target determination result, the third target determination result being obtained by determining whether the second target signal data satisfies the first preset condition included in the target rule within the second time period;

[0020] When it is determined that the third target judgment result is different from the first target judgment result, the execution state of the first target program is updated.

[0021] Optionally, after determining whether a third target determination result corresponding to the second target signal data is the same as the first target determination result, the method includes:

[0022] When it is determined that the third target judgment result is the same as the first target judgment result, the execution state of the first target program is continued to be maintained.

[0023] Optionally, performing rule judgment on the first target signal data and the other rules includes:

[0024] Determining whether the first target signal data satisfies a second preset condition included in the other rules, and obtaining a second target determination result;

[0025] The determining whether to update the execution state of the second target program according to the second target judgment result includes:

[0026] determining whether a fourth target judgment result corresponding to the second target signal data is the same as the second target judgment result, the fourth target judgment result being obtained by determining whether the second target signal data satisfies the second preset condition included in the other rules within the second time period;

[0027] When it is determined that the fourth target judgment result is different from the second target judgment result, the execution state of the second target program is updated.

[0028] Optionally, after determining whether a fourth target determination result corresponding to the second target signal data is the same as the second target determination result, the method includes:

[0029] When it is determined that the fourth target judgment result is the same as the second target judgment result, the execution state of the second target program is continued to be maintained.

[0030] According to a second aspect of the present disclosure, a device for executing a rule engine is provided, comprising:

[0031] an acquiring unit, configured to acquire first target signal data required for executing the target rule within a first time period;

[0032] a determination unit, configured to determine whether the first target signal data is identical to previously acquired second target signal data, where the second target signal data is signal data acquired within a second time period and required for executing the target rule;

[0033] a storage unit, configured to store the first target signal data when the first target signal data is different from the second target signal data;

[0034] An execution unit is configured to call the first target signal data to execute the target rule.

[0035] Optionally, the execution unit includes:

[0036] a first determination module, configured to determine whether the first target signal data is signal data required by a rule other than the target rule based on a preset signal rule mapping relationship, wherein the preset rule signal mapping relationship is a relationship in which at least one signal data is used in at least one rule;

[0037] a second judgment module, configured to, when determining that the first target signal data is signal data required for executing the target rule, perform rule judgment on the first target signal data and the target rule to obtain a first target judgment result;

[0038] A determination module is used to determine whether to update the execution state of a first target program according to the first target judgment result, and the first target program subscribes to the target rule through a first preset interface function.

[0039] Optionally, the second judgment module is further configured to:

[0040] When the first target signal data is also signal data required by other rules in addition to the target rule, performing rule judgment on the first target signal data and the other rules to obtain a second target judgment result;

[0041] The determination module is further configured to determine whether to update the execution state of a second target program according to the second target judgment result, and the second target program subscribes to the other rules through a second preset interface function.

[0042] Optionally, the second judgment module is further configured to:

[0043] Determining whether the first target signal data satisfies a first preset condition included in the target rule, and obtaining the first target determination result;

[0044] The determining module is further configured to:

[0045] determining whether a third target determination result corresponding to the second target signal data is the same as the first target determination result, the third target determination result being obtained by determining whether the second target signal data satisfies the first preset condition included in the target rule within the second time period;

[0046] When it is determined that the third target judgment result is different from the first target judgment result, the execution state of the first target program is updated.

[0047] Optionally, the determining module is further configured to:

[0048] When it is determined that the third target judgment result is the same as the first target judgment result, the execution state of the first target program is continued to be maintained.

[0049] Optionally, the second judgment module is further configured to:

[0050] Determining whether the first target signal data satisfies a second preset condition included in the other rules, and obtaining a second target determination result;

[0051] The determining module is further configured to:

[0052] determining whether a fourth target judgment result corresponding to the second target signal data is the same as the second target judgment result, the fourth target judgment result being obtained by determining whether the second target signal data satisfies the second preset condition included in the other rules within the second time period;

[0053] When it is determined that the fourth target judgment result is different from the second target judgment result, the execution state of the second target program is updated.

[0054] Optionally, the determining module is further configured to:

[0055] When it is determined that the fourth target judgment result is the same as the second target judgment result, the execution state of the second target program is continued to be maintained.

[0056] According to a third aspect of the present disclosure, a vehicle is provided, comprising the apparatus for executing the rule engine according to the second aspect.

[0057] According to a fourth aspect of the present disclosure, there is provided an electronic device, including:

[0058] at least one processor; and

[0059] a memory communicatively connected to the at least one processor; wherein,

[0060] The memory stores instructions that can be executed by the at least one processor. The instructions are executed by the at least one processor to enable the at least one processor to perform the method described in the first aspect.

[0061] According to a fifth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the method described in the first aspect.

[0062] According to a sixth aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the method as described in the first aspect above.

[0063] The present disclosure provides a method, apparatus, vehicle, electronic device, and storage medium for executing a rule engine, which obtains first target signal data required for executing a target rule within a first time period; determines whether the first target signal data is identical to second target signal data previously obtained, where the second target signal data is signal data required for executing the target rule obtained within a second time period; if the first target signal data is not identical to the second target signal data, the first target signal data is stored; and the first target signal data is called to execute the target rule. Compared with related technologies, by obtaining the first target signal data required for executing the target rule within a first time period, determining whether the first target signal data is identical to the second target signal data previously obtained, it is determined whether the first target signal data has changed compared to the second target signal data. Only when it is determined that the first target signal data is not identical to the second target signal data, the first target signal data will be subscribed, and the target rule will be executed using the first target signal data, thereby achieving filtered subscription of signal data, thereby reducing the burden of rule engine operation and improving its efficiency.

[0064] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] The accompanying drawings are provided to facilitate a better understanding of the present invention and do not constitute a limitation of the present disclosure.

[0066] Figure 1 A flowchart of a rule engine execution method provided by an embodiment of the present disclosure;

[0067] Figure 2 A flowchart of another rule engine execution method provided by an embodiment of the present disclosure;

[0068] Figure 3 A schematic diagram of a process for sending a target rule configuration file to a vehicle end according to an embodiment of the present disclosure;

[0069] Figure 4 A schematic diagram of the structure of a rule engine execution device provided in an embodiment of the present disclosure;

[0070] Figure 5 A schematic diagram of another rule engine execution device provided in an embodiment of the present disclosure

[0071] Figure 6 A schematic block diagram of an exemplary electronic device 400 provided for an embodiment of the present disclosure. DETAILED DESCRIPTION

[0072] The following description of exemplary embodiments of the present disclosure is made in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding. These details should be considered as merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0073] The following describes the method, apparatus, vehicle, electronic device, and storage medium for executing a rule engine according to an embodiment of the present disclosure with reference to the accompanying drawings.

[0074] Figure 1 A flowchart of a rule engine execution method provided in an embodiment of the present disclosure.

[0075] like Figure 1 As shown, the method comprises the following steps:

[0076] Step 101, obtaining first target signal data required to execute a target rule within a first time period;

[0077] As a refinement of the above step 101, in order to obtain the data source required to execute the target rule, namely the first target signal data, the first target signal data is acquired. The target rule is a rule defined in the rule engine, and the rule engine includes but is not limited to only the target rule. The first time period is a certain time range. The embodiment of the present disclosure does not limit the time range corresponding to the first time period.

[0078] Step 102, determining whether the first target signal data is identical to previously acquired second target signal data, where the second target signal data is signal data acquired within a second time period and required for executing the target rule;

[0079] As a refinement of the above-mentioned step 102, in order to determine whether the first target signal data obtained in the first time period has changed compared with the second target signal data obtained in the second time period, the content of the first target signal data packet is determined to be the same as the content of the second target data packet, thereby achieving the determination of whether the first target signal data has changed compared with the second target signal data. In addition, the second target signal data is the signal data required to execute the target rule obtained in the second time period. It should be understood that the signal data includes but is not limited to being obtained in real time and used for the execution of the target rule. Therefore, the first target signal data and the second target signal data are essentially the same type of signal data obtained in different time periods. The second time period represents a time range. This embodiment does not limit the time range represented by the second time period.

[0080] Step 103: If the first target signal data is different from the second target signal data, storing the first target signal data;

[0081] As a refinement of step 103, in order to enable the rule engine to filter the signal data and subscribe to the filtered signal data, this embodiment stores the first target signal data when it is determined that the first target signal data is different from the second target signal data. That is, when the first target signal data changes compared to the second target signal data, the first target signal data is subscribed to. To facilitate understanding of the contents involved in the above steps, this embodiment provides an exemplary description. For example, a vehicle speed signal is continuously collected, and by comparing the values of the speed signals collected in two adjacent time periods to see whether they are the same, it is determined whether the vehicle speed in the previous time period has changed from the vehicle speed in the next time period. The speed signal in the previous time period has been stored in the rule engine. When the speed signal in the next time period changes from the speed signal in the previous time period, the speed signal in the next time period is used to update the speed signal in the previous time period, thereby filtering out useful signal data, thereby reducing the burden on the rule engine to process signal data and improving its operating efficiency. The speed signal is the signal type corresponding to the first target signal data and the second target signal data. The aforementioned exemplary description is merely exemplary and does not constitute a limitation of the present disclosure. For example, the vehicle speed signal mentioned above may be replaced by any other type of signal data. Therefore, the aforementioned exemplary description of the vehicle speed signal does not constitute a limitation of the present disclosure.

[0082] Step 104: Call the first target signal data to execute the target rule.

[0083] As a refinement of the above step 104, in order to realize the execution of the target rule, after completing the subscription to the first target signal data in step 103, the first target signal data can be called to execute the target rule, so that the program subscribed to the target rule can run normally.

[0084] The present disclosure provides a method for executing a rule engine, which includes obtaining first target signal data required for executing a target rule within a first time period; determining whether the first target signal data is identical to the second target signal data previously obtained, wherein the second target signal data is the signal data required for executing the target rule obtained within the second time period; if the first target signal data is different from the second target signal data, storing the first target signal data; and calling the first target signal data to execute the target rule. Compared with related technologies, by obtaining the first target signal data required for executing the target rule within the first time period, determining whether the first target signal data is identical to the second target signal data previously obtained, to determine whether the first target signal data has changed compared to the second target signal data, the first target signal data will be subscribed only when it is determined that the first target signal data is different from the second target signal data, and the target rule will be executed using the first target signal data, thereby realizing the filtering and subscription of signal data, thereby reducing the burden of the rule engine operation and improving its operation efficiency.

[0085] In order to clearly illustrate the specific process of calling the first target signal data to execute the target rule, Figure 2 A flowchart of another rule engine execution method provided in an embodiment of the present disclosure is shown as follows: Figure 2 As shown, including:

[0086] Step 201: determining whether the first target signal data is signal data required by other rules other than the target rule based on a preset signal rule mapping relationship, wherein the preset rule signal mapping relationship is a relationship in which at least one signal data is used in at least one rule;

[0087] As a refinement of the above-mentioned step 201, in order to determine whether the first target signal data is used by other rules in addition to the target rule, it is judged based on the preset signal rule mapping relationship whether the first target signal data is the signal data required for other rules other than the target rule, that is, several rules using the first target signal data are queried through the preset signal rule mapping relationship, so as to determine whether the first target signal data is the signal data required for other rules other than the target rule. The preset rule signal mapping relationship is a relationship in which at least one signal data is used in at least one rule, and the target rule and the other rules are two rules of different types.

[0088] To more clearly illustrate the preset rule mapping relationship, this embodiment provides an exemplary description. For example, signal data A and signal data B are used in rule 1; signal data B and signal data C are used in rule 2. The preset rule mapping relationship is that signal data A is mapped to rule 1; signal data B is mapped to both rule 1 and rule 2; and signal data C is mapped to rule 2.

[0089] Step 202: If it is determined that the first target signal data is only the signal data required for executing the target rule, then the first target signal data is subjected to rule judgment with the target rule to obtain a first target judgment result;

[0090] As a refinement of step 202, to conserve computing resources and prevent unnecessary rule evaluation, when the first target signal data differs from the second target signal data, rule evaluation is performed only on the rules that utilize the first target signal data. Furthermore, when it is determined that the first target signal data is utilized solely by the target rule, rule evaluation is performed only on the target rule to obtain the first target evaluation result. By avoiding full rule evaluation, significant computing resources can be saved and the operational efficiency of the rule engine improved.

[0091] Step 203: Determine whether to update the execution state of the first target program according to the first target judgment result, and the first target program subscribes to the target rule through a first preset interface function.

[0092] As a refinement of the above-mentioned step 203, in order to further save computing resources and prevent unnecessary updates to the execution status of the first target program, whether to update the execution status of the first target program is determined based on the first target judgment result. The first target program is a program preset on the vehicle side, and the first target program can subscribe to the target rule based on the first preset interface function. The first preset interface function is a predefined interface function, which is called by the first target program to subscribe to the target rule. In addition, the content defined in the preset interface function includes: client unique identifier, callback function, rule identifier, rule subscription method, and function body. The rule subscription method mainly defines the way in which the first target program subscribes to the target rule, for example: the target rule can be periodically subscribed at preset time intervals or whether to subscribe to the target rule can be determined based on the first target program.

[0093] As a refinement of the above embodiment, after executing step 201 to determine whether the first target signal data is signal data required by other rules other than the target rule based on the preset signal rule mapping relationship, the method can also adopt but is not limited to the following implementation methods, for example: if the first target signal data is also signal data required by other rules other than the target rule, the first target signal data is subjected to rule judgment with the other rules to obtain a second target judgment result; based on the second target judgment result, it is determined whether to update the execution status of the second target program, and the second target program subscribes to the other rules through a second preset interface function.

[0094] As a refinement of the above embodiment, in order to further save computing resources and prevent unnecessary updates to the execution status of the second target program, after the first target signal data changes compared to the second target signal data, if the first target signal data is also signal data required by other rules in addition to the target rule, in addition to performing rule judgment on the target rule using the first target signal data, it is also necessary to perform rule judgment on the other rules, and the first target signal data and the other rules are subjected to rule judgment to obtain the second target judgment result. By avoiding full rule judgment, a large amount of computing resources can be saved and the operating efficiency of the rule engine can be improved; based on the second target judgment result, it is determined whether to update the execution status of the second target program. The second target program is a program preset on the vehicle side, and the second target program can subscribe to the other rules based on the second preset interface function. The second preset interface function is a predefined interface function that is called by the second target program to subscribe to the other rules. In addition, the content defined in the preset interface function includes: a client unique identifier, a callback function, a rule identifier, a rule subscription method, and a function body. The rule subscription method mainly defines the method in which the second target program subscribes to the other rules, for example, the other rules may be subscribed to periodically at preset intervals or whether to subscribe to the other rules may be determined based on the second target program.

[0095] As a refinement of the above embodiment, when performing rule judgment on the first target signal data and the target rule as described in step 202, the following implementation methods may also be adopted but not limited to, for example: judging whether the first target signal data meets the first preset condition included in the target rule to obtain the first target judgment result; when performing step 203, determining whether to update the execution status of the first target program based on the first target judgment result, the following implementation methods may also be adopted but not limited to, for example: judging whether the third target judgment result corresponding to the second target signal data is the same as the first target judgment result, and the third target judgment result is obtained by judging whether the second target signal data meets the first preset condition included in the target rule within the second time period; when it is determined that the third target judgment result is different from the first target judgment data result, the execution status of the first target program is updated.

[0096] As a refinement of the above embodiment, in order to facilitate understanding of the process involved in the above detailed description, the embodiment of the present disclosure provides an exemplary description, for example: the execution content corresponding to the target rule is to determine whether the vehicle speed is greater than or equal to 90km / h, and whether the vehicle speed is greater than or equal to 90km / h is the first preset condition in the target rule. By determining whether the first target signal data meets the first preset condition, that is, determining whether the vehicle speed corresponding to the subscribed vehicle speed signal is greater than or equal to 90km / h, the vehicle speed signal refers to the first target signal data, then the first target judgment result includes two results: the vehicle speed signal is greater than or equal to 90km / h or the vehicle speed signal is less than 90km / h, that is, the first target judgment result includes two results: the first target signal meets the first preset condition or the first target signal data does not meet the first preset condition. Furthermore, the second target signal data acquired during the second time period is compared with the first preset condition to obtain two results: the second target signal data satisfies or does not satisfy the first preset condition. When the first target signal data satisfies the first preset condition and the second target signal data does not satisfy the first preset condition, the first target judgment result is different from the third target judgment result. Furthermore, when the first target signal data does not satisfy the first preset condition and the second target signal data satisfies the first preset condition, the first target judgment result is also different from the third target judgment result. If it is determined that the third target judgment result is different from the first target judgment data result, the execution state of the first target program is updated, i.e., the first target program is refreshed. The first target program then determines the operation to be performed based on the different judgment results. For example, if the first target program controls the closing of the vehicle windows, the first target program determines whether the window closing operation is to be performed based on the different judgment results. Based on the above steps, the number of updates to the first target program can be reduced, thereby reducing the waste of computing resources. The above exemplary description is merely for the purpose of more clearly illustrating this embodiment and does not constitute a limitation of this embodiment.

[0097] As a refinement of the above embodiment, after determining whether the third target judgment result corresponding to the second target signal data is the same as the first target judgment result, the method can also adopt but is not limited to the following implementation method, for example: when it is determined that the third target judgment result is the same as the first target judgment result, continue to maintain the execution status of the first target program.

[0098] As a refinement of the above embodiment, combined with the above exemplary description, when the first target signal data satisfies the first preset condition and the second target signal data satisfies the first preset condition, the first target judgment result is the same as the third target judgment result, and when the first target signal data does not satisfy the first preset condition and the second target signal data does not satisfy the first preset condition, the first target judgment result is also the same as the third target judgment result; when it is determined that the third target judgment result is the same as the first target judgment result, the execution status of the first target program continues to be maintained, that is, in this case there is no need to refresh the execution status of the first target program to save computing resources.

[0099] As a refinement of the above embodiment, when executing the rule judgment between the first target signal data and the other rules, the following implementation method may also be adopted but not limited to, for example: judging whether the first target signal data meets the second preset condition included in the other rules to obtain the second target judgment result; when executing the determination of whether to update the execution status of the second target program based on the second target judgment result, the following implementation method may also be adopted but not limited to, for example: judging whether the fourth target judgment result corresponding to the second target signal data is the same as the second target judgment result, the fourth target judgment result is obtained by judging whether the second target signal data meets the second preset condition included in the other rules within the second time period; when it is determined that the fourth target judgment result is not the same as the second target judgment result, the execution status of the second target program is updated.

[0100] As a refinement of the above embodiment, in order to facilitate understanding of the process involved in the above detailed description, the embodiment of the present disclosure provides an exemplary description, for example: the execution content corresponding to the other rules is to determine whether the vehicle speed is greater than or equal to 15km / h, and whether the vehicle speed is greater than or equal to 15km / h is the second preset condition in the other rules. By determining whether the first target signal data meets the first preset condition, that is, determining whether the vehicle speed corresponding to the subscribed vehicle speed signal is greater than or equal to 15km / h, the vehicle speed signal refers to the first target signal data, then the first target judgment result includes two results: the vehicle speed signal is greater than or equal to 15km / h or the vehicle speed signal is less than 15km / h, that is, the first target judgment result includes two results: the first target signal meets the first preset condition or the first target signal data does not meet the first preset condition. Furthermore, the second target signal data acquired during the second time period is compared with the second preset condition to obtain two results: the second target signal data satisfies or does not satisfy the second preset condition. When the first target signal data satisfies the second preset condition and the second target signal data does not, the second target judgment result differs from the fourth target judgment result. Furthermore, when the first target signal data does not satisfy the second preset condition and the second target signal data does satisfy the second preset condition, the second target judgment result differs from the fourth target judgment result. If the fourth target judgment result differs from the second target judgment data, the execution state of the second target program is updated, i.e., the second target program is refreshed. The second target program then determines the required operation based on the different judgment results. For example, if the second target program issues a speed limit warning when reversing, the second target program determines whether the speed limit warning should be executed based on the different judgment results. Based on the above steps, the number of updates to the second target program can be reduced, thereby reducing the waste of computing resources. The above exemplary description is merely for the purpose of more clearly illustrating this embodiment and does not constitute a limitation of this embodiment.

[0101] As a refinement of the above embodiment, after executing the judgment of whether the fourth target judgment result corresponding to the second target signal data is the same as the second target judgment result, the method can adopt but is not limited to the following implementation method, for example: when it is determined that the fourth target judgment result is the same as the second target judgment result, continue to maintain the execution status of the second target program.

[0102] As a refinement of the above embodiment, combined with the above exemplary description, when the first target signal data satisfies the second preset condition and the second target signal data satisfies the second preset condition, the second target judgment result is the same as the fourth target judgment result, and when the first target signal data does not satisfy the second preset condition and the second target signal data does not satisfy the second preset condition, the second target judgment result is also the same as the fourth target judgment result; when it is determined that the second target judgment result is the same as the fourth target judgment result, the execution status of the second target program continues to be maintained, that is, in this case there is no need to refresh the execution status of the second target program to save computing resources.

[0103] As a refinement of the above embodiment, after executing step 102 to determine whether the first target signal data is the same as the second target signal data obtained previously, the method can also adopt but is not limited to the following implementation method, for example: if the first target signal data is the same as the second target signal data, then give up subscribing to the first target signal data.

[0104] As a refinement of the above embodiment, if the first target signal data obtained in the later time period does not change compared with the second target signal data obtained previously, the first target signal data will not be subscribed to by the rule engine, that is, the rule engine does not receive the first target signal data, thereby realizing the screening of signal data to reduce the amount of signal data that needs to be processed.

[0105] As a refinement of the above embodiment, before executing step 101 to obtain the first target signal data required to execute the target rule, the method can also adopt but is not limited to the following implementation methods, for example: receiving a target rule configuration file, the target rule configuration file is a toml file generated on the target server; parsing the target rule configuration file to obtain the target rule.

[0106] In order to facilitate understanding of the process of the above embodiment, this embodiment provides an exemplary description, for example: the user sets rules in the visual interface of the website, and the rules set by the user are converted into target rule configuration files by the server in the cloud. The target server in the cloud pushes the target rule configuration file based on the vehicle type and vehicle software version; after the vehicle receives the configuration file, it is verified to ensure that the configuration is complete and valid. The target configuration file is parsed into structured data by the rule parser on the vehicle side, and the structured data is compared with the original rule base data. Then, the rule base data is refreshed to obtain the target rules. By pushing the rules to the vehicle through the method of sending the target rule configuration file from the cloud, invalid or unreasonable rules can be modified in a timely manner. In the past, when there was no rule engine, if the rules needed to be modified, the code often had to be modified, which was a lot of work, and it had to be followed by the car OTA upgrade, which had a long cycle and was very inconvenient.

[0107] To understand the above process, Figure 3 This is a flow chart of sending a target rule configuration file to a vehicle end according to an embodiment of the present disclosure. To illustrate the content format included in the target rule configuration file, this embodiment provides a specific code display as shown below:

[0108]

[0109]

[0110] The code shown includes three rule examples. The first rule example has an id of 1 and a name of test. The corresponding BuckleSts_MSG_BukIndicator and BuckleSts_MSG_PsngBukSts in the context item are different types of signals. When BuckleSts_MSG_BukIndicator satisfies the condition BuckleSts_MSG_BukIndicator==1 or the BuckleSts_MSG_PsngBukSts signal satisfies the condition BuckleSts_MSG_PsngBukSts==3, the operation in action is executed. The operations in action include logging, sending data to the cloud with a value of 1, and sending the signal NvhDataControl_SRV_VoiceDataSwitchReq or NvhDataStatus_MSG_VoiceDataSwitchSts to drive the target program. The second rule example has an id of 2 and a name of test2. The corresponding content of the context item and the execution condition condition are the same as those of the first rule example and will not be repeated here. The third rule has an ID of 4 and is named rule_average1. "Average" describes the purpose of this rule: it will be triggered only when the average value of BuckleSts_MSG_PsngSBRSts is greater than 100. "timer" indicates the timer or delay for triggering the rule, with a value of 1000. "sampling_time" indicates the sampling interval, with a value of 10, indicating that the rule will stop after checking whether the condition meets the timer value within 10 unit intervals.

[0111] As a refinement of the above embodiment, when it is determined that the third target judgment result is different from the first target judgment result, the method can also adopt but is not limited to the following implementation methods, for example: printing the target log corresponding to the execution of the target rule; and determining whether to upload the target log to the target server based on the target rule.

[0112] As a refinement of the above embodiment, when it is determined that the fourth target judgment result is different from the second target judgment result, the method can also adopt but is not limited to the following implementation methods, for example: printing the target log corresponding to the execution of the other rules; and determining whether to upload the target log to the target server based on the other rules.

[0113] In summary, this embodiment can achieve the following effects:

[0114] 1. By obtaining the first target signal data required to execute the target rule within a first time period, it is determined whether the first target signal data is the same as the second target signal data obtained previously, so as to determine whether the first target signal data has changed compared with the second target signal data. Only when it is determined that the first target signal data is different from the second target signal data, the first target signal data will be subscribed, and the target rule will be executed using the first target signal data, thereby realizing the screening and subscription of signal data, thereby reducing the burden of the rule engine operation and improving its operation efficiency.

[0115] 2. It avoids redundant state refreshes triggered even when signal data has not changed, greatly reduces the waste of computing resources, and achieves optimal resource allocation.

[0116] 3. By synchronizing signal data to the cloud in real time, the system can obtain the vehicle's operating status in real time, promptly detect and warn of potential faults, thereby better ensuring driving safety.

[0117] 4. The rules engine can process and respond to various vehicle signals and events in real time without human intervention. Furthermore, through flexible configuration and updating of rules, the vehicle can better meet the user's personalized needs and improve driving convenience and comfort.

[0118] 5. By distributing configurations in real time from the cloud, the vehicle-side rule base can be updated instantly, allowing the vehicle to operate according to the latest rules. This ensures flexibility and timeliness of vehicle behavior while avoiding the hassle of complex manual configuration.

[0119] Corresponding to the above-mentioned rule engine execution method, the present invention also provides a rule engine execution device. Since the device embodiment of the present invention corresponds to the above-mentioned method embodiment, details not disclosed in the device embodiment can be referred to the above-mentioned method embodiment and will not be repeated in this invention.

[0120] Figure 4 A schematic diagram of a structure of a rule engine execution device provided in an embodiment of the present disclosure, such as Figure 5 As shown, including:

[0121] An acquiring unit 31 is configured to acquire first target signal data required for executing a target rule within a first time period;

[0122] a determination unit 32 for determining whether the first target signal data is identical to previously acquired second target signal data, where the second target signal data is signal data acquired within a second time period and required for executing the target rule;

[0123] a storage unit 33, configured to store the first target signal data when the first target signal data is different from the second target signal data;

[0124] The execution unit 34 is configured to call the first target signal data to execute the target rule.

[0125] The rule engine execution device provided by the present disclosure obtains the first target signal data required for executing the target rule within a first time period; determines whether the first target signal data is the same as the second target signal data previously obtained, the second target signal data being the signal data required for executing the target rule obtained within the second time period; if the first target signal data is not the same as the second target signal data, the first target signal data is stored; and the first target signal data is called to execute the target rule. Compared with the related art, by obtaining the first target signal data required for executing the target rule within the first time period, determining whether the first target signal data is the same as the second target signal data previously obtained, to determine whether the first target signal data has changed compared to the second target signal data, the first target signal data will be subscribed only when it is determined that the first target signal data is not the same as the second target signal data, and the target rule will be executed using the first target signal data, thereby realizing the screening and subscription of signal data, thereby reducing the burden of the rule engine operation and improving its operation efficiency.

[0126] Figure 5 A schematic diagram of a structure of a rule engine execution device provided in an embodiment of the present disclosure, such as Figure 5 As shown, the execution unit 34 includes:

[0127] A first determination module 341 is configured to determine whether the first target signal data is signal data required by a rule other than the target rule based on a preset signal rule mapping relationship, wherein the preset rule signal mapping relationship is a relationship in which at least one signal data is used in at least one rule;

[0128] The second judgment module 342 is configured to, when determining that the first target signal data is the signal data required for executing the target rule, perform rule judgment on the first target signal data and the target rule to obtain a first target judgment result;

[0129] The determination module 343 is configured to determine whether to update the execution state of a first target program according to the first target judgment result, wherein the first target program subscribes to the target rule through a first preset interface function.

[0130] Furthermore, in a possible implementation of the embodiment of the present disclosure, as Figure 5As shown, the second judgment module 342 is further used to:

[0131] When the first target signal data is also signal data required by other rules in addition to the target rule, performing rule judgment on the first target signal data and the other rules to obtain a second target judgment result;

[0132] The determination module is further configured to determine whether to update the execution state of a second target program according to the second target judgment result, and the second target program subscribes to the other rules through a second preset interface function.

[0133] Furthermore, in a possible implementation of the embodiment of the present disclosure, as Figure 5 As shown, the second judgment module 342 is further used to:

[0134] Determining whether the first target signal data satisfies a first preset condition included in the target rule, and obtaining the first target determination result;

[0135] The determining module 343 is further configured to:

[0136] determining whether a third target determination result corresponding to the second target signal data is the same as the first target determination result, the third target determination result being obtained by determining whether the second target signal data satisfies the first preset condition included in the target rule within the second time period;

[0137] When it is determined that the third target judgment result is different from the first target judgment result, the execution state of the first target program is updated.

[0138] Furthermore, in a possible implementation of the embodiment of the present disclosure, as Figure 5 As shown, the determining module 343 is further configured to:

[0139] When it is determined that the third target judgment result is the same as the first target judgment result, the execution state of the first target program is continued to be maintained.

[0140] Furthermore, in a possible implementation of the embodiment of the present disclosure, as Figure 5 As shown, the second judgment module 342 is further used to:

[0141] Determining whether the first target signal data satisfies a second preset condition included in the other rules, and obtaining a second target determination result;

[0142] The determining module 343 is further configured to:

[0143] determining whether a fourth target judgment result corresponding to the second target signal data is the same as the second target judgment result, the fourth target judgment result being obtained by determining whether the second target signal data satisfies the second preset condition included in the other rules within the second time period;

[0144] When it is determined that the fourth target judgment result is different from the second target judgment result, the execution state of the second target program is updated.

[0145] Furthermore, in a possible implementation of the embodiment of the present disclosure, as Figure 5 As shown, the determining module 343 is further configured to:

[0146] When it is determined that the fourth target judgment result is the same as the second target judgment result, the execution state of the second target program is continued to be maintained.

[0147] It should be noted that the above explanation of the method embodiment is also applicable to the device of the embodiment of the present disclosure, and the principles are the same, which is no longer limited in the embodiment of the present disclosure.

[0148] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0149] Figure 6 A schematic block diagram of an example electronic device 400 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are provided as examples only and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0150] like Figure 6As shown, the device 400 includes a computing unit 401, which can perform various appropriate actions and processes according to a computer program stored in a ROM (Read-Only Memory) 402 or a computer program loaded from a storage unit 408 into a RAM (Random Access Memory) 403. Various programs and data required for the operation of the device 400 can also be stored in the RAM 403. The computing unit 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An I / O (Input / Output) interface 405 is also connected to the bus 404.

[0151] Various components in device 400 are connected to I / O interface 405, including an input unit 406, such as a keyboard, mouse, etc.; an output unit 407, such as various types of displays, speakers, etc.; a storage unit 408, such as a magnetic disk, optical disk, etc.; and a communication unit 409, such as a network card, modem, wireless communication transceiver, etc. Communication unit 409 allows device 400 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0152] The computing unit 401 can be a variety of general-purpose and / or specialized processing components with processing and computing capabilities. Some examples of the computing unit 401 include, but are not limited to, a CPU (Central Processing Unit), a GPU (Graphic Processing Unit), various specialized AI (Artificial Intelligence) computing chips, various computing units that run machine learning model algorithms, a DSP (Digital Signal Processor), and any suitable processor, controller, microcontroller, etc. The computing unit 401 performs the various methods and processes described above, such as the methods performed by the rule engine. For example, in some embodiments, the methods performed by the rule engine can be implemented as a computer software program that is tangibly embodied in a machine-readable medium, such as the storage unit 408. In some embodiments, part or all of the computer program can be loaded and / or installed on the device 400 via the ROM 402 and / or the communication unit 409. When the computer program is loaded into the RAM 403 and executed by the computing unit 401, one or more steps of the methods described above can be performed. Alternatively, in other embodiments, the computing unit 401 may be configured to execute the aforementioned rule engine execution method in any other appropriate manner (eg, by means of firmware).

[0153] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, FPGAs (Field Programmable Gate Arrays), ASICs (Application-Specific Integrated Circuits), ASSPs (Application-Specific Standard Products), SOCs (System on Chips), CPLDs (Complex Programmable Logic Devices), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special-purpose or general-purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0154] The program code for implementing the method of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0155] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or apparatus. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or apparatus, or any suitable combination of the foregoing. More specific examples of machine-readable storage media may include an electrical connection based on one or more wires, a portable computer disk, a hard disk, RAM, ROM, EPROM (Electrically Programmable Read-Only-Memory) or flash memory, optical fiber, CD-ROM (Compact Disc Read-Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0156] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (Cathode-Ray Tube) or LCD (Liquid Crystal Display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0157] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: LAN (Local Area Network), WAN (Wide Area Network), the Internet, and blockchain networks.

[0158] A computer system may include a client and a server. The client and server are generally remote from each other and typically interact via a communication network. This client-server relationship is established by computer programs running on the respective computers, establishing a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host, a host product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosts and VPS services ("Virtual Private Servers" or simply "VPS"). The server may also be a server in a distributed system or a server integrated with blockchain.

[0159] It's important to note that artificial intelligence (AI) is the study of how computers can simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, and planning). This encompasses both hardware and software technologies. AI hardware technologies generally include sensors, specialized AI chips, cloud computing, distributed storage, and big data processing. AI software technologies primarily encompass computer vision, speech recognition, natural language processing, machine learning / deep learning, big data processing, and knowledge graphs.

[0160] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved. This is not limited herein.

[0161] The above specific embodiments do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure shall be included within the scope of protection of this disclosure.

Claims

1. A rule engine execution method, characterized in that: include: Acquire first target signal data required to execute the target rule within a first time period; determining whether the first target signal data is identical to previously acquired second target signal data, where the second target signal data is signal data acquired within a second time period and required for executing the target rule; If the first target signal data is different from the second target signal data, storing the first target signal data; The first target signal data is called to execute the target rule.

2. The method according to claim 1, characterized in that The calling of the first target signal data to execute the target rule includes: Determining whether the first target signal data is signal data required by other rules other than the target rule based on a preset signal rule mapping relationship, wherein the preset rule signal mapping relationship is a relationship in which at least one signal data is used in at least one rule; If it is determined that the first target signal data is only the signal data required for executing the target rule, performing rule judgment on the first target signal data and the target rule to obtain a first target judgment result; Determine whether to update the execution state of the first target program according to the first target judgment result, and the first target program subscribes to the target rule through a first preset interface function.

3. The method according to claim 2, characterized in that After determining whether the first target signal data is signal data required by other rules other than the target rule based on the preset signal rule mapping relationship, the method further includes: If the first target signal data is also signal data required by other rules in addition to the target rule, performing rule judgment on the first target signal data and the other rules to obtain a second target judgment result; Determine whether to update the execution state of the second target program according to the second target judgment result, and the second target program subscribes to the other rules through a second preset interface function.

4. The method according to claim 2, characterized in that The performing rule judgment on the first target signal data and the target rule includes: Determining whether the first target signal data satisfies a first preset condition included in the target rule, and obtaining the first target determination result; The determining whether to update the execution state of the first target program according to the first target judgment result includes: determining whether a third target determination result corresponding to the second target signal data is the same as the first target determination result, the third target determination result being obtained by determining whether the second target signal data satisfies the first preset condition included in the target rule within the second time period; When it is determined that the third target judgment result is different from the first target judgment result, the execution state of the first target program is updated.

5. The method according to claim 4, characterized in that After determining whether a third target determination result corresponding to the second target signal data is the same as the first target determination result, the method includes: When it is determined that the third target judgment result is the same as the first target judgment result, the execution state of the first target program is continued to be maintained.

6. The method according to claim 3, characterized in that The performing rule judgment on the first target signal data and the other rules includes: Determining whether the first target signal data satisfies a second preset condition included in the other rules, and obtaining a second target determination result; The determining whether to update the execution state of the second target program according to the second target judgment result includes: determining whether a fourth target judgment result corresponding to the second target signal data is the same as the second target judgment result, the fourth target judgment result being obtained by determining whether the second target signal data satisfies the second preset condition included in the other rules within the second time period; When it is determined that the fourth target judgment result is different from the second target judgment result, the execution state of the second target program is updated.

7. The method according to claim 6, characterized in that After determining whether a fourth target determination result corresponding to the second target signal data is the same as the second target determination result, the method includes: When it is determined that the fourth target judgment result is the same as the second target judgment result, the execution state of the second target program is continued to be maintained.

8. A device for executing a rule engine, characterized in that: include: an acquiring unit, configured to acquire first target signal data required for executing the target rule within a first time period; a determination unit, configured to determine whether the first target signal data is identical to previously acquired second target signal data, where the second target signal data is signal data acquired within a second time period and required for executing the target rule; a storage unit, configured to store the first target signal data when the first target signal data is different from the second target signal data; An execution unit is configured to call the first target signal data to execute the target rule.

9. A vehicle, characterized in that: An apparatus comprising the rule engine execution apparatus as claimed in claim 8.

10. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 7.

11. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 7.

12. A computer program product, characterized in that The invention comprises a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 7.