Data processing method and device based on predicate system and electronic control unit

By integrating the predicate system on the vehicle electronic control unit and parsing dynamically updated configuration files and user-defined conditional expressions, the problem of insufficient flexibility in vehicle data processing is solved, an efficient and flexible data processing method is realized, and vehicle data processing is improved. Processing flexibility and efficiency.

CN118689461APending Publication Date: 2024-09-24NEUSOFT REACH AUTOMOBILE TECH (SHENYANG) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410718482.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-04
Publication Date
2024-09-24

AI Technical Summary

Technical Problem

The flexibility of vehicle data processing in the existing technology is insufficient, requiring frequent code modification and compilation to adjust the judgment logic, resulting in low efficiency.

Method used

Integrate the predicate system on the vehicle's electronic control unit and implement data processing methods by parsing dynamically updated configuration files and user-defined conditional expressions to avoid hard-coding the judgment logic in the program and support flexible adjustments and updates.

Benefits of technology

It improves the flexibility and efficiency of vehicle data processing, reduces repeated code writing and compilation operations, supports complex and diverse rules, and meets user-defined needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118689461A
    Figure CN118689461A
Patent Text Reader

Abstract

The invention discloses a data processing method and device based on a predicate system and an electronic control unit. The reader application is integrated with a predicate system, and the compiling language of the predicate system is matched with that of the reader application. The predicate system supports analysis of dynamically updated configuration files and supports analysis of configuration files containing user-defined conditional expressions. In the method, a reader application reads vehicle state data; and calling a self-integrated predicate system to judge whether the target condition expression is met or not. The target condition expression is a condition expression which is obtained after the predicate system analyzes the configuration file and is related to the vehicle state data. And if the target condition expression is satisfied, processing the vehicle state data by adopting a processing mode corresponding to the target condition expression. When the judgment logic needs to be adjusted, a new target condition expression can be obtained through analysis only by adjusting the configuration file, and the flexibility of vehicle data processing is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of data reading, and in particular to a data processing method, device and electronic control unit based on a predicate system. Background Art

[0002] With the development of vehicle intelligence, the number of vehicles has increased significantly. Many vehicle data need to be screened and filtered to trigger specific processing actions. For example, when the charging pile data is abnormal, the abnormal data needs to be uploaded to the cloud. In the above example, the abnormality of the charging pile data needs to be identified through judgment, and the abnormal data is uploaded to the cloud as a triggered data processing action. At present, the way to implement data judgment and processing on the vehicle is to hard-code the judgment logic in the program and then compile and execute it. This method means that once the judgment condition needs to be changed, the code needs to be modified, recompiled and deployed, and then the modified code is executed. This solution leads to the problem of insufficient flexibility in vehicle data processing. Summary of the invention

[0003] Based on the above problems, the present application provides a data processing method, device and electronic control unit based on a predicate system, aiming to improve the flexibility of vehicle data processing.

[0004] The embodiments of the present application disclose the following technical solutions:

[0005] In a first aspect, the present application provides a data processing method based on a predicate system, which is applied to a reader application running on an electronic control unit ECU of a vehicle, wherein the reader application is integrated with a predicate system, and the writing language of the predicate system matches the writing language of the reader application; the method comprises:

[0006] Read vehicle status data;

[0007] By calling the predicate system, it is determined whether a target conditional expression is satisfied; the target conditional expression is a conditional expression related to the vehicle status data obtained after the predicate system parses the configuration file; the predicate system supports parsing dynamically updated configuration files, and supports parsing configuration files containing user-defined conditional expressions;

[0008] If the target condition expression is satisfied, the vehicle state data is processed in a processing method corresponding to the target condition expression.

[0009] In an optional implementation, the data processing method based on the predicate system further includes:

[0010] Determine the data subject of the vehicle status data to be read as the target data subject;

[0011] The step of calling the predicate system to determine whether the target condition expression is satisfied includes:

[0012] Calling the predicate system to query whether the predicate system contains a conditional expression related to the target data subject;

[0013] If it exists, the conditional expression related to the target data subject is used as the target conditional expression to determine whether the target conditional expression is satisfied.

[0014] In an optional implementation, the data processing method based on the predicate system further includes:

[0015] If the predicate system does not contain a conditional expression related to the target data subject, determining whether there is a configuration file to be parsed by the predicate system;

[0016] If there is a configuration file to be parsed by the predicate system, the configuration file to be parsed is parsed by the predicate system;

[0017] If the predicate system parses and obtains a conditional expression related to the target data subject, the conditional expression related to the target data subject is used as a target conditional expression to determine whether the target conditional expression is satisfied.

[0018] In an optional implementation, before reading the vehicle status data, the data processing method based on the predicate system further includes:

[0019] Receive a notification message of data writing; the notification message carries the target data subject where the data writing occurs, and the notification message is used to notify the reader application that a data source has written vehicle status data of the target data subject into the shared memory connected to the reader application;

[0020] Based on the notification message, read the data address of the latest written data of the target data subject from the notification memory created together with the data source;

[0021] The reading of vehicle status data specifically includes:

[0022] The latest written data of the target data subject is read from the shared memory according to the data address.

[0023] In an optional implementation, the structure of the configuration file includes: one or more configuration events; the structure of the configuration event includes: an event identifier, an event name, a data subject, and a predicate; the predicate is used to describe a conditional expression related to the data subject;

[0024] The reading of vehicle status data comprises:

[0025] In response to a call operation on an event trigger interface, determining a target event identifier corresponding to the call operation;

[0026] When the event inspection condition is met, the vehicle status data of the data subject contained in the configuration event corresponding to the target event identifier is read.

[0027] In an optional implementation, the structure of the configuration file includes: one or more configuration events; the structure of the configuration event includes: an event identifier, an event name, a data subject, and a predicate; the predicate is used to describe a conditional expression related to the data subject;

[0028] If the target condition expression is satisfied, the vehicle state data is processed in a processing method corresponding to the target condition expression, including:

[0029] If the target condition expression is satisfied and the configuration event to which the target condition expression belongs has registered an event callback function, the event callback function is used to perform business processing operations on the vehicle status data.

