Data consistency processing method and device of battery management system, equipment and medium
By generating a data consistency processing scheme and utilizing intermediate variables and locking protection mechanisms, the problem of data tampering in the battery management system was solved, ensuring the integrity of data transmission and the reliability of the system, and improving development efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA FAW CO LTD
- Filing Date
- 2023-12-21
- Publication Date
- 2026-06-19
AI Technical Summary
Existing battery management systems lack effective data consistency protection measures, leading to data tampering and affecting system functions, as well as the safety and performance of new energy vehicles.
By generating different data consistency processing schemes and utilizing intermediate variables and locking protection mechanisms, the integrity of data during the transfer process between tasks is ensured. The data consistency processing scheme for processing tasks is generated, including interface generation, variable generation, and handling of transfer relationships, until the task ends.
This ensures the immutability of task interaction data in the battery management system, improves development efficiency and requirement coverage, and guarantees the reliability of the battery management system.
Smart Images

Figure CN117910051B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of battery management system technology, and in particular to data consistency processing methods, apparatus, equipment and media for battery management systems. Background Technology
[0002] As the most complex electronic control unit in terms of hardware and software integration among the three core components of new energy vehicles, the battery management system (BMS) involves a massive amount of data interaction between multiple tasks and cores. If the consistency of this interactive data is not effectively guaranteed, the received data may be tampered with, leading to malfunctions in the BMS or incorrect battery parameter calculations, significantly impacting the safety and performance of new energy vehicles. Most OEMs use AUTOSAR RTE components to ensure data consistency; however, the expensive development tools and lengthy toolchains pose challenges to both cost and efficiency. Therefore, some OEMs use non-RTE components and develop their own systems to ensure data consistency. This approach is more efficient and lower-cost, but because data consistency issues often do not reliably occur during testing, the integrity of the development process cannot be reliably guaranteed. Therefore, ensuring the consistency of the interactive data in the battery management system has become a significant technical challenge. Summary of the Invention
[0003] In view of this, the purpose of this application is to provide a data consistency processing method, apparatus, device and medium for a battery management system. By processing the different attributes of the data exchanged between tasks, different data consistency processing schemes are generated, which ensures that the task interaction data of the battery management system is not tampered with, guarantees development efficiency and requirement coverage, and thus ensures the reliability of the battery management system's electronic control unit.
[0004] This application provides a data consistency processing method for a battery management system, the data consistency processing method including:
[0005] Acquire data information from multiple pending tasks of the battery management system; wherein, the data information is data that requires data consistency protection, and the data information includes the variable name of the data sending interface, the data transmission direction, the data type, the data dimension, the variable name of the data receiving interface, and the running cycle;
[0006] For each of the tasks to be processed, the data information is processed by interface generation, intermediate variable generation, data transmission relationship processing, and task name generation to determine the processed data information of each task to be processed.
[0007] Based on the processed data information of each of the tasks to be processed, a data consistency processing scheme for each of the tasks to be processed is determined.
[0008] For the task to be processed where the data dimension of the data interface is in the form of an array, the data sending interface and the data receiving interface in the data consistency processing scheme of the task to be processed perform data consistency processing on the data variables of the task to be processed based on intermediate variables, and stop the data consistency processing when the processing task ends.
[0009] In one possible implementation, regarding the interface generation process, the step of performing interface generation processing, intermediate variable generation processing, data transfer relationship processing, and task name generation processing on the data information of each task to be processed, to determine the processed data information of each task to be processed, includes:
[0010] The variable names of the data sending interface and the variable names of the data receiving interface are processed by generating code, and the variable names of the data sending interface and the variable names of the data receiving interface are matched with the data dimension based on preset matching rules to determine the processed data information of each task to be processed.
[0011] In one possible implementation, the intermediate variable generation process, which involves performing interface generation processing, intermediate variable generation processing, data transfer relationship processing, and task name generation processing on the data information of each task to be processed, to determine the processed data information of each task to be processed, includes:
[0012] When the data transmission direction is the forward transmission direction, an intermediate variable is generated for the left-hand variable, and the left-hand variable serves as the main variable of the intermediate variable.
[0013] When the data transmission direction is the reverse transmission direction, an intermediate variable is generated for the right-hand variable, and the right-hand variable serves as the main variable of the intermediate variable; wherein, data transmission from left to right is the forward transmission direction, and data transmission from right to left is the reverse transmission direction.
[0014] In one possible implementation, regarding the task name generation process, the step of performing interface generation processing, intermediate variable generation processing, data transfer relationship processing, and task name generation processing on the data information of each task to be processed to determine the processed data information of each task to be processed includes:
[0015] Based on the running cycle and the data transmission direction, the task name information is generated in the processed data information.
[0016] In one possible implementation, determining a data consistency processing scheme for each task based on the processed data information of each task includes:
[0017] Determine the type of data dimension in the processed data information of the task to be processed;
[0018] If the data dimension is of a single variable type, then the data consistency processing scheme is prohibited from performing data consistency processing on the task to be processed.
[0019] If the data dimension is an array-based interface, then the data consistency processing scheme controls the data consistency processing of the task to be processed.
[0020] In one possible implementation, the data dimension of the task to be processed for the data interface is in array form. The data consistency processing scheme for this task includes data sending and receiving interfaces performing data consistency processing on the data variables of the task based on intermediate variables, until the processing task finishes running and the data consistency processing stops. This includes:
[0021] When the data transmission direction is forward, the first interface function in the data sending interface updates all data values of the left variable to the intermediate variable, and the second interface function updates all data values of the intermediate variable to the right variable of the data receiving interface; wherein, locking protection is implemented during the process of transferring the left variable to the intermediate variable, and interruption is prohibited during the assignment of the left variable and the intermediate variable;
[0022] When the data transmission direction is reverse, the first interface function updates all data values of the right-hand variable to the intermediate variable, and the second interface function updates all data values of the intermediate variable to the left-hand variable.
[0023] In one possible implementation, for the task to be processed where the data dimension interface is an array-type interface, the data sending and receiving interfaces in the data consistency processing scheme of the task to be processed perform data consistency processing on the data variables of the task to be processed based on intermediate variables. After the data consistency processing stops when the processing task finishes running, the data consistency processing method further includes:
[0024] The code for generating and processing the intermediate variables, the first interface function, and the second interface function are stored in the corresponding source files.
[0025] This application embodiment also provides a data consistency processing device for a battery management system, the data consistency processing device comprising:
[0026] The data input module is used to acquire data information from multiple pending tasks of the battery management system; wherein, the data information is data that requires data consistency protection, and the data information includes the variable name of the data sending interface, the data transmission direction, the data type, the data dimension, the variable name of the data receiving interface, and the running cycle;
[0027] The data processing module is used to perform interface generation processing, intermediate variable generation processing, data transmission relationship processing, and task name generation processing on the data information of each task to be processed, and to determine the processed data information of each task to be processed.
[0028] The scheme determination module is used to determine the data consistency processing scheme for each of the tasks to be processed based on the processed data information of each task to be processed.
[0029] The data processing module is used for the task to be processed where the data dimension of the data interface is in the form of an array. The data sending interface and the data receiving interface of the task to be processed perform data consistency processing on the data variables of the task to be processed based on intermediate variables until the processing task ends.
[0030] This application also provides an electronic device, including: a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. When the machine-readable instructions are executed by the processor, the steps of the data consistency processing method of the battery management system described above are performed.
[0031] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the data consistency processing method for the battery management system described above.
[0032] This application provides a data consistency processing method, apparatus, device, and medium for a battery management system. The data consistency processing method includes: acquiring data information of multiple tasks to be processed in the battery management system; wherein the data information is data requiring data consistency protection, and the data information includes variable names of data sending interfaces, data transmission direction, data type, data dimension, variable names of data receiving interfaces, and running cycle; performing interface generation processing, intermediate variable generation processing, data transmission relationship processing, and task name generation processing on the data information of each task to be processed to determine the processed data information of each task to be processed; determining a data consistency processing scheme for each task to be processed based on the processed data information of each task to be processed; for tasks to be processed where the data dimension of the data interface is in array form, the data sending interface and data receiving interface in the data consistency processing scheme of the task to be processed perform data consistency processing on the data variables of the task to be processed based on intermediate variables until the processing task ends. By generating different data consistency processing schemes through different attributes of the data interacting between processing tasks, the task interaction data of the battery management system is prevented from being tampered with, ensuring development efficiency and requirement coverage, and thus ensuring the reliability of the battery management system's electronic control unit.
[0033] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0034] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0035] Figure 1 A flowchart illustrating a data consistency processing method for a battery management system provided in this application embodiment;
[0036] Figure 2 This is one of the structural schematic diagrams of a data consistency processing device for a battery management system provided in an embodiment of this application;
[0037] Figure 3 A second schematic diagram of a data consistency processing device for a battery management system provided in an embodiment of this application;
[0038] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0039] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of this application. Based on the embodiments of this application, every other embodiment obtained by those skilled in the art without inventive effort falls within the scope of protection of this application.
[0040] Furthermore, the described embodiments are merely some, not all, of the embodiments of this application. The components of the embodiments of this application described and illustrated herein can typically be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0041] To enable those skilled in the art to use the content of this application and, in conjunction with the specific application scenario of "consistent processing of data in the battery management system", the following implementation methods are provided. For those skilled in the art, the general principles defined herein can be applied to other embodiments and application scenarios without departing from the spirit and scope of this application.
[0042] The methods, apparatus, electronic devices, or computer-readable storage media described in this application can be applied to any scenario that requires data consistency processing of the battery management system. This application does not limit the specific application scenario. Any scheme using the data consistency processing method, apparatus, device, and medium of the battery management system provided in this application is within the protection scope of this application.
[0043] First, the applicable scenarios for this application will be introduced. This application can be applied to the field of battery management system technology.
[0044] Research has revealed that the Battery Management System (BMS), as the most complex electronic control unit in terms of hardware and software integration among the three core components of new energy vehicles, involves a massive amount of data interaction between multiple tasks and cores. If the consistency of this interactive data is not effectively guaranteed, the received data may be tampered with, leading to malfunctions in the BMS or incorrect battery parameter calculations, significantly impacting the safety and performance of new energy vehicles. Most OEMs use AUTOSAR RTE components to ensure data consistency; however, the expensive development tools and lengthy toolchains pose challenges to both cost and efficiency. Therefore, some OEMs use non-RTE components and develop their own systems to ensure data consistency. This approach is more efficient and lower-cost, but because data consistency issues often do not reliably occur during testing, the integrity of the development process cannot be reliably guaranteed. Therefore, ensuring the consistency of the interactive data in the BMS has become a significant technical challenge.
[0045] Based on this, embodiments of this application provide a data consistency processing method for a battery management system. By processing different attributes of the data exchanged between tasks, different data consistency processing schemes are generated, ensuring that the task interaction data of the battery management system is not tampered with, guaranteeing development efficiency and requirement coverage, and thus ensuring the reliability of the battery management system's electronic control unit. Please refer to... Figure 1 , Figure 1 This is a flowchart illustrating a data consistency processing method for a battery management system provided in an embodiment of this application. Figure 1 As shown in the figure, the data consistency processing method provided in this application embodiment includes:
[0046] S101: Obtain data information from multiple pending tasks of the battery management system; wherein, the data information is data that requires data consistency protection, and the data information includes the variable name of the data sending interface, the data transmission direction, the data type, the data dimension, the variable name of the data receiving interface, and the running cycle.
[0047] In this step, data information for multiple pending tasks of the battery management system is acquired.
[0048] The data information refers to the data that requires data consistency protection. The data information includes the variable names of the data sending interface, the data transmission direction, the data type, the data dimension, the variable names of the data receiving interface, and the running cycle.
[0049] This can contain not only data information about tasks to be processed, but also data information from the kernel software of the battery management system.
[0050] The variable name refers to the software interface variable name. Regardless of whether the software interface is in single-variable or array form, the variable name should be filled in, without reflecting any dimension-related information. The data transmission direction needs to be defined before filling in the data input unit. If one direction is defined as the positive direction, the other is the negative direction. The positive direction represents data transmission from left to right, and vice versa. Data types include Boolean types, signed 8 / 16 / 32 / 64-bit integers, unsigned 8 / 16 / 32 / 64-bit integers, single-precision / double-precision floating-point numbers, etc. Data dimensions include [1,1] for single-variable interface variables and [a,b] for array interface variables, where 'a' represents the dimension and 'b' represents the length of the single-dimensional array, where 'a' >= 1 and 'b' > 1. The runtime indicates the update cycle of the interface.
[0051] S102: Perform interface generation processing, intermediate variable generation processing, data transmission relationship processing, and task name generation processing on the data information of each task to be processed, and determine the processed data information of each task to be processed.
[0052] In this step, the data information of each task to be processed is processed through interface generation, intermediate variable generation, data transfer relationship processing, and task name generation to determine the processed data information of each task to be processed.
[0053] In one possible implementation, regarding the interface generation process, the step of performing interface generation processing, intermediate variable generation processing, data transfer relationship processing, and task name generation processing on the data information of each task to be processed, to determine the processed data information of each task to be processed, includes:
[0054] The variable names of the data sending interface and the variable names of the data receiving interface are processed by generating code, and the variable names of the data sending interface and the variable names of the data receiving interface are matched with the data dimension based on preset matching rules to determine the processed data information of each task to be processed.
[0055] Here, the variable names of the data sending interface and the variable names of the data receiving interface are processed by generating code, and the variable names of the data sending interface and the variable names of the data receiving interface are matched with the data dimensions according to the preset matching rules to determine the processed data information.
[0056] The interface generation process mainly consists of two parts: the first part is the generation of the interface name code, and the second part is the matching of the name with the interface's data dimensions. The preset matching rule for the name and interface data dimensions is that for single variables, only the variable name is displayed, and for array variables, both the variable name and the corresponding dimension are displayed.
[0057] In one possible implementation, the intermediate variable generation process, which involves performing interface generation processing, intermediate variable generation processing, data transfer relationship processing, and task name generation processing on the data information of each task to be processed, to determine the processed data information of each task to be processed, includes:
[0058] A: When the data transmission direction is forward, an intermediate variable is generated for the left-hand variable, and the left-hand variable serves as the main variable of the intermediate variable.
[0059] Here, when the data transmission direction is forward, an intermediate variable is generated for the left-hand variable, and the left-hand variable becomes the master variable of the intermediate variable.
[0060] B: When the data transmission direction is the reverse transmission direction, an intermediate variable is generated for the right-hand variable, and the right-hand variable serves as the main variable of the intermediate variable; wherein, data transmission from left to right is the forward transmission direction, and data transmission from right to left is the reverse transmission direction.
[0061] Here, when the data transmission direction is reverse, an intermediate variable is generated for the right-hand variable, and the right-hand variable becomes the main variable of the intermediate variable.
[0062] The intermediate variable is generated primarily based on the forward data transmission direction. When the data transmission direction is positive, the intermediate variable on the left is generated, and the left variable serves as the master variable of the intermediate variable. When the data transmission direction is negative, the intermediate variable on the right is generated, and the right variable serves as the master variable of the intermediate variable. The intermediate variable is represented as "master variable_1".
[0063] In one possible implementation, the task name generation process, which involves performing interface generation processing, intermediate variable generation processing, data transfer relationship processing, and task name generation processing on the data information of each task to be processed, to determine the processed data information of each task to be processed, includes:
[0064] Based on the running cycle and the data transmission direction, the task name information is generated in the processed data information.
[0065] Here, the task name generation process automatically generates task name information in the form of "time + direction" based on the running cycle and data transmission direction.
[0066] S103: Based on the processed data information of each task to be processed, determine the data consistency processing scheme for each task to be processed.
[0067] In this step, a data consistency processing scheme for each task is determined based on the processed data information of each task.
[0068] In one possible implementation, determining a data consistency processing scheme for each task based on the processed data information of each task includes:
[0069] a: Determine the type of data dimension in the processed data information of the task to be processed.
[0070] b: If the data dimension is of a single variable type, then the data consistency processing scheme is prohibited from performing data consistency processing on the task to be processed.
[0071] Here, if the data dimension is of a single variable type, then the data consistency processing scheme is prohibited from performing data consistency processing on the task to be processed.
[0072] c: If the data dimension is an array-based interface, then the data consistency processing scheme will perform data consistency processing on the task to be processed.
[0073] Here, if the data dimension is an array-based interface, the data consistency processing scheme controls the data consistency processing of the task to be processed.
[0074] There are two data consistency processing schemes. One is the data consistency processing disabled scheme, which is empty and does not perform any processing. Since single variables (data interfaces less than 64 bits) are atomic operations, no protection is required. The second scheme is the data consistency processing scheme. The main implementation method of this scheme is to add lock protection during the process of passing the main variable to the intermediate variable. The assignment process of the main variable and the intermediate variable is prevented from being interrupted by the operating system, so as to ensure that the data assignment process is not interrupted. The main variable can completely update all values to the process variable, and the process variable can also completely update all values to the above-mentioned right-hand variable.
[0075] S104: For the task to be processed where the data dimension of the data interface is in the form of an array, the data sending interface and the data receiving interface in the data consistency processing scheme of the task to be processed perform data consistency processing on the data variables of the task to be processed based on intermediate variables until the processing task ends and the data consistency processing stops.
[0076] In this step, for the task to be processed where the data dimension of the data interface is in the form of an array, the data sending interface and the data receiving interface in the data consistency processing scheme of the task to be processed perform data consistency processing on the data variables of the task to be processed based on the intermediate variables, until the data consistency processing stops when the processing task ends.
[0077] In one possible implementation, the data dimension of the task to be processed for the data interface is in array form. The data consistency processing scheme for this task includes data sending and receiving interfaces performing data consistency processing on the data variables of the task based on intermediate variables, until the processing task finishes running and the data consistency processing stops. This includes:
[0078] i: When the data transmission direction is forward, the first interface function in the data sending interface updates all data values of the left variable to the intermediate variable, and the second interface function updates all data values of the intermediate variable to the right variable of the data receiving interface; wherein, locking protection is implemented during the process of transferring the left variable to the intermediate variable, and interruption is prohibited during the assignment of the left variable and the intermediate variable.
[0079] Here, when the data transmission direction is forward, the first interface function in the data sending interface updates all data values of the left variable to the intermediate variable, and the second interface function updates all data values of the intermediate variable to the right variable of the data receiving interface. Locking protection is implemented during the process of transferring the left variable to the intermediate variable, and interruption is prohibited during the assignment of values between the left variable and the intermediate variable.
[0080] ii: When the data transmission direction is reverse, the first interface function updates all data values of the right-hand variable to the intermediate variable, and the second interface function updates all data values of the intermediate variable to the left-hand variable.
[0081] Here, when the data transmission direction is reverse, the first interface function updates the data value of the right-hand variable to the intermediate variable, and the second interface function updates all the data values of the intermediate variable to the left-hand variable.
[0082] Specifically, the first interface function that assigns a value from a left-hand variable to an intermediate variable is automatically mapped to the last execution of the corresponding task, and the second interface function that assigns a value from an intermediate variable to a right-hand variable is automatically mapped to the first execution of the corresponding task.
[0083] In this scheme, by generating intermediate variables, the two interfaces that need to transfer data only pass through the intermediate variables. The assignment relationship between the main variable and the intermediate variable is executed at the end of the task where the main variable is located. At the same time, locking is applied to the interfaces that are not single variables. The assignment of the intermediate variable to the data receiving interface variable is executed at the beginning of the task where the data receiving interface is located. Locking is also applied to the interfaces that are not single variables. This ensures that the data used by the data receiving interface is complete. At the same time, no locking is applied to the data transfer of single variable data interfaces. By utilizing the data access characteristics of the microcontroller, the CPU load rate is not increased while ensuring data consistency.
[0084] In one possible implementation, for the task to be processed where the data dimension interface is an array-type interface, the data sending and receiving interfaces in the data consistency processing scheme of the task to be processed perform data consistency processing on the data variables of the task to be processed based on intermediate variables. After the data consistency processing stops when the processing task finishes running, the data consistency processing method further includes:
[0085] The code for generating and processing the intermediate variables, the first interface function, and the second interface function are stored in the corresponding source files.
[0086] Here, all the code is generated into source files. The .c source files contain the code for intermediate variables and the entities of all functions, while the .h source files contain the declarations of all intermediate variables and the declarations of all functions for user use.
[0087] In this solution, data consistency protection requirements are managed in a unified manner. Different data transmission relationships are automatically generated based on the sending direction, data type, and length. Different data consistency protection schemes are matched, and source code is automatically generated. From requirement development to code generation, manual operation is completely avoided, thus avoiding software problems caused by manual coding and improving software quality.
[0088] This application provides a data consistency processing method for a battery management system. The method includes: acquiring data information from multiple tasks to be processed within the battery management system; wherein the data information is data requiring data consistency protection, and includes variable names of data sending interfaces, data transmission direction, data type, data dimension, variable names of data receiving interfaces, and running cycle; performing interface generation processing, intermediate variable generation processing, data transmission relationship processing, and task name generation processing on the data information of each task to be processed, to determine the processed data information of each task; determining a data consistency processing scheme for each task based on the processed data information; for tasks whose data interface data dimension is in array form, the data sending interface and data receiving interface in the data consistency processing scheme of the task to be processed perform data consistency processing on the data variables of the task to be processed based on intermediate variables, until the data consistency processing stops when the processing task ends. By generating different data consistency processing schemes through different attributes of the data exchanged between processing tasks, the task interaction data of the battery management system is prevented from being tampered with, ensuring development efficiency and requirement coverage, and thus ensuring the reliability of the battery management system's electronic control unit.
[0089] Please see Figure 2 , Figure 3 , Figure 2 This is one of the structural schematic diagrams of a data consistency processing device for a battery management system provided in an embodiment of this application; Figure 3 This is a second schematic diagram of the structure of a data consistency processing device for a battery management system provided in an embodiment of this application. Figure 2 As shown, the data consistency processing device 200 includes:
[0090] The data input module 210 is used to acquire data information from multiple pending tasks of the battery management system; wherein, the data information is data that requires data consistency protection, and the data information includes the variable name of the data sending interface, the data transmission direction, the data type, the data dimension, the variable name of the data receiving interface, and the running cycle;
[0091] The data processing module 220 is used to perform interface generation processing, intermediate variable generation processing, data transmission relationship processing, and task name generation processing on the data information of each task to be processed, and to determine the processed data information of each task to be processed.
[0092] The scheme determination module 230 is used to determine the data consistency processing scheme for each of the tasks to be processed based on the processed data information of each task to be processed.
[0093] Data processing module 240 is used for the data sending interface and data receiving interface of the task to be processed, which are arrays in the data dimension of the data interface, to perform data consistency processing on the data variables of the task to be processed based on intermediate variables, until the data consistency processing stops when the processing task ends.
[0094] Furthermore, when the data processing module 220 is used for interface generation processing, specifically for performing interface generation processing, intermediate variable generation processing, data transfer relationship processing, and task name generation processing on the data information of each task to be processed, and determining the processed data information of each task to be processed, the data processing module 220 is used for:
[0095] The variable names of the data sending interface and the variable names of the data receiving interface are processed by generating code, and the variable names of the data sending interface and the variable names of the data receiving interface are matched with the data dimension based on preset matching rules to determine the processed data information of each task to be processed.
[0096] Furthermore, when the data processing module 220 performs interface generation processing, intermediate variable generation processing, data transfer relationship processing, and task name generation processing on the data information of each task to be processed, and determines the processed data information of each task to be processed, the data processing module 220 is specifically used for:
[0097] When the data transmission direction is the forward transmission direction, an intermediate variable is generated for the left-hand variable, and the left-hand variable serves as the main variable of the intermediate variable.
[0098] When the data transmission direction is the reverse transmission direction, an intermediate variable is generated for the right-hand variable, and the right-hand variable serves as the main variable of the intermediate variable; wherein, data transmission from left to right is the forward transmission direction, and data transmission from right to left is the reverse transmission direction.
[0099] Furthermore, when the data processing module 220 performs interface generation processing, intermediate variable generation processing, data transfer relationship processing, and task name generation processing on the data information of each task to be processed to determine the processed data information of each task to be processed, the data processing module 220 is specifically used for:
[0100] Based on the running cycle and the data transmission direction, the task name information is generated in the processed data information.
[0101] Furthermore, when determining a data consistency processing scheme for each task based on the processed data information of each task to be processed, the scheme determination module 230 is specifically used for:
[0102] Determine the type of data dimension in the processed data information of the task to be processed;
[0103] If the data dimension is of a single variable type, then the data consistency processing scheme is prohibited from performing data consistency processing on the task to be processed.
[0104] If the data dimension is an array-based interface, then the data consistency processing scheme controls the data consistency processing of the task to be processed.
[0105] Furthermore, when the data processing module 240 is used for the task to be processed, where the data dimension of the data interface is in array form, the data sending interface and data receiving interface in the data consistency processing scheme of the task to be processed perform data consistency processing on the data variables of the task to be processed based on intermediate variables, until the data consistency processing stops when the processing task ends, the data processing module 240 is specifically used for:
[0106] When the data transmission direction is forward, the first interface function in the data sending interface updates all data values of the left variable to the intermediate variable, and the second interface function updates all data values of the intermediate variable to the right variable of the data receiving interface; wherein, locking protection is implemented during the process of transferring the left variable to the intermediate variable, and interruption is prohibited during the assignment of the left variable and the intermediate variable;
[0107] When the data transmission direction is reverse, the first interface function updates all data values of the right-hand variable to the intermediate variable, and the second interface function updates all data values of the intermediate variable to the left-hand variable.
[0108] Furthermore, such as Figure 3 As shown, the data consistency processing device 200 also includes a code generation module 250, which is used for:
[0109] The code for generating and processing the intermediate variables, the first interface function, and the second interface function are stored in the corresponding source files.
[0110] This application provides a data consistency processing device for a battery management system. The device includes: a data input module for acquiring data information of multiple tasks to be processed from the battery management system; wherein the data information is data requiring data consistency protection, and includes variable names of data sending interfaces, data transmission direction, data type, data dimension, variable names of data receiving interfaces, and running cycle; a data processing module for performing interface generation processing, intermediate variable generation processing, data transmission relationship processing, and task name generation processing on the data information of each task to be processed, to determine the processed data information of each task; a scheme determination module for determining a data consistency processing scheme for each task based on the processed data information; and a data processing module for performing data consistency processing on the data variables of a task to be processed based on intermediate variables in the data sending and receiving interfaces of the data sending and receiving interfaces of the task to be processed, for tasks whose data dimensions are in array form, until the processing task ends. By processing the different attributes of the data exchanged between tasks, different data consistency processing schemes are generated, ensuring that the task interaction data of the battery management system is not tampered with, guaranteeing development efficiency and requirement coverage, and thus ensuring the reliability of the battery management system's electronic control unit.
[0111] Please see Figure 4 , Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 4 As shown, the electronic device 400 includes a processor 410, a memory 420, and a bus 430.
[0112] The memory 420 stores machine-readable instructions executable by the processor 410. When the electronic device 400 is running, the processor 410 communicates with the memory 420 via the bus 430. When the machine-readable instructions are executed by the processor 410, they can perform the operations described above. Figure 1 The steps of the data consistency processing method of the battery management system in the method embodiment shown are described in detail in the method embodiment, and will not be repeated here.
[0113] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, can perform the above-described actions. Figure 1 The steps of the data consistency processing method of the battery management system in the method embodiment shown are described in detail in the method embodiment, and will not be repeated here.
[0114] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0115] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the shown or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.
[0116] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0117] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0118] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0119] Finally, it should be noted that the above-described embodiments are merely specific implementations of this application, used to illustrate the technical solutions of this application, and not to limit them. The scope of protection of this application is not limited thereto. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this application. Such modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A data consistency processing method for a battery management system, characterized in that, The data consistency processing method includes: Acquire data information from multiple pending tasks of the battery management system; wherein, the data information is data that requires data consistency protection, and the data information includes the variable name of the data sending interface, the data transmission direction, the data type, the data dimension, the variable name of the data receiving interface, and the running cycle; For each of the tasks to be processed, the data information is processed by interface generation, intermediate variable generation, data transmission relationship processing, and task name generation to determine the processed data information of each task to be processed. Based on the processed data information of each of the tasks to be processed, a data consistency processing scheme for each of the tasks to be processed is determined. For the task to be processed where the data dimension of the data interface is in the form of an array, the data sending interface and the data receiving interface in the data consistency processing scheme of the task to be processed perform data consistency processing on the data variables of the task to be processed based on intermediate variables, and stop the data consistency processing when the processing task ends.
2. The data consistency processing method according to claim 1, characterized in that, Regarding the interface generation process, the step of performing interface generation processing, intermediate variable generation processing, data transfer relationship processing, and task name generation processing on the data information of each task to be processed, to determine the processed data information of each task to be processed, includes: The variable names of the data sending interface and the variable names of the data receiving interface are processed by generating code, and the variable names of the data sending interface and the variable names of the data receiving interface are matched with the data dimension based on preset matching rules to determine the processed data information of each task to be processed.
3. The data coherency processing method of claim 1, wherein, Regarding the intermediate variable generation process, the steps of performing interface generation processing, intermediate variable generation processing, data transfer relationship processing, and task name generation processing on the data information of each task to be processed, to determine the processed data information of each task to be processed, include: When the data transmission direction is forward, an intermediate variable is generated for the left-hand variable, and the left-hand variable serves as the main variable of the intermediate variable. When the data transmission direction is the reverse transmission direction, an intermediate variable is generated for the right-hand variable, and the right-hand variable serves as the main variable of the intermediate variable; wherein, data transmission from left to right is the forward transmission direction, and data transmission from right to left is the reverse transmission direction.
4. The data coherency processing method of claim 1, wherein, Regarding the task name generation process, the steps of performing interface generation processing, intermediate variable generation processing, data transfer relationship processing, and task name generation processing on the data information of each task to be processed, to determine the processed data information of each task to be processed, include: Based on the running cycle and the data transmission direction, the task name information is generated in the processed data information.
5. The data coherency processing method of claim 1, wherein, The step of determining a data consistency processing scheme for each task based on the processed data information of each task to be processed includes: Determine the type of data dimension in the processed data information of the task to be processed; If the data dimension is of a single variable type, then the data consistency processing scheme is prohibited from performing data consistency processing on the task to be processed. If the data dimension is an array-based interface, then the data consistency processing scheme controls the data consistency processing of the task to be processed.
6. The data coherency processing method of claim 1, wherein, The data to be processed for the data interface is in array form. The data consistency processing scheme for this task includes data sending and receiving interfaces performing data consistency processing on the data variables of the task based on intermediate variables, until the processing task finishes running and the data consistency processing stops. This includes: When the data transmission direction is forward, the first interface function in the data sending interface updates all data values of the left variable to the intermediate variable, and the second interface function updates all data values of the intermediate variable to the right variable of the data receiving interface; wherein, locking protection is implemented during the process of transferring the left variable to the intermediate variable, and interruption is prohibited during the assignment of the left variable and the intermediate variable; When the data transmission direction is reverse, the first interface function updates all data values of the right-hand variable to the intermediate variable, and the second interface function updates all data values of the intermediate variable to the left-hand variable.
7. The data coherency processing method of claim 6, wherein, For the task to be processed where the data dimension interface is in array form, the data sending and receiving interfaces in the data consistency processing scheme of the task to be processed perform data consistency processing on the data variables of the task to be processed based on intermediate variables. This data consistency processing continues until the task finishes running and the data consistency processing stops. The data consistency processing method further includes: The code for generating and processing the intermediate variables, the first interface function, and the second interface function are stored in the corresponding source files.
8. A data consistency processing device for a battery management system, characterized in that, The data consistency processing device includes: The data input module is used to acquire data information from multiple pending tasks of the battery management system; wherein, the data information is data that requires data consistency protection, and the data information includes the variable name of the data sending interface, the data transmission direction, the data type, the data dimension, the variable name of the data receiving interface, and the running cycle; The first data processing module is used to perform interface generation processing, intermediate variable generation processing, data transmission relationship processing, and task name generation processing on the data information of each task to be processed, and to determine the processed data information of each task to be processed. The scheme determination module is used to determine the data consistency processing scheme for each of the tasks to be processed based on the processed data information of each task to be processed. The second data processing module is used for the task to be processed where the data dimension of the data interface is in the form of an array. The data sending interface and the data receiving interface of the task to be processed perform data consistency processing on the data variables of the task to be processed based on intermediate variables until the processing task ends.
9. An electronic device, comprising: include: The device includes a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. The machine-readable instructions are executed by the processor to perform the steps of the data consistency processing method of the battery management system as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the data consistency processing method for the battery management system as described in any one of claims 1 to 7.