Implementation method and equipment of virtual battery management system, medium and program product
By establishing a model file of the virtual battery management system and referring to the functional components of the real BMS, a virtual battery management system FMU file that complies with the FMI standard is generated, which solves the problem of BMS software testing relying on hardware in the existing technology, and achieves efficient and rapid testing and verification.
Patent Information
- Application Number
- CN202411912089.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2025-04-15
AI Technical Summary
In the prior art, the software testing of battery management system (BMS) of new energy vehicle electronics relies on hardware prototypes and real ECUs, resulting in low testing efficiency, low timeliness, and limited by hardware resources.
By establishing a model file of the virtual battery management system, referring to the functional components of the real BMS, establishing a connection relationship between the module interface, and through the virtual operating system scheduling model module, a virtual battery management system FMU file that complies with the FMI standard is generated to achieve testing of the BMS functional components.
It realizes rapid and effective testing and verification of BMS functional components without relying on hardware, reduces the dependence of software testing on hardware resources, and speeds up the research and development progress.
Smart Images

Figure CN119829210A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computers, and in particular to a method, device, medium and program product for implementing a virtual battery management system. Background Art
[0002] With the development of electronic software for new energy vehicles, the field of automotive electronic software development has a series of highly vertical demands, one of the most notable of which is the demand for safe and efficient software testing methods. Traditional automotive development tends to use hardware prototypes and real electronic control units (ECUs) for software testing, but since hardware equipment is often produced in the middle and late stages of the development cycle, the use of hardware prototypes and real ECUs brings cost and time challenges to automotive development.
[0003] As the core ECU of new energy vehicle electronics, the safe and efficient software testing of the Battery Management System (BMS) is increasingly valued. Software testing that completely relies on hardware prototypes and real ECUs has delays and is limited by hardware resources.
[0004] At present, the testing method of BMS in the industry is mainly based on hardware testing, which requires the design and production of hardware prototypes. Therefore, the current testing method relies on hardware resources, and the testing efficiency is low and the timeliness is not high. Summary of the invention
[0005] The purpose of the present invention is to provide a method, device, medium and program product for implementing a virtual battery management system. By implementing a method and system for virtual battery management that complies with the FMI standard, it can be tested and verified on any virtual vehicle platform that complies with the FMI standard.
[0006] An embodiment of the present invention discloses a method for implementing a virtual battery management system, the method comprising:
[0007] A creation step, creating an empty model file, and creating a plurality of model modules with module interfaces in the model file according to the functional components of the real battery management system;
[0008] A reference step, establishing a reference relationship between the plurality of model modules and the functional components of the real battery management system, and referencing the functional components of the real battery management system to the model modules based on the reference relationship;
[0009] A connection step, establishing a connection relationship between module interfaces of different model modules, and connecting different model modules based on the connection relationship;
[0010] A scheduling step, establishing a virtual operating system in the model file, wherein the virtual operating system schedules the model module by means of simulation triggering;
[0011] A generating step is to generate the virtual battery management system based on the model file for establishing the virtual operating system.
[0012] Optionally, establishing a reference relationship between the multiple model modules and the functional components of the real battery management system includes: setting a name attribute of the model module to be consistent with a name attribute of the functional component of the real battery management system being referenced.
[0013] Optionally, establishing a reference relationship between the multiple model modules and the functional components of the real battery management system includes: setting properties of the module interface of the model module to be consistent with properties of the component interface of the referenced functional components of the real battery management system.
[0014] Optionally, the attributes of the module interface and the attributes of the component interface include interface name, data type and data dimension.
[0015] Optionally, the establishing step includes establishing an empty model file using Matlab or VectorCAST.
[0016] Optionally, the generating step further includes exporting an FMU file of the virtual battery management system.
[0017] An embodiment of the present invention discloses an electronic device, the device comprising a memory storing computer executable instructions and a processor, the processor being configured to execute the instructions to implement the implementation method of the virtual battery management system.
[0018] An embodiment of the present invention discloses a computer-readable storage medium, in which at least one computer instruction is stored. The at least one instruction is loaded and executed by a processor to implement the implementation method of the virtual battery management system.
[0019] The embodiment of the present invention discloses a computer program product, which includes computer instructions. When the computer instructions are executed, the implementation method of the virtual battery management system is implemented.
[0020] Compared with the prior art, the main differences and effects of the implementation methods of the present invention are: the solution of the present invention integrates a model containing all battery software functional components through reference relationships, schedules the components among the integrated model containing the functional components, logically connects the interfaces between the components, and exports a functional model unit (FMU) file of a virtual battery management system that complies with the functional model interface (FMI) standard. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 is a flow chart of a method for implementing a virtual battery management system according to an embodiment of the present invention;
[0022] Figure 2 is a structural block diagram of a virtual battery management system according to an embodiment of the present invention;
[0023] Figure 3 is a hardware structure block diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0024] The present invention will be further described below in conjunction with specific embodiments and accompanying drawings. It will be appreciated that the specific embodiments described herein are intended only to explain the present invention, rather than to limit the present invention. In addition, for ease of description, only some, but not all, structures or processes related to the present invention are shown in the accompanying drawings. It should be noted that in this specification, similar reference numerals and letters represent similar items in the following drawings.
[0025] It should be understood that although the terms "first", "second", etc. may be used herein to describe various features, these features should not be limited by these terms. These terms are used only to distinguish and should not be understood as indicating or implying relative importance. For example, a first feature may be referred to as a second feature, and similarly a second feature may be referred to as a first feature without departing from the scope of the exemplary embodiments.
[0026] In order to make the purpose, technical solutions and advantages of the present invention more clear, the following will describe the embodiments of the present invention in conjunction with the accompanying drawings.
[0027] As the core ECU of new energy vehicle electronics, BMS relies entirely on hardware prototypes and real ECUs for software testing, which results in delays and low testing efficiency, and is also limited by hardware resources.
[0028] In order to solve the above technical problems, the solution of the present invention provides a method for implementing a virtual battery management system. First, a model file of a virtual BMS is created, and each model module in the model file references each functional component of the real BMS that needs to be tested. Then a scheduling system is created in the model file to schedule each module in the model file. Finally, a virtual battery management system FMU file that conforms to the FMI standard is exported based on the model file. The FMU file can be used to test each functional component of the BMS to be tested without relying on hardware. A detailed description is given below.
[0029] Figure 1 The figure is a flow chart of a method for implementing a virtual battery management system according to an embodiment of the present invention.
[0030] The implementation method of the virtual battery management system includes step S100, step S200, step S300, step S400 and step S500. Figure 2 This is a block diagram of a virtual battery management system according to an embodiment of the present invention. For ease of understanding, the following embodiments are combined with Figure 2 An exemplary description is given.
[0031] Step S100: Create an empty model file 210, and create a plurality of model modules 220 with module interfaces in the model file 210 according to the functional components of a real battery management system.
[0032] A real battery management system requires the cooperation of functional components of various types of software. A functional component is a collection of software that processes a function of the battery management system software. Exemplarily, the functional component may be a battery cell analysis and diagnosis functional component, a fast charging functional component, a heat dissipation functional component, and a battery monitoring component. Those skilled in the art will appreciate that, for the scheme of the present invention, the type of functional component should not be used as a limitation of the present invention, and should be acquired and integrated specifically according to the needs of the battery system.
[0033] As an implementation method, Matlab or VectorCAST can be used to create an empty model file. Figure 2As shown, the virtual BMS framework establishes an empty model file 210 based on Matlab or VectorCAST. For example, an empty .xml format file is created using Simulink in Matlab. The .xml format file can be an .xml format file in a .slx format model file established by Simulink. Then, in order to build a virtual BMS to simulate a real BMS, multiple model modules 220 corresponding to multiple functional components in a real BMS are established in the model file 210. These model modules 220 can reference other models outside the model file 210. For example, the model module 220 can be a Model Reference model module in Simulink, and such a model module can use Simulink's Model Reference to reference other models (sub-models) outside the model file (main model). The model module 220 is configured to have a module interface, and different model modules 220 can be connected to each other through these module interfaces.
[0034] Step S200 : establishing a reference relationship between a plurality of model modules 220 and functional components of a real battery management system, and referencing the functional components of the real battery management system to the model modules 220 based on the reference relationship.
[0035] As an implementation mode, establishing a reference relationship between multiple model modules and functional components of a real battery management system includes: setting the name attribute of the model module to be consistent with the name attribute of the functional component of the referenced real battery management system.
[0036] Continue to refer Figure 2 , the model module 220 established in the created model file 210 has a reference attribute, and the reference attribute includes the name of the referenced model. For example, the model module 220 is a Model Reference model module, and its reference attribute includes Model name. The value of the Model name is set to the functional component of the referenced real BMS, that is, a reference relationship is established between the model module 220 and the functional component of the real BMS. When the model module 220 is scheduled in the simulation, the corresponding functional component of the real BMS will be referenced. The functional component of the real BMS can also be a model with a format consistent with the model file 210. In the embodiment of the present application, the model module 220 with a reference relationship established is called the referenced model module 230.
[0037] It is worth noting that in order to maintain the consistency of the data format of the model file 210 and the functional components of the real BMS, the functional components of the real BMS and their properties, parameters and types of signals, etc. can be declared in a file. The file declared in the file can be a table, a text file, etc., such as a .xml format file. For example, when using matlab to create an empty model file 210, the format of the model module 220 can be .slx format, or when using VectorCAST to create an empty model file 210, the format of the model module 220 can be .SysML format.
[0038] As an implementation method, establishing a reference relationship between multiple model modules and functional components of a real battery management system includes: setting the properties of the module interface of the model module to be consistent with the properties of the component interface of the functional component of the referenced real battery management system.
[0039] The functional components of a real BMS have component interfaces. For example, the cell voltage detection component has a cell voltage interface for reading the voltage of the detected battery; the cell temperature detection component has a cell temperature interface for reading the temperature of the detected battery. The component interface has properties, which may include an interface name, a data type, and a data dimension. Specifically, for example, the interface type of the cell temperature detection component is "cell temperature interface", and the corresponding interface name in its properties is "VaLLSR_T_CellTempArray", the data type is "single precision", and the data dimension is the corresponding value characterizing the temperature and numerical attributes.
[0040] like Figure 2 As shown, the model module 230 also has a module interface, such as a module interface 240, which can be used to interact with other model modules or other software. Among them, at least a part of the module interface of the model module 230 corresponds to the component interface of the functional component referenced by the model module 230, and its attributes are also consistent with the attributes of the component interface of the referenced functional component. For example, the model module 230 references a cell temperature detection component, and the module interface 240 is also a cell temperature interface, and its attributes are also: the interface name is "VaLLSR_T_CellTempArray", the data type is "single precision", and the data dimension is the corresponding value characterizing the temperature and numerical attributes.
[0041] Step S300: establishing connection relationships between module interfaces 240 of different model modules, and connecting different referenced model modules 230 based on the connection relationships.
[0042] As an implementation mode, establishing a connection relationship between module interfaces 240 of different model modules includes maintaining consistency in interface names, data types, and data dimensions of the interconnected module interfaces.
[0043] In one example, Figure 2 As shown, when the interface name, data type and data dimension remain consistent, they are classified into one type of interface, such as the six types of interfaces ABCDEF shown in the figure, and similar interfaces in different model modules are connected. For example, according to the model name and interface name, each referenced model module 230 is connected through MATLAB or VectorCAST.
[0044] Step S400: A virtual operating system (OS) is established in the model file 210, and the virtual OS schedules the referenced model module 230 by means of simulation triggering.
[0045] In one example, each referenced model module 230 in the model file 210 connected to the interface 240 is triggered by a Simulink event to establish a virtual OS system. For example, a virtual OS system is written using a Python script based on the Simulink Stateflow tool to complete the scheduling of each referenced model module 230.
[0046] Step S500: Generate a virtual battery management system based on the model file for establishing the virtual operating system.
[0047] As an implementation method, the FMU file of the virtual BMS may also be exported.
[0048] In one example, a model file of the virtual OS of the scheduling system is added, including multiple model components 230 referenced therein, and the entire virtual battery management system FMU file that complies with the FMI standard is exported through the system complier tool. The FMU file can be used to test the functional components of the real BMS without relying on hardware.
[0049] The implementation method of the virtual battery management system of the present invention has the functions of the functional components of the actual battery management system. The virtual battery management system of this solution complies with the FMI specification and can be verified and tested on any platform that complies with the FMI specification. It can quickly perform functional verification of the battery management system, reduce the dependence of software testing on hardware resources, and speed up the research and development progress.
[0050] According to some embodiments of the present invention, an electronic device is disclosed. The device includes a memory storing computer executable instructions and a processor. The processor is configured to execute the instructions to implement a method for implementing a virtual battery management system.
[0051] Figure 3 is a hardware structure block diagram of an electronic device according to an embodiment of the present invention.
[0052] like Figure 3 As shown, the electronic device 300 may include one or more processors 302, a system control logic 308 connected to at least one of the processors 302, a system memory 304 connected to the system control logic 308, a non-volatile memory (NVM) 306 connected to the system control logic 308, and a network interface 310 connected to the system control logic 308.
[0053] The processor 302 may include one or more single-core or multi-core processors. The processor 302 may include any combination of general-purpose processors and special-purpose processors (e.g., graphics processors, application processors, baseband processors, etc.). In an embodiment of the present invention, the processor 302 may be configured to execute the following operations: Figure 1 The implementation method of the virtual battery management system shown.
[0054] In some embodiments, system control logic 308 may include any suitable interface controller to provide any suitable interface to at least one of processors 302 and / or any suitable device or component in communication with system control logic 308 .
[0055] In some embodiments, the system control logic 308 may include one or more memory controllers to provide an interface to the system memory 304. The system memory 304 may be used to load and store data and / or instructions. In some embodiments, the system memory 304 of the electronic device 300 may include any suitable volatile memory, such as a suitable dynamic random access memory (DRAM).
[0056] The non-volatile memory 306 may include one or more tangible, non-transitory computer-readable media for storing data and / or instructions. In some embodiments, the non-volatile memory 306 may include any suitable non-volatile memory such as flash memory and / or any suitable non-volatile storage device, such as at least one of a HDD (Hard Disk Drive, hard disk drive), a CD (Compact Disc, optical disk) drive, and a DVD (Digital Versatile Disc, digital versatile disc) drive.
[0057] The non-volatile memory 306 may include a portion of storage resources installed on a device of the electronic device 300, or it may be accessible by the device but not necessarily a portion of the device. For example, the non-volatile memory 306 may be accessed over a network via the network interface 310.
[0058] In particular, system memory 304 and non-volatile memory 306 may include a temporary copy and a permanent copy of instructions 320, respectively. Instructions 320 may include instructions that, when executed by at least one of processors 302, cause electronic device 300 to implement the following: Figure 1 Instructions for implementing the method of the virtual battery management system shown. In some embodiments, the instructions 320 , hardware, firmware and / or software components thereof may be additionally / alternatively placed in the system control logic 308 , the network interface 310 and / or the processor 302 .
[0059] The network interface 310 may include a transceiver for providing a radio interface for the electronic device 300, thereby communicating with any other suitable device (e.g., a front-end module, an antenna, etc.) through one or more networks. In some embodiments, the network interface 310 may be integrated with other components of the electronic device 300. For example, the network interface 310 may be integrated with at least one of the processor 302, the system memory 304, the NVM 306, and a firmware device (not shown) having instructions. When at least one of the processors 302 executes the instructions, the electronic device 300 implements Figure 1 One or more of the various embodiments shown.
[0060] The network interface 310 may further include any suitable hardware and / or firmware to provide a multiple-input multiple-output radio interface. For example, the network interface 310 may be a network adapter, a wireless network adapter, a telephone modem, and / or a wireless modem.
[0061] In one embodiment, at least one of the processors 302 may be packaged together with one or more controllers for the system control logic 308 to form a system in package (SiP). In one embodiment, at least one of the processors 302 may be integrated on the same die with one or more controllers for the system control logic 308 to form a system on a chip (SoC).
[0062] The electronic device 300 may further include an input / output (I / O) device 312 connected to the system control logic 308. The I / O device 312 may include a user interface to enable a user to interact with the electronic device 300; the design of the peripheral component interface enables the peripheral components to interact with the electronic device 300. In some embodiments, the electronic device 300 further includes a sensor for determining at least one of an environmental condition and location information related to the electronic device 300.
[0063] In some embodiments, input / output (I / O) devices 312 may include, but are not limited to, a display (e.g., a liquid crystal display, a touch screen display, etc.), speakers, a microphone, one or more cameras (e.g., a still image camera and / or a video camera), a flashlight (e.g., an LED flash), and a keyboard.
[0064] In some embodiments, the peripheral component interface may include, but is not limited to, a non-volatile memory port, an audio jack, and a power interface.
[0065] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 300. In other embodiments of the present application, the electronic device 300 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0066] Program code can be applied to input instructions to perform the functions described in the present invention and generate output information. The output information can be applied to one or more output devices in a known manner. For the purposes of this application, a system for processing instructions including processor 302 includes any system having a processor such as a digital signal processor (DSP), a microcontroller, an application specific integrated circuit (ASIC), or a microprocessor.
[0067] Program code can be implemented with high-level programming language or object-oriented programming language to communicate with the processing system. When necessary, program code can also be implemented with assembly language or machine language. In fact, the mechanism described in the present invention is not limited to the scope of any specific programming language. In either case, the language can be a compiled language or an interpreted language.
[0068] According to one embodiment of the present invention, a computer-readable storage medium is further proposed, wherein at least one computer instruction is stored in the computer-readable storage medium, and the at least one instruction is loaded and executed by a processor to implement the aforementioned implementation method of the virtual battery management system.
[0069] According to one embodiment of the present invention, a computer program product is further provided. The computer program product includes computer instructions. When the computer instructions are executed, the aforementioned implementation method of the virtual battery management system is implemented.
[0070] Illustrative embodiments of the present invention include, but are not limited to, a method for implementing a virtual battery management system, an air conditioning system, a device, a medium, and a program product.
[0071] The various aspects of the illustrative embodiments will be described using terms commonly used by those skilled in the art to convey the essence of their work to other persons skilled in the art. However, it is apparent to those skilled in the art that some alternative embodiments may be implemented using some of the features described. For purposes of explanation, specific numbers and configurations are set forth so that the illustrative embodiments are more thoroughly understood. However, it is apparent to those skilled in the art that alternative embodiments may be implemented without the specific details. In some other cases, some well-known features are omitted or simplified herein to avoid obscuring the illustrative embodiments of the present invention.
[0072] In addition, various operations will be described as multiple separate operations in a manner that is most helpful for understanding the illustrative embodiments; however, the order of description should not be interpreted as implying that these operations must rely on the order of description, and many of the operations can be implemented in parallel, concurrently, or simultaneously. In addition, the order of the operations can also be rearranged. When the described operations are completed, the process can be terminated, but can also have additional steps not included in the drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.
[0073] References in the specification to "an example", "an example", "an embodiment", "an implementation", etc. indicate that the described embodiment may include a particular feature, structure, or property, but each embodiment may or may not necessarily include the particular feature, structure, or property. Moreover, these phrases are not necessarily directed to the same embodiment. In addition, when particular features are described in conjunction with a specific embodiment, the knowledge of those skilled in the art can affect the combination of these features with other embodiments, whether or not these embodiments are explicitly described.
[0074] Unless the context dictates otherwise, the terms "comprising," "having," and "including" are synonymous. The phrase "A and / or B" means "(A), (B), or (A and B)."
[0075] As used herein, the term "module" may refer to, be part of, or include: memory (shared, dedicated, or group) for running one or more software or firmware programs, application-specific integrated circuits (ASICs), electronic circuits and / or processors (shared, dedicated, or group), combinational logic circuits, and / or other suitable components that provide the described functionality.
[0076] In the accompanying drawings, some structural or method features may be shown in a specific arrangement and / or order. However, it should be understood that such a specific arrangement and / or order is not necessary. Instead, in some embodiments, these features may be described in a manner and / or order different from that shown in the illustrative drawings. In addition, the structural or method features included in a specific figure do not mean that all embodiments need to include such features. In some embodiments, these features may not be included or may be combined with other features.
[0077] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0078] Similarly, it should be understood that in order to streamline the present invention and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the intention that the claimed invention requires more features than those expressly recited in each claim. Rather, as reflected in the claims, inventive aspects lie in less than all of the features of the individual embodiments previously disclosed. Therefore, the claims that follow the detailed description are hereby expressly incorporated into the detailed description, with each claim itself serving as a separate embodiment of the present invention.
[0079] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.
[0080] In addition, those skilled in the art will appreciate that, although some embodiments described herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the present invention and form different embodiments. For example, in the claims, any one of the claimed embodiments may be used in any combination.
Claims
1. A method for implementing a virtual battery management system, characterized in that: The method comprises: A creation step, creating an empty model file, and creating a plurality of model modules with module interfaces in the model file according to the functional components of the real battery management system; A reference step, establishing a reference relationship between the plurality of model modules and the functional components of the real battery management system, and referencing the functional components of the real battery management system to the model modules based on the reference relationship; A connection step, establishing a connection relationship between module interfaces of different model modules, and connecting different model modules based on the connection relationship; A scheduling step, establishing a virtual operating system in the model file, wherein the virtual operating system schedules the model module by means of simulation triggering; A generating step is to generate the virtual battery management system based on the model file for establishing the virtual operating system.
2. The method for implementing a virtual battery management system according to claim 1, characterized in that: The establishing of the reference relationship between the plurality of model modules and the functional components of the real battery management system includes: setting the name attribute of the model module to be consistent with the name attribute of the functional component of the real battery management system being referenced.
3. The method for implementing a virtual battery management system according to claim 1, characterized in that: The establishing of the reference relationship between the multiple model modules and the functional components of the real battery management system includes: setting the attributes of the module interface of the model module to be consistent with the attributes of the component interface of the referenced functional component of the real battery management system.
4. The method for implementing a virtual battery management system according to claim 3, characterized in that: The attributes of the module interface and the attributes of the component interface include interface name, data type and data dimension.
5. The method for implementing a virtual battery management system according to claim 1, characterized in that: The establishing step includes establishing an empty model file using Matlab or VectorCAST.
6. The method for implementing a virtual battery management system according to claim 1, characterized in that: The generating step also includes exporting an FMU file of the virtual battery management system.
7. An electronic device, characterized in that: The device comprises a processor and a memory storing computer executable instructions, wherein the processor is configured to execute the instructions to implement the method for implementing the virtual battery management system according to any one of claims 1 to 6.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one computer instruction, and the at least one instruction is loaded and executed by a processor to implement the implementation method of the virtual battery management system according to any one of claims 1 to 6.
9. A computer program product, characterized in that The computer program product includes computer instructions, and when the computer instructions are executed, the implementation method of the virtual battery management system according to any one of claims 1 to 6 is implemented.