[0030] In an optional implementation, the structure of the configuration file includes: one or more configuration events; the structure of the configuration event includes: an event identifier, an event name, a data subject, and a predicate; the predicate is used to describe a conditional expression related to the data subject; the method further includes:

[0031] Determine the data subject of the vehicle status data to be read as the target data subject;

[0032] Determine a configuration event related to the target data subject as a target configuration event;

[0033] Determine a conditional expression described by a predicate in the target configuration event as a target conditional expression;

[0034] If the target condition expression includes other data topics other than the target data topic, reading the vehicle status data of the other data topics;

[0035] Determine whether the target condition expression is satisfied, including:

[0036] Based on the vehicle status data of the other data subjects, it is determined whether the target conditional expression is satisfied.

[0037] In an optional implementation, the updating of the configuration file includes at least one of the following:

[0038] Add, delete or modify configuration events;

[0039] The modification of the configuration event includes at least one of the following:

[0040] Modification of event identifiers, modification of event names, adjustment of data subjects, or modification of predicates;

[0041] The adjustment of the data subject includes at least one of the following:

[0042] Addition, deletion or modification of data subjects.

[0043] In a second aspect, the present application provides a data processing device based on a predicate system, which is applied to a reader application running on an electronic control unit ECU of a vehicle, wherein the reader application is integrated with a predicate system, and the writing language of the predicate system matches the writing language of the reader application; the device comprises:

[0044] A reading module, used to read vehicle status data;

[0045] A judgment module, used to judge whether a target conditional expression is satisfied by calling the predicate system; the target conditional expression is a conditional expression related to the vehicle status data obtained after the predicate system parses the configuration file; the predicate system supports parsing dynamically updated configuration files, and supports parsing configuration files containing user-defined conditional expressions;

[0046] A processing module is used to process the vehicle status data in a processing method corresponding to the target condition expression if the target condition expression is satisfied.

[0047] A third aspect of the present application provides an electronic control unit, which is arranged on a vehicle, and on which a reader application runs, wherein the reader application is integrated with a predicate system, and the writing language of the predicate system matches the writing language of the reader application;

[0048] The reader application is used to execute the steps of the data processing method based on the predicate system introduced in any implementation manner of the first aspect after the application is run.

[0049] Compared with the prior art, this application has the following beneficial effects:

[0050] In the implementation scenario of the data disposal scheme based on the predicate system provided by the present application, the reader application running on the electronic control unit of the vehicle is integrated with the predicate system, and the writing language of the predicate system matches the writing language of the reader application. The predicate system supports parsing dynamically updated configuration files, and supports parsing configuration files containing user-defined conditional expressions. The data disposal method based on the predicate system includes: the reader application reads the vehicle status data; by calling the predicate system integrated with itself, it is determined whether the target conditional expression is satisfied. Among them, the target conditional expression is the conditional expression related to the vehicle status data obtained after the predicate system parses the configuration file. If the target conditional expression is satisfied, the vehicle status data is disposed of in a disposal method corresponding to the target conditional expression. Since the disposal of the vehicle status data is based on the premise of satisfying the target conditional expression, and the target conditional expression is obtained by the reader application calling the predicate system to parse the configuration file, when the judgment logic needs to be adjusted, only the configuration file needs to be adjusted to parse and obtain the new target conditional expression. This scheme avoids hard-coding the judgment logic in the program, thereby avoiding repeated writing and repeated compilation and execution of the code when adjusting the judgment logic of the data. It can be seen that this scheme can improve the flexibility of vehicle data disposal.

[0051] In addition, the configuration file not only supports dynamic updates, but also supports user-defined conditional expressions, so that the reader application integrated with the predicate system can parse the latest conditional expressions in the dynamically updated configuration file. The parsed conditional expressions can contain user-defined components. Therefore, this solution is more lightweight and user-friendly for user configuration. It not only provides rich rules and supports diversified and complex rules as conditional expressions, but also opens up customized functions for users with diverse needs, thereby improving user configuration needs and meeting user data processing needs to a greater extent.

[0052] In the embodiment of the present application, the writing language of the predicate system integrated into the reader application matches the writing language of the reader application itself. Compared with the general conditional judgment expression implemented by a scripting language (such as Python or lua), it can reduce the performance overhead of the vehicle and improve data processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] In order to more clearly illustrate the embodiments of the present application 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 application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0054] Figure 1AA diagram of an implementation scenario architecture of a data processing method based on a predicate system provided in an embodiment of the present application;

[0055] Figure 1B A diagram of an implementation scenario architecture of another data processing method based on a predicate system provided in an embodiment of the present application;

[0056] Figure 2 A schematic diagram of realizing vehicle status data reading and writing through shared memory provided in an embodiment of the present application;

[0057] Figure 3 A flowchart of a data processing method based on a predicate system provided in an embodiment of the present application;

[0058] Figure 4A A schematic diagram of the structure of a notification memory provided in an embodiment of the present application;

[0059] Figure 4B A schematic diagram of notifying a reader application to read data provided by an embodiment of the present application;

[0060] Figure 5 A schematic diagram of the structure of a data processing device based on a predicate system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0061] With the increase in vehicle data, many data need to be screened and filtered to trigger specific processing actions. The vehicle status data generally includes data reflecting the mechanical performance, electrical performance, safety performance and appearance status of the vehicle. Taking the vehicle status data reflecting safety performance as an example, the vehicle's airbag opening and closing status, lock opening and closing status, window opening and closing status, etc., are related to the safety of the vehicle. For this type of data, it is necessary to report to the vehicle status data monitoring platform (such as a cloud server) when an abnormality is judged to provide safety prompts to vehicle users. In the existing technology, the judgment logic that triggers the execution of data processing is often hard-coded in the program. Once the judgment logic needs to be changed, the code needs to be modified and compiled and deployed again. It is time-consuming and laborious, and lacks flexibility, which correspondingly affects the flexibility and efficiency of vehicle data processing.

[0062] Based on the above problems, the present application provides a data processing method, device and electronic control unit based on a predicate system. By integrating the predicate system on the reader application running on the vehicle electronic control unit (ECU), the reader application can use the capabilities of the predicate system to parse the configuration file containing the conditional expression related to the vehicle status data, and record the conditional expression obtained by the analysis into the predicate system. Thus, when the vehicle status data is read, the corresponding judgment logic can be executed on the data based on the known conditional expression, thereby triggering the data processing action. In the technical solution of the present application, when it is necessary to correct and adjust the data judgment logic, since the conditional expression used to implement the judgment logic can be implemented by updating the configuration file, the predicate system integrated in the reader application can also parse the dynamically updated configuration file to obtain the updated conditional expression. Therefore, compared with the solution in the prior art that hard-codes the judgment logic in the program, this solution avoids the operation of repeated code writing and repeated compilation, and has higher flexibility. In addition, the predicate system used in this solution also supports parsing configuration files containing user-defined conditional expressions. Therefore, it can meet the needs of user-defined conditional expressions, make the judgment logic more flexible, and facilitate the implementation of more complex judgment logic to screen, filter and process data.

[0063] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0064] See also Figure 1A , which is a diagram of an implementation scenario architecture of a data processing method based on a predicate system provided in an embodiment of the present application. Figure 1A As shown, the implementation scenario includes a vehicle 101, which includes an ECU, and multiple applications are running on the ECU. These applications can be called reader applications and writer applications according to the requirements for reading and writing data. A reader application refers to an application that has a need to read data, and can specifically read data written by a writer application. Figure 1A Taking the first reader application shown in as an example, a predicate system 102 is integrated thereon, which can complete the parsing of the configuration file, and realize the judgment of the vehicle status data read by the reader application according to the conditional expression obtained by the parsing, or realize the judgment of other data related to the read vehicle status data, thereby triggering corresponding processing actions. Figure 1AIn the illustrated scenario, other reader applications except the first reader application running on the ECU, such as the second reader application, the Nth reader application, etc., can be integrated with the predicate system 102 respectively.

[0065] In some possible implementation scenarios, some processing actions involve reporting data to the vehicle status data monitoring platform. Figure 1B The scene shown also shows the vehicle status data monitoring platform 103. Taking the first reader application as an example, the first reader application can report the data that the vehicle status data monitoring platform focuses on to the platform 103, so that the vehicle status data monitoring platform 103 can obtain the dynamic changes of relevant data and promptly remind the vehicle user. Specifically, the vehicle status data monitoring platform 103 can send the message that needs to be prompted to the personal terminal device of the vehicle user (for example, Figure 1B In a possible implementation, the reader application may directly report the vehicle status data satisfying the target condition expression to the vehicle status data monitoring platform 103; in other possible implementations, the reader application may also generate a notification message describing the situation according to the satisfaction of the target condition expression, and send the notification message to the vehicle status data monitoring platform 103, carrying the data subject, value and other information of the response data in the notification message.

[0066] Figure 2 A schematic diagram of realizing vehicle status data reading and writing through shared memory is provided for an embodiment of the present application. In this figure, M writer applications (including the first writer application) and N reader applications (including the first reader application) running on the ECU are shown. Among them, M and N are both integers greater than 1, and the number of M and N is not limited, and the actual number of operations shall prevail. It can be understood that for many writer applications and many reader applications running on the ECU, if there is a connection between the writer application and the reader application in terms of data topics, such as paying attention to the same data topic, when the writer application writes the data of the data topic into the shared memory, the reader application paying attention to the data topic can read the data of the data topic written by the writer application from the shared memory. Through shared memory, efficient reading and writing of data between the reader application and the writer application in the ECU is achieved.

[0067] In shared memory, data is written and read in units of data topics. For example, data such as vehicle speed, air-conditioning temperature, and window switches can each be defined as a topic. The writer application creates a shared memory, or connects to the shared memory created by other existing writer applications, and writes data in units of topics to the memory area corresponding to the topic in the shared memory. It can be understood that the present application implements the vehicle status table through shared memory, and the vehicle status table is presented in the form of shared memory, providing interfaces for writing and reading data. The writer application calls the write data interface of the vehicle status table to implement data writing, and the reader application calls the read data interface of the vehicle status table to implement data reading.

[0068] The data processing method based on the predicate system provided in the embodiment of the present application can be specifically applied to any reader application in the vehicle ECU, and the reader application executes each operation in the method. The implementation process of the method is described in detail below with the reader application as the execution subject. Figure 3 The following is a flow chart of a data processing method based on a predicate system provided in an embodiment of the present application. Figure 3 As shown, the data processing method based on the predicate system includes:

[0069] S301, read vehicle status data.

[0070] In the example provided above, it is introduced that the vehicle status data can be stored in a shared memory connected to the reader application and the writer application. In combination with this example, the reader application can read the vehicle status data from the shared memory. In other implementation scenarios, the vehicle status data can also be stored in other types of storage media or storage spaces. When reading the vehicle status data, the carrier storing the vehicle status data is not limited here.

[0071] In the embodiment of the present application, the operation of reading the vehicle status data can be actively performed by the reader application, or it can be passively performed.

[0072] In an example scenario of actively reading data, the reader application provides an event trigger interface to the user. The event trigger interface can be represented as GetEventTrigger, whose input data type is int type, and the content of the input data is event_id. In other words, when the user calls the event trigger interface, by providing an event identifier, active reading of data can be achieved. In this implementation scenario, the structure of the configuration file includes: one or more configuration events. Among them, the structure of the configuration event includes: event identifier, event name, data subject and predicate; the predicate is used to describe the conditional expression related to the data subject. The predicate system can obtain the conditional expressions and related data subjects contained in one or more configuration files by parsing the configuration file.

[0073] For example, the predicate system integrated in the reader application pre-parses the configuration file to obtain the conditional expression about the data subject topic1 contained in the configuration event with the event name event1 and the event identifier 1 in the configuration file. When the user calls the event trigger interface and provides the event identifier event_id=1, the reader application responds to the call operation of the event trigger interface and determines that the target event identifier corresponding to the call operation is 1. For this example scenario, event inspection conditions can also be set. The event inspection conditions are used to determine whether it is necessary to actively judge the satisfaction of the conditional expression in the event of the input event identifier. When the event inspection conditions are met, the vehicle status data of the data subject topic1 contained in the configuration event event1 corresponding to the target event identifier (event_id=1) is read, and then subsequent judgment operations are performed.

[0074] In a possible implementation, the judgment of whether the event inspection condition is met can be realized by a timer. For example, the event inspection condition is set to be more than 5 seconds since the last reading of topic1 data for event judgment. The timer can assist in judging whether it has been 5 seconds. When the event inspection condition of 5 seconds interval is met, the data reading operation can be executed, the vehicle status data related to the event can be read, and it can be judged whether the conditional expression of the event is met.

[0075] The above describes an example scenario of actively reading data. In other possible implementations, the reader application may also read data after receiving a notification of data writing. In an example scenario of passively reading data, before reading the vehicle status data, the reader application receives a notification message of data writing. It should be noted that the notification message carries the target data topic where data writing occurs, and the notification message is used to notify the reader application that there is vehicle status data written to the target data topic in the shared memory to which the data source is connected. Based on this, after the reader application has identified the target data topic where data writing occurs, it can read the latest written data of the target data topic. Specifically, based on the notification message, the reader application reads the data address of the latest written data of the target data topic from the notification memory created jointly with the data source (for example, a writer application running in the same ECU).

[0076] To facilitate understanding of notification memory, the following introduces the construction process of notification memory and the way in which notification memory notifies reader applications. Notification memory can be established between reader applications and writer applications that share a common focus on one or more data topics. Notification memory is a type of shared memory dedicated to the writer application notifying the reader application. Notification memory can be named as a combination of the process information of the reader application and the process information of the writer application. Before creating notification memory, the reader application is required to have known the process information of the writer application, and the writer application is required to have known the process information of the reader application, so that the two can jointly create the notification memory after obtaining each other's process information. It should be noted that notification memory is one-to-one, that is, notification memory is only used for a specific writer application to send notifications to a specific reader application.

[0077] Figure 4A A schematic diagram of a notification memory structure provided in an embodiment of the present application. Figure 4A As shown, taking the first notification memory jointly created by the first reader application and the first writer application as an example, the first notification memory includes a memory semaphore and a notification queue. The number of notification queues is N, where N is the total number of data topics for which the first writer application is the data provider and the first reader application is the data subscriber. If the total number of data topics for which the first writer application is the data provider and the first reader application is the data subscriber is N=5, then the first notification memory contains 5 notification queues. These notification queues can also be understood as multiple notification queues contained in the notification queue array. The N notification queues in the first notification memory have a one-to-one relationship with the data topics, for example Figure 4A Notification queue 1 corresponds to topic1, notification queue 2 corresponds to topic2, notification queue 3 corresponds to topic3, notification queue 4 corresponds to topic4, and notification queue 5 corresponds to topic5.

[0078] The first writer application pushes the data address of the written data in the shared memory to the target notification queue corresponding to the target data topic among the N notification queues. For example, if topic1 is the target data topic, the first writer application pushes the data address to notification queue 1. The first writer application calls the memory semaphore to wake up the first reader application to obtain the data address from the target notification queue. For example, the first writer application calls the memory semaphore to wake up the first reader application to read the data address from notification queue 1, and then the first reader application reads the data indicated by the data address in the memory area corresponding to topic1 in the shared memory according to the data address.

[0079] When constructing the first notification memory, the first writer application and the first reader application create a notification queue for each data topic of common concern, so the notification queue and the data topic are in a one-to-one correspondence. If no data update occurs for each data topic involved in the first notification memory, that is, no new data addresses are added to each notification queue in the first notification memory, the first reader application will be dormant. When the first writer application writes data, and the written data is data of common concern, the signal is updated to wake up the first reader application with a memory semaphore. This method of reading data after waking up saves energy consumption of the first reader application, and can guarantee the timeliness of reading after data update is written to a certain extent. In an embodiment of the present application, the notification queue created in the notification memory is a lock-free queue, which can be supported to be set on the notification memory, and can support multiple readers and multiple writers. Therefore, the structure of the notification memory can also be understood as: memory semaphore + lock-free queue array.

[0080] Each writer application can create a shared memory by itself, and the creation of shared memory by different writer applications does not affect each other. When a reader application is interested in the data of this writer application, it will create a notification memory for notification. Each reader application is also independent and does not affect each other. For example, there are currently writer application A, reader application B, and reader application C. Writer application A will create a shared memory, and reader application B and reader application C are both interested in the data on writer application A. Then, two notification memories will be created between A and B, and between A and C, which are independent of each other and do not affect each other. Figure 4B A schematic diagram of notifying a reader application to read data provided by an embodiment of the present application. Figure 4B As shown in , A and B establish notification memory AB, and A and C establish notification memory AC. When data is written to topic 1, which is of common interest to B and C, and the writing action is implemented by A, A stores the address of the data written by topic 1 into the notification memory AB and the notification memory AC, respectively, in the notification queues related to topic 1. Notification memory AB notifies reader application B, and notification memory AC notifies reader application C. B and C read the data of topic 1 from the shared memory SHM A created by writer application A according to the notifications they receive.

[0081] In an embodiment of the present application, active reading or passive reading of data can be set in combination with the sensitive characteristics of the data. For example, vehicle status data related to vehicle safety and vehicle user safety are relatively sensitive data in data processing scenarios. This type of data can be read and processed in a timely manner by setting event inspection conditions and calling event trigger interfaces. In turn, the safety attributes of the vehicle are guaranteed, and the safety of vehicle users is guaranteed. For other data with less sensitive attributes, such as the air conditioning on / off status, the temperature inside the vehicle, etc., it can be read after the new data is written through passive notification.

[0082] S302, by calling the predicate system, determine whether the target condition expression is satisfied, if the target condition expression is satisfied, execute S303.

[0083] In the embodiment of the present application, a predicate system is introduced into the reader application, and the predicate system implements the parsing of the configuration file, and the predicate system executes the judgment logic in combination with the parsed conditional expression.

[0084] After the vehicle status data is read in step S301, the reader application calls the predicate system to determine whether the target conditional expression is satisfied. In the embodiment of the present application, the target conditional expression is a conditional expression related to the vehicle status data obtained after the predicate system parses the configuration file.

[0085] In specific implementation, combined with the specific requirements of data screening, filtering, and processing, the target condition expression and the vehicle status data read in S301 may have the following two relationships, which are implemented through configuration:

[0086] (1) The target conditional expression includes the data subject of the vehicle status data read in S301.

[0087] In this implementation, the determination of the target conditional expression is triggered by the vehicle status data read in S301 , and the specific determination logic also involves the vehicle status data read in S301 .

[0088] For example, S301 reads the vehicle status data of topic 1. The judgment logic of the target condition expression is to judge whether the data of topic h0 and topic h1 meet the target condition expression after reading the vehicle status data of topic 1. In this example, the target condition expression example form is: "@time_continuity(30,h0,>=,3)&&$h1!=3". That is, when the data of topic 1 is updated, the judgment is triggered: whether the data of topic h0 is always ≥ 3 within 30ms, and the data of topic h1 is not equal to 3. If this condition is met, enter S303.

[0089] (2) The target conditional expression does not contain the data subject of the vehicle status data read in S301.

[0090] In this implementation, the determination of the target conditional expression is triggered by the vehicle status data read in S301 , but the specific determination logic does not involve the vehicle status data read in S301 .

[0091] For example, S301 reads the vehicle status data of topic h0 or topic h1. The judgment logic of the target condition expression is to judge whether the data of topic h0 and topic h1 meet the target condition expression after reading the updated vehicle status data of topic h0 or topic h1. In this example, the target condition expression example form is: "$h0>=50&&$h1!=\"off\"". That is, when the data of topic h0 or topic h1 is updated, it triggers the judgment: whether the value of topic h0 is ≥50 and the value of topic h1 is not off. If this condition is met, enter S303.

[0092] In the technical solution of the present application, the predicate system can be combined with the vehicle status table. In the target condition expression "$h0>=50&&$h1!=\"off\"" in Example (2), the specific identifier $ means obtaining the data of topic h0 and topic h1 from the vehicle status table for judgment.

[0093] Combining the above two examples, it can be seen that the target conditional expression does not necessarily contain the data subject that triggers the use of the target conditional expression for logical judgment, such as introduced in the above example (1).

[0094] The data subject of the vehicle status data that needs to be read in S301 is used as the target data subject; the configuration event related to the target data subject is used as the target configuration event, and the conditional expression described by the predicate in the target configuration event is used as the target conditional expression. If the target conditional expression contains other data subjects that are not the target data subject, it is also necessary to read the vehicle status data of the other data subjects to achieve the judgment. Determine whether the target conditional expression is satisfied, including: judging whether the target conditional expression is satisfied based on the vehicle status data of other data subjects. Please refer to the above example (1).

[0095] It should be noted that, in the embodiment of the present application, the predicate system integrated in the reader application supports parsing of dynamically updated configuration files, and supports parsing of configuration files containing user-defined conditional expressions.

[0096] That is, when a conditional expression related to a data topic needs to be adjusted and updated, the configuration file can be dynamically updated. In this scenario, the predicate system can obtain the latest conditional expression based on the latest configuration. In turn, the updating process of the conditional expression is simplified, reducing the time and labor costs required.

[0097] The predicate system provides users with the ability to create custom rules (i.e., create conditional expressions). In actual applications, one or more configuration events can be configured based on the conditional expressions created by the user to form a configuration file. The custom conditional expressions can also be written into the preset configuration file template. The format of the user-defined conditional expression is "@custom(1,2,3)". Custom means user-defined, and the specific meaning of the number is related to the user-defined function. For example, the user defines a rule called Incremental(topic_name,value), which represents whether the value of the topic named name is greater than the last updated value each time. The first parameter represents the topic name, and the second parameter represents the incremental value. The user registers this function in the predicate system and provides the data topic and the value value. Assuming that the data topic is topic h0 and the value is 50, the above rule can be expressed as Incremental("h0",50). If the value of topic h0 is higher than before the last update and the change is greater than 50, this rule is satisfied, the target conditional expression is satisfied, and execution of S303 is triggered.

[0098] For the implementation of this step S302, an example implementation method is introduced below. In the embodiment of the present application, the data subject of the vehicle status data read by S301 is called the target data subject. In order to execute S302, the reader application first calls the predicate system to query whether the predicate system contains a conditional expression related to the target data subject; if so, the conditional expression related to the target data subject is used as the target conditional expression to determine whether the target conditional expression is satisfied. If the predicate system does not contain a conditional expression related to the target data subject, it is determined whether there is a configuration file to be parsed by the predicate system, the purpose is to see whether there is the latest configuration file that has not been parsed, especially whether the conditional expression on the target data subject has been updated and not parsed. If there is a configuration file to be parsed by the predicate system, the configuration file to be parsed is parsed by the predicate system to mine the latest conditional expression related to the target data subject. If the predicate system parses and obtains a conditional expression related to the target data subject, the conditional expression related to the target data subject is used as the target conditional expression to determine whether the target conditional expression is satisfied. Here, the dynamic parsing process after the dynamic update of the configuration file is introduced. The predicate system parses the dynamically updated configuration files, and can apply the latest rules to filter and screen the data when making logical judgments, and then realize data processing. This method is highly flexible.

[0099] S303: Process the vehicle status data using a processing method corresponding to the target condition expression.

[0100] In an optional implementation, the structure of the configuration file includes: one or more configuration events; the structure of the configuration event includes: event identifier, event name, data subject and predicate; the predicate is used to describe a conditional expression related to the data subject.

[0101] The following example introduces the structure of the configuration file:

[0102]

[0103]

[0104]

[0105] Combined with the configuration file structure in the above example, it can be seen that the configuration file includes 3 configuration events, namely, configuration events with event ids 1, 2, and 3. These 3 configuration events can be represented as event1, event2, and event3, see the value of the name of the configuration event in the configuration file. Topic represents the data subject, and predicate represents the predicate. Combined with the structure of the above example, the predicate includes the conditional expression condition and the specific information of the data subject topic, such as the name of the topic and the data type of the topic. Taking topic h4 as an example, its data type is double.

[0106] The user can register an event callback function for each configuration event, the purpose of which is to implement data processing by using the event callback function. There is also a possible implementation scenario: no additional processing of the data is required, and the vehicle status data monitoring platform can be directly reported. The implementation of this step S303 is introduced below:

[0107] If the target condition expression is met, the vehicle status data is handled in a manner corresponding to the target condition expression, including: if the target condition expression is met and the configuration event to which the target condition expression belongs has registered an event callback function, the event callback function is used to perform business processing operations on the vehicle status data.

[0108] The user can register the event callback function by calling the interface provided by the vehicle status table. Taking event1 as an example, the following shows the process of registering the event callback function EventCallBack1 for the configuration event.

[0109] void EventCallBack1(const std::string&topic,const asf::vst::SValueDataPtr&sample)

[0110] {

[0111] / / "The condition is met, I want to do something in this function!";

[0112] }

[0113] auto a=asf::vst::VStatusTable::Open();

[0114] a->RegisterEventCallBack(1,EventCallBack1);

[0115] The above represents the process of a user registering an event callback function EventCallBack1 for event1. When the conditional expression in event1 is met, the function EventCallBack1 is called to process the data.

[0116] Take event event1 as an example: when topic h0 or topic h1 has data updated, the condition described by condition is judged, that is, whether the value of h0 is greater than or equal to 50 at this time, and whether the value of h1 is not equal to off. If the conditions are met, the EventCallBack1 function registered by the user is called to perform business processing operations.

[0117] Take event event2 as an example: when topic h2 has data updated, the condition described by condition is judged, that is, whether the value of h2 is equal to true and whether the value of h3 is greater than or equal to 50 within 30ms (count_countinuity is a default rule provided by the predicate system). If the conditions are met, the EventCallBack2 function registered by the user is called to perform business processing operations (assuming that the user has registered the business function EventCallBack2 for event2).

[0118] Take event 3 as an example: the user wants to define a special rule. When the data of topic h4 is updated, it is determined whether the value is greater than 50 compared with the previous value. If it is greater than 50, it is reported to the cloud. Then the user first customizes a conditional judgment function:

[0119] bool Incremental(std::string topic,double value)

[0120] {

[0121] / / Write the code here to determine whether the value of topic is greater than value

[0122] }

[0123] Then, call the interface to register with the predicate system so that the predicate system records the conditional expression. The registration implementation method is: RegisterPredicateFunction("Incremental",Incremental). User registers event callback function EventCallBack3:

[0124] void EventCallBack3(const std::string&topic,const asf::vst::SValueDataPtr&sample)

[0125] {

[0126] / / "Report to the cloud!";

[0127] }

[0128] auto a=asf::vst::VStatusTable::Open();

[0129] a->RegisterEventCallBack(3,EventCallBack3);

[0130] Then, in the above configuration file, event3 is used to perform the following judgment and disposal: when the data of topic h4 is updated, whether h4 is greater than 50 compared with the previous value, if it is greater than 50, call EventCallBack3 to report the data to the cloud.

[0131] Based on the above introduction, we can know that the data can be processed by using the event callback function pre-registered by the user for the event. The data that needs to be processed can be understood as being screened, and the data that does not need to be processed can be understood as being filtered.

[0132] In the implementation scenario of the data disposal scheme based on the predicate system provided by the present application, the reader application running on the electronic control unit of the vehicle is integrated with the predicate system, and the writing language of the predicate system matches the writing language of the reader application. The predicate system supports parsing dynamically updated configuration files, and supports parsing configuration files containing user-defined conditional expressions. The data disposal method based on the predicate system includes: the reader application reads the vehicle status data; by calling the predicate system integrated with itself, it is determined whether the target conditional expression is satisfied. Among them, the target conditional expression is the conditional expression related to the vehicle status data obtained after the predicate system parses the configuration file. If the target conditional expression is satisfied, the vehicle status data is disposed of in a disposal method corresponding to the target conditional expression. Since the disposal of the vehicle status data is based on the premise of satisfying the target conditional expression, and the target conditional expression is obtained by the reader application calling the predicate system to parse the configuration file, when the judgment logic needs to be adjusted, only the configuration file needs to be adjusted to parse and obtain the new target conditional expression. This scheme avoids hard-coding the judgment logic in the program, thereby avoiding repeated writing and repeated compilation and execution of the code when adjusting the judgment logic of the data. It can be seen that this scheme can improve the flexibility of vehicle data disposal.

[0133] In addition, the configuration file not only supports dynamic updates, but also supports user-defined conditional expressions, so that the reader application integrated with the predicate system can parse the latest conditional expressions in the dynamically updated configuration file. The parsed conditional expressions can contain user-defined components. Therefore, this solution is more lightweight and user-friendly for user configuration. It not only provides rich rules and supports diversified and complex rules as conditional expressions, but also opens up customized functions for users with diverse needs, thereby improving user configuration needs and meeting user data processing needs to a greater extent.

[0134] In the embodiment of the present application, the writing language of the predicate system integrated into the reader application matches the writing language of the reader application itself. Compared with the general conditional judgment expression implemented by the scripting language (such as Python or lua), it can reduce the performance overhead of the vehicle and improve the data processing efficiency. For example, if the conditional expression used for execution judgment is implemented by the scripting language, the reader application needs to convert the writing language before conditional judgment and processing because the writing language does not match the scripting language. This will affect the performance of the ECU on the vehicle and generate greater performance overhead. The predicate system, on the other hand, is written in a language that is compatible with the writing language of the reader application, such as C or C++, so it reduces the additional performance overhead caused by the mismatch of the writing language and improves the data processing efficiency.

[0135] In addition, scripting languages ​​can generally only implement very simple judgment logic. In the processing scenario of vehicle status data, they often face more complex judgment logic. The limitations of the scripting language itself make it difficult to meet complex judgment requirements. The predicate system integrated in the reader application can support flexible and complex conditional expressions and user-defined rules, thus providing more convenience for users and meeting complex judgment requirements to a greater extent. Therefore, the technical solution of this application has stronger applicability in vehicle scenarios.

[0136] In an optional implementation, the structure of the configuration file includes one or more configuration events; the structure of the configuration event includes: event identifier, event name, data subject and predicate; the predicate is used to describe the conditional expression related to the data subject. The structure of the configuration event can refer to the structure of the configuration events event1, event2 and event3 in the above example.

[0137] As mentioned above, the configuration file may be updated according to user needs. The configuration file can be updated by the vehicle status data monitoring platform (such as the cloud server) to the cloud application gateway running on the ECU, and then the cloud application gateway determines which system domain application the configuration file corresponds to. Finally, the configuration file is placed in the directory of the reader application for parsing by the predicate system.

[0138] In an optional implementation, updating of the configuration file includes at least one of the following:

[0139] Add, delete or modify configuration events. For example, the original configuration file contains three configuration events, namely event1, event2 and event3. You can add new configuration events, such as adding event4; you can delete configuration events, such as deleting event3. You can also modify existing configuration events. Combined with the structure of configuration events, the modification methods of configuration events can include at least one of the following:

[0140] Modification of event identifier, modification of event name, adjustment of data subject, or modification of predicate. The adjustment of data subject includes at least one of the following:

[0141] Addition, deletion or modification of data subjects.

[0142] As described above, the configuration file can support various updates, providing convenience for users to change the judgment logic.

[0143] In the examples introduced above, it is mentioned that the values ​​of some data topics can be false, true, on, off, etc. For ease of understanding, the meanings of false, true, on, off, etc. are introduced below with examples. In one example, the meaning of a data topic is an alarm flag. If the alarm flag is false, it means that no alarm has been given. If the alarm flag is true, it means that an alarm has been given. In one example, the meaning of a data topic is the window opening and closing status. If the value is on, it means that the window is open, and if the value is off, it means that the window is closed.

[0144] Based on the embodiments described above, the present application also provides a data processing device based on a predicate system. Figure 5 The structure of the device is introduced.

[0145] In the embodiment of the present application, the data processing device based on the predicate system is applied to a reader application running on the electronic control unit ECU of the vehicle, the reader application is integrated with the predicate system, and the writing language of the predicate system matches the writing language of the reader application. Figure 5 As shown, the data processing device based on the predicate system includes:

[0146] A reading module 501 is used to read vehicle status data;

[0147] The judgment module 502 is used to judge whether the target condition expression is satisfied by calling the predicate system; the target condition expression is a condition expression related to the vehicle status data obtained after the predicate system parses the configuration file; the predicate system supports parsing dynamically updated configuration files, and supports parsing configuration files containing user-defined condition expressions;

[0148] The processing module 503 is used to process the vehicle status data in a processing method corresponding to the target condition expression if the target condition expression is satisfied.

[0149] In an optional implementation, the data processing device based on the predicate system further includes:

[0150] A data subject determination module, used to determine the data subject of the vehicle status data to be read as the target data subject;

[0151] The judgment module 502 is specifically used to: call the predicate system to query whether the predicate system contains a conditional expression related to the target data subject; if so, use the conditional expression related to the target data subject as the target conditional expression to judge whether the target conditional expression is satisfied.

[0152] In an optional implementation, the judgment module 502 is further used to: if the predicate system does not contain a conditional expression related to the target data subject, determine whether there is a configuration file to be parsed by the predicate system; if there is a configuration file to be parsed by the predicate system, parse the configuration file to be parsed by the predicate system; if the predicate system parses and obtains a conditional expression related to the target data subject, use the conditional expression related to the target data subject as the target conditional expression, and determine whether the target conditional expression is satisfied.

[0153] In an optional implementation, the data processing device based on the predicate system further includes:

[0154] A notification message receiving module, used to receive a notification message of data writing; the notification message carries a target data subject where data writing occurs, and the notification message is used to notify the reader application that a data source has written vehicle status data of the target data subject into the shared memory connected to the reader application;

[0155] A data address reading module, configured to read, based on the notification message, a data address of the latest written data of the target data subject from a notification memory created together with the data source;

[0156] The reading module 501 is specifically configured to read the latest written data of the target data subject from the shared memory according to the data address.

[0157] In an optional implementation, the structure of the configuration file includes: one or more configuration events; the structure of the configuration event includes: an event identifier, an event name, a data subject, and a predicate; the predicate is used to describe a conditional expression related to the data subject;

[0158] In an optional implementation, the reading module 501 is specifically used for:

[0159] In response to a call operation to an event trigger interface, a target event identifier corresponding to the call operation is determined; when an event inspection condition is met, vehicle status data of a data subject contained in a configuration event corresponding to the target event identifier is read.

[0160] In an optional implementation, the handling module 503 is specifically used for: if the target condition expression is satisfied, and the configuration event to which the target condition expression belongs has registered an event callback function, then using the event callback function to perform business processing operations on the vehicle status data.

[0161] In an optional implementation, the data processing device based on the predicate system further includes:

[0162] A data subject determination module, used to determine the data subject of the vehicle status data to be read as the target data subject;

[0163] An event determination module, used to determine a configuration event related to the target data subject as a target configuration event;

[0164] A conditional expression determination module, used to determine a conditional expression described by a predicate in the target configuration event as a target conditional expression;

[0165] The reading module 501 is further configured to read the vehicle status data of other data subjects if the target condition expression contains other data subjects other than the target data subject;

[0166] The judgment module 502 is specifically used to judge whether the target condition expression is satisfied based on the vehicle status data of the other data subjects.

[0167] Based on the data processing method and device based on the predicate system introduced in the above embodiments, the present application also provides an automotive electronic control unit ECU. The ECU is arranged on the vehicle, and a reader application runs on the ECU. The reader application is integrated with the predicate system, and the programming language of the predicate system matches the programming language of the reader application. The ECU can use shared memory to realize the reading and writing of data. The implementation of the ECU is introduced below.

[0168] In the ECU introduced in the embodiment of the present application, one or more writer applications are running on it, and one or more reader applications are also running on the ECU.

[0169] It is understandable that for many writer applications and many reader applications running on the ECU, if there is a connection between the writer application and the reader application in terms of data topics, such as focusing on the same data topic, it means that after the writer application writes the data of the data topic into the shared memory, the reader application focusing on the data topic can read the data of the data topic written by the writer application from the shared memory, thus realizing efficient reading and writing of data between the reader application and the writer application in the ECU.

[0170] After the reader application on the ECU is running, it can execute some or all steps of the data processing method based on the predicate system introduced in the above method embodiment. The implementation of this method has been introduced in detail in the previous text and will not be repeated here.

[0171] It should be noted that each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment and the electronic control unit embodiment, since they are basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The device embodiment and the electronic control unit embodiment described above are merely schematic, wherein the unit described as a separate component may or may not be physically separated, and the component indicated as a unit may or may not be a physical unit, that is, it may be located in one place, or it may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0172] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A data processing method based on a predicate system, characterized in that: A reader application is applied to a vehicle electronic control unit (ECU), wherein the reader application is integrated with a predicate system, and the predicate system is written in a language that matches the reader application. The method comprises: Read vehicle status data; By calling the predicate system, it is determined whether a target conditional expression is satisfied; the target conditional expression is a conditional expression related to the vehicle status data obtained by the predicate system after parsing the configuration file; the predicate system supports parsing dynamically updated configuration files and supports parsing configuration files containing user-defined conditional expressions; If the target condition expression is satisfied, the vehicle state data is processed in a processing method corresponding to the target condition expression.

2. The method according to claim 1, characterized in that The method further comprises: Determine the data subject of the vehicle status data to be read as the target data subject; The step of calling the predicate system to determine whether the target condition expression is satisfied includes: Calling the predicate system to query whether the predicate system contains a conditional expression related to the target data subject; If it exists, the conditional expression related to the target data subject is used as the target conditional expression to determine whether the target conditional expression is satisfied.

3. The method according to claim 2, characterized in that Also includes: If the predicate system does not contain a conditional expression related to the target data subject, determining whether there is a configuration file to be parsed by the predicate system; If there is a configuration file to be parsed by the predicate system, parsing the configuration file to be parsed by using the predicate system; If the predicate system parses and obtains a conditional expression related to the target data subject, the conditional expression related to the target data subject is used as a target conditional expression to determine whether the target conditional expression is satisfied.

4. The method according to claim 1, wherein Before reading the vehicle status data, the method further includes: Receive a notification message of data writing; the notification message carries the target data topic where the data writing occurs, and the notification message is used to notify the reader application that a data source has written vehicle status data of the target data topic into the shared memory connected to the reader application; Based on the notification message, read the data address of the latest written data of the target data subject from the notification memory created together with the data source; The reading of vehicle status data specifically includes: The latest written data of the target data topic is read from the shared memory according to the data address.

5. The method according to claim 1, wherein The structure of the configuration file includes: one or more configuration events; the structure of the configuration event includes: event identifier, event name, data subject and predicate; the predicate is used to describe the conditional expression related to the data subject; The reading of vehicle status data includes: In response to a call operation on an event trigger interface, determining a target event identifier corresponding to the call operation; When the event inspection condition is met, the vehicle status data of the data subject contained in the configuration event corresponding to the target event identifier is read.

6. The method according to claim 1, wherein The structure of the configuration file includes: one or more configuration events; the structure of the configuration event includes: event identifier, event name, data subject and predicate; the predicate is used to describe the conditional expression related to the data subject; If the target condition expression is satisfied, processing the vehicle state data in a processing method corresponding to the target condition expression includes: If the target condition expression is satisfied and the configuration event to which the target condition expression belongs has registered an event callback function, the event callback function is used to perform a business processing operation on the vehicle status data.

7. The method according to claim 1, characterized in that The structure of the configuration file includes: one or more configuration events; the structure of the configuration event includes: event identifier, event name, data subject and predicate; the predicate is used to describe a conditional expression related to the data subject; the method further includes: Determine the data subject of the vehicle status data to be read as the target data subject; determining a configuration event related to the target data subject as a target configuration event; Determine a conditional expression described by a predicate in the target configuration event as a target conditional expression; If the target condition expression includes other data topics other than the target data topic, reading the vehicle status data of the other data topics; Determine whether the target condition expression is satisfied, including: Based on the vehicle status data of the other data subject, it is determined whether the target conditional expression is satisfied.

8. The method according to any one of claims 5 to 7, characterized in that The updating of the configuration file includes at least one of the following: Addition, deletion, or modification of configuration events; The modification of the configuration event includes at least one of the following: Modification of event identifiers, modification of event names, adjustment of data subjects, or modification of predicates; The adjustment of the data subject includes at least one of the following: Addition, deletion or modification of data subjects.

9. A data processing device based on a predicate system, characterized in that: A reader application is applied to a vehicle electronic control unit (ECU), wherein the reader application is integrated with a predicate system, and the programming language of the predicate system matches the programming language of the reader application; the apparatus comprises: Reading module, used to read vehicle status data; a judgment module, configured to judge whether a target conditional expression is satisfied by calling the predicate system; the target conditional expression is a conditional expression related to the vehicle status data obtained by the predicate system after parsing the configuration file; the predicate system supports parsing dynamically updated configuration files and supports parsing configuration files containing user-defined conditional expressions; A processing module is used to process the vehicle status data in a processing method corresponding to the target condition expression if the target condition expression is satisfied.

10. An electronic control unit, characterized in that: The electronic control unit is provided on the vehicle, and a reader application is run on the electronic control unit. The reader application is integrated with a predicate system, and the programming language of the predicate system matches the programming language of the reader application. The reader application is used to execute the steps of the data processing method based on the predicate system according to any one of claims 1 to 8 after the application is run.