A method, device and equipment for constructing a whole vehicle bus system based on Modelica
By constructing a vehicle bus system based on Modelica, the problem that passenger vehicle virtual buses cannot meet the requirements for multi-variable transmission and expansion is solved. This enables rapid expansion and data exchange of vehicle bus interfaces, supports the real-time addition of new controllers and the expansion of the vehicle simulation model, and improves the unified modeling capability of vehicles across multiple domains.
Patent Information
- Application Number
- CN202310594377.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-24
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2043-05-24
AI Technical Summary
Existing technologies cannot meet the expanded requirements of multivariable transmission when simulating passenger vehicle virtual buses, nor can they meet the requirements of real-time addition of new controllers and expansion of the whole vehicle simulation model, thus limiting the unified modeling of vehicles across multiple domains.
The vehicle bus system construction method based on Modelica is adopted. By establishing a controller model, a controlled object model, and an extensible bus interface model, and connecting them using the extensible bus interface model, the vehicle bus model is constructed, verified, and tested.
It enables rapid expansion of vehicle bus interfaces, supports multi-domain joint simulation, facilitates the expansion of subsystem interfaces and data interaction, and improves the coverage and scalability of vehicle simulation.
Smart Images

Figure CN116684220B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of vehicle model construction technology, and in particular to a method, apparatus and equipment for constructing a vehicle bus system based on Modelica. Background Technology
[0002] Advances in science and technology have driven the development of high-tech in the vehicle engineering industry, leading to an increase in vehicle auxiliary functions and meeting the needs of drivers for convenient operation as vehicles become more intelligent. Vehicle electronics technology is also developing towards four trends (electrification, intelligence, connectivity, and sharing). To enable extensive information exchange between in-vehicle sensors and controllers, and between controllers themselves, higher demands are placed on automotive bus technology. It must not only meet the connectivity requirements of automotive equipment but also provide strong scalability and support distributed control.
[0003] Modelica is an open, object-oriented, equation-based computer language that can be used across different fields to easily model complex physical systems.
[0004] Constructing a virtual bus model for passenger vehicles allows for the simulation of vehicle network bus system signals, simulating the specific functions and control logic implemented by the vehicle, and enabling data exchange and functional simulation among nodes. Currently, the simulation of passenger vehicle virtual buses generally uses fixed models or fixed signal transmissions, which cannot meet the expansion requirements of multi-variable transmission, cannot satisfy the real-time addition of new controllers and the expansion of the whole vehicle simulation model, and limits the unified modeling of the vehicle across multiple domains. Summary of the Invention
[0005] This invention provides a method, apparatus, and device for constructing a vehicle bus system based on Modelica, which solves the problem that current virtual buses for simulating passenger vehicles cannot meet the expansion requirements of multi-variable transmission, cannot meet the real-time addition of new controllers and the expansion of the vehicle simulation model, and limit the unified modeling of vehicles across multiple domains.
[0006] A method for constructing a vehicle bus system based on Modelica, comprising:
[0007] A controller model, a controlled object model, and a scalable bus interface model are established, and the controller model, the controlled object model, and the scalable bus interface model are written in the Modelica language.
[0008] Based on the attributes of the controller model, the controlled object model, and the scalable bus interface model, determine a first scalable bus interface model that matches the controller model, and determine a second scalable bus interface model that matches the controlled object model;
[0009] According to the connection instructions, the scalable bus interface models are connected to each other to complete the construction of the vehicle bus model;
[0010] After the vehicle bus model is built, it is verified and tested; when the verification and testing are successful, the vehicle bus model is considered to have been successfully built.
[0011] In one embodiment of the present invention, establishing a scalable bus interface model specifically includes: determining the attributes of the scalable bus interface and the variables it includes based on the defined scalable bus interface model; mapping the variables included in the scalable bus interface to input variables, output variables, or parameters of the Modelica platform; determining the type, name, initial value, and position of the transmission variables in the scalable bus interface based on the defined transmission variables; mapping the transmission variables to input variables or output variables of the Modelica platform; and testing the scalable bus interface model to ensure its correctness.
[0012] In one embodiment of the present invention, establishing a scalable bus interface model includes: determining defined sub-interfaces and paths of the sub-interfaces; and integrating the sub-interfaces into the scalable bus interface model according to the paths of the sub-interfaces.
[0013] In one embodiment of the present invention, the variables in the scalable bus interface model include multiple variables, and the data types of the variables are various.
[0014] In one embodiment of the present invention, the verification and testing of the vehicle bus model specifically includes: sending control signals from the controller model to a virtual bus through a scalable bus interface model; the control signals being determined according to the controlled object; sending the control signals to a scalable bus interface model connected to the controlled object model through the virtual bus; sending the control signals to the controlled object model through a scalable bus interface connected to the controlled object model; the controlled object model performing simulation based on the control signals to obtain simulation results; and determining the construction result of the vehicle bus model based on the simulation results.
[0015] In one embodiment of the present invention, connecting the scalable bus interface models according to the connection instruction specifically includes: generating a connection instruction according to a connect statement; connecting the first scalable bus interface model with the second scalable bus model, or connecting the second scalable bus models with each other according to the connection instruction.
[0016] In one embodiment of the present invention, the scalable bus interface model includes parameters and variables required for bus communication, for passing the parameters and variables to the controller model and the controlled object model.
[0017] A vehicle bus system construction device based on Modelica, comprising:
[0018] The model building module is used to build a controller model, a controlled object model, and a scalable bus interface model. The controller model, the controlled object model, and the scalable bus interface model are written in the Modelica language.
[0019] The matching module is used to determine a first scalable bus interface model that matches the controller model and a second scalable bus interface model that matches the controlled object model based on the attributes of the controller model, the controlled object model and the scalable bus interface model.
[0020] The virtual bus connection module is used to connect the expandable bus interface models according to the connection instructions to complete the construction of the vehicle bus model;
[0021] The verification and testing module is used to verify and test the vehicle bus model after it has been built; when the verification and testing are successful, the vehicle bus model is determined to have been successfully built.
[0022] A vehicle bus system construction device based on Modelica, comprising:
[0023] At least one processor; and,
[0024] The memory is communicatively connected to the at least one processor via a bus; wherein,
[0025] The memory stores instructions executable by the at least one processor, which are executed to perform:
[0026] A controller model, a controlled object model, and a scalable bus interface model are established, and the controller model, the controlled object model, and the scalable bus interface model are written in the Modelica language.
[0027] Based on the attributes of the controller model, the controlled object model, and the scalable bus interface model, determine a first scalable bus interface model that matches the controller model, and determine a second scalable bus interface model that matches the controlled object model;
[0028] According to the connection instructions, the scalable bus interface models are connected to each other to complete the construction of the vehicle bus model;
[0029] After the vehicle bus model is built, it is verified and tested; when the verification and testing are successful, the vehicle bus model is considered to have been successfully built.
[0030] A non-volatile storage medium storing computer-executable instructions, which are executed by a processor to perform the following steps:
[0031] A controller model, a controlled object model, and a scalable bus interface model are established, and the controller model, the controlled object model, and the scalable bus interface model are written in the Modelica language.
[0032] Based on the attributes of the controller model, the controlled object model, and the scalable bus interface model, determine a first scalable bus interface model that matches the controller model, and determine a second scalable bus interface model that matches the controlled object model;
[0033] According to the connection instructions, the scalable bus interface models are connected to each other to complete the construction of the vehicle bus model;
[0034] After the vehicle bus model is built, it is verified and tested; when the verification and testing are successful, the vehicle bus model is considered to have been successfully built.
[0035] This invention provides a method, apparatus, and device for constructing a vehicle bus system based on Modelica, which has at least the following beneficial effects:
[0036] 1. Subsystem interfaces can be quickly added to the vehicle bus interface through the expandable interface, which facilitates the expansion to other subsystems and the joint simulation of vehicles in multiple fields, making the vehicle simulation model highly scalable.
[0037] 2. The expandable interface allows for the convenient addition of output variables in subsystems, enabling the collection and selection of multiple variables for output, and the rapid definition of output variables to be output to the vehicle bus, thus facilitating data interaction between various systems;
[0038] 3. Subsystem control variables can be quickly defined through an extensible interface and input into the controlled object (subsystem) through the bus and subsystem bus interface to modify and expand the control variables of the subsystem;
[0039] 4. Easily connect the controller bus interface and the bus interfaces of each subsystem to quickly build a vehicle bus simulation model;
[0040] 5. It can build convenient and intuitive bus simulation models to realize data exchange of vehicle signals. Attached Figure Description
[0041] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this invention, illustrate exemplary embodiments of the invention and are used to explain the invention, but do not constitute an undue limitation of the invention. In the drawings:
[0042] Figure 1 A schematic diagram illustrating the steps of a vehicle bus system construction method based on Modelica, provided in an embodiment of the present invention;
[0043] Figure 2 A schematic diagram of the bus interface of the controlled object provided in an embodiment of the present invention;
[0044] Figure 3 This is a schematic diagram of sub-interface extension provided in an embodiment of the present invention;
[0045] Figure 4 This is a schematic diagram of the bus connection between the controller and the controlled object provided in an embodiment of the present invention;
[0046] Figure 5 This is a schematic diagram of a vehicle bus interface provided in an embodiment of the present invention;
[0047] Figure 6 This is a schematic diagram of the bus connection between the controller and each controlled object in a vehicle provided in an embodiment of the present invention;
[0048] Figure 7 A schematic diagram of a vehicle bus system construction device based on Modelica provided in an embodiment of the present invention;
[0049] Figure 8 This is a schematic diagram of a vehicle bus system construction device based on Modelica, provided as an embodiment of the present invention. Detailed Implementation
[0050] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be described clearly and completely below in conjunction with specific embodiments. Obviously, the described embodiments are only a part of the embodiments of this invention, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0051] It should be noted that those skilled in the art will understand, explicitly and implicitly, that the embodiments described in this invention can be combined with other embodiments without conflict. Unless otherwise defined, the technical or scientific terms used in this invention should be understood in their ordinary sense by those skilled in the art. The terms "a," "an," "an," "the," etc., used in this invention do not indicate quantity limitation and can represent singular or plural. The terms "comprising," "including," "having," and any variations thereof used in this invention are intended to cover non-exclusive inclusion; the terms "first," "second," "third," etc., used in this invention are merely to distinguish similar objects and do not represent a specific ordering of objects.
[0052] Currently, virtual buses for simulating passenger vehicles typically use fixed models or fixed signal transmissions, which cannot meet the expansion requirements of multi-variable transmission, cannot accommodate the real-time addition of new controllers and the expansion of the whole vehicle simulation model, and limits the unified modeling of vehicles across multiple domains. Therefore, by using scalable bus interfaces to construct a whole vehicle bus model, the coverage of vehicle simulation can be improved.
[0053] Extensible vehicle bus models based on Modelica typically use Modelica's physical component models to describe the physical behavior of each controlled object (also called a subsystem) in the vehicle, and use Modelica's model connection technology to connect these physical component models. A computer can use the Modelica simulation tool MWORKS.Sysplorer to simulate the behavior of the entire vehicle and obtain the state and control commands of each subsystem through the simulation results. The focus of this invention is to construct a vehicle bus model based on a vehicle simulation model built using the Modelica language, through an expandable interface.
[0054] Modelica's Scalable Bus Interface (SBI) is a way to represent different bus interfaces. It can be used to simulate different bus types, such as CAN, LIN, FlexRay, etc. By using the SBI, it's easy to model and simulate the entire vehicle communication system in Modelica, while also supporting switching and expansion between different bus types.
[0055] In Modelica, the extensible bus interface is typically defined using a "Modelica expandable connector." A model interface is a special type of class that can contain multiple variables, functions, and connections. By using model interfaces, different models can be connected to achieve communication and data exchange.
[0056] In a scalable bus interface, common variables include message ID, data bit width, send / receive flags, etc. Functions can also be defined to represent different bus communication protocols, such as sending data, receiving data, and checking for errors. To achieve the above functions, this invention proposes a method, apparatus, and device for constructing a vehicle bus system based on Modelica. These are described in detail below.
[0057] Figure 1 A schematic diagram illustrating the steps of a method for constructing a vehicle bus system based on Modelica, as provided in an embodiment of the present invention, may include the following steps:
[0058] S110: Establish the controller model, the controlled object model, and the scalable bus interface model. The controller model, the controlled object model, and the scalable bus interface model are written in the Modelica language.
[0059] Specifically, the required bus interfaces and protocols need to be determined: Before establishing the vehicle bus model, it is necessary to determine the bus interfaces and protocols to be used by various controller models or controlled object models in the vehicle, such as Controller Area Network (CAN), Local Interconnect Network (LIN), FlexRay bus, etc. These required controller and controlled object models determine the bus interfaces and protocols.
[0060] Creating Controller Models: For each controller using a bus interface, a corresponding controller model needs to be created. These controller models should be written in Modelica and implement the communication functionality with the required bus interface. The controller model includes the processor, bus controller, communication interface, etc.
[0061] Creating Controlled Object Models: For each controlled object using a bus interface, a corresponding controlled object model needs to be created. These models should be written in Modelica and implement communication functionality with the required bus interface. The controlled object model includes sensors, actuators, communication interfaces, etc.
[0062] Establish a scalable bus interface model: Establish a scalable bus interface model to allow the controller model and the controlled object model to connect to the required bus interface. The scalable bus interface model should define the parameters and variables required for bus communication and pass these parameters and variables to the controller model and the controlled object model.
[0063] In one embodiment of the present invention, establishing a scalable bus interface model specifically includes: determining the attributes of the scalable bus interface and the variables it includes based on the defined scalable bus interface model; mapping the variables included in the scalable bus interface to input variables, output variables, or parameters of the Modelica platform; determining the type, name, initial value, and position of the transmission variables in the scalable bus interface based on the defined transmission variables; mapping the transmission variables to input variables or output variables of the Modelica platform; and testing the scalable bus interface model to ensure its correctness.
[0064] In one embodiment of the present invention, the scalable bus interface model includes parameters and variables required for bus communication, which are used to pass the parameters and variables to the controller model and the controlled object model.
[0065] Specifically, the steps to establish a scalable bus interface are as follows:
[0066] 1. Define the interface: First, you need to define the name of the scalable bus interface and the variables it contains. Variables include input variables, output variables, and parameters.
[0067] 2. Implement the interface: When implementing the interface, you need to map the defined variables to Modelica's input variables, output variables, and parameters.
[0068] 3. Define transfer variables: When defining transfer variables, you need to define their type, name, initial value, and their location in the scalable bus interface.
[0069] 4. Implementing Transfer Variables: When implementing transfer variables, they need to be mapped to Modelica's input and output variables. Transfer variables can be any variable in the controller model or the controlled object model, such as sensor readings, actuator commands, or controller states.
[0070] 5. Test Interface: The scalable bus interface needs to be tested to ensure that it can correctly transfer variables and communicate with other devices.
[0071] Furthermore, in Modelica, expandable bus interfaces can be defined using Connectors. A connector can be viewed as a set of signals or variables that describe the interface between two or more components. A connector is created in Modelica, and then defined as an expandable bus interface (BusConnector) using the expandable connector statement. This bus interface is an integrated interface combining a multi-controlled object bus interface and a controller bus interface, integrating controller buses, engine buses, transmission buses, driver buses, battery buses, brake buses, body buses, motor buses, etc.
[0072] There are two types of scalable bus interfaces:
[0073] 1. Bus interface for scalable variables
[0074] In one embodiment of the present invention, the variables in the scalable bus interface model include multiple variables, and the data types of the variables are various.
[0075] Specifically, to reflect the scalability of the scalable bus interface and ensure flexibility in variable types and quantities, the scalable bus interface should allow variables to be added, deleted, or modified without changing the interface structure. For example... Figure 2 The diagram shows the bus interface of a controlled object capable of expanding variables. Therefore, when defining an expandable bus interface, flexible data types, such as arrays and structures, should be used, and a sufficient number of variables should be provided so that new variables can be easily added in the future. In systems using a controller model, communication and data exchange between multiple components can be achieved by connecting the expandable bus interface of the controller model to the expandable bus interfaces of other components. In this way, the system's functionality and performance can be expanded and modified as needed without modifying the controller model itself.
[0076] Furthermore, a single variable can be customized and extended on a separate bus interface, and variables that need to be transmitted on the bus can be easily added after the model is built.
[0077] Modelica uses a Scalable Bus Interface to connect different physical components and subsystems. The Scalable Bus Interface is a declarative language in which multiple signal variables can be defined and transferred to the connected components.
[0078] In a scalable bus interface, variables can be expanded or reduced by adding or removing signals. This means that new signal variables can be added to the interface or old signal variables can be removed without changing the components or subsystems connected to that interface. This makes the interface easy to expand or upgrade without affecting other components in the system. Interface definitions in Modelica adopt an object-oriented programming paradigm and can be inherited and extended. By using inheritance, new interfaces can be defined based on existing interface definitions, thus achieving variable scalability.
[0079] For example, a regular motor interface can be extended to a motor interface with thermal characteristics, or a multiphysics coupled motor interface. In these extended interfaces, new variables can be added to describe the required characteristics and behaviors without affecting the original interface definition.
[0080] Adding or removing variables in the Scalable Bus Interface requires modifying the interface definition, followed by recompiling and deploying the model. Specifically, this involves modifying the interface definition file, adding or removing variables, and then recompiling the model using the Modelica compiler. The compiled model can then be simulated and tested in a simulation environment that supports the Modelica language. If the Scalable Bus Interface needs to be used in an embedded system, the model must also be converted to C code and adapted and deployed to the embedded platform.
[0081] 2. Bus interface with expandable sub-interfaces
[0082] In one embodiment of the present invention, establishing a scalable bus interface model includes: determining defined sub-interfaces and paths of the sub-interfaces; and integrating the sub-interfaces into the scalable bus interface model according to the paths of the sub-interfaces.
[0083] Specifically, such as Figure 3As shown, sub-interfaces can be added on top of the expandable interface, and each sub-interface can further extend variables. For example, a Battery Management System (BMS) includes a battery safety control module and a motor control module. The battery safety control module bus interface transmits variables such as motor speed, motor operating voltage, battery safety control module control current, motor required torque, and motor control torque. The battery safety control module bus interface also transmits battery safety control module control current, battery current, battery output voltage, and battery state of charge (SOC) values. By writing the paths to the battery safety control module bus interface and the motor control module bus interface into the defined BMS expandable connector (BMS signalBus), the battery safety control module bus interface and the motor control module bus interface can be integrated into the BMS expandable bus interface.
[0084] A custom sub-interface can be defined on a certain bus interface, and the bus interface can inherit the added sub-interface variables.
[0085] S120: Based on the attributes of the controller model, the controlled object model, and the scalable bus interface model, determine the first scalable bus interface model that matches the controller model, and determine the second scalable bus interface model that matches the controlled object model.
[0086] S130: According to the connection instructions, connect the expandable bus interface models to complete the construction of the vehicle bus model.
[0087] In one embodiment of the present invention, connecting the scalable bus interface models according to the connection instruction specifically includes: generating a connection instruction according to the connect statement; connecting the first scalable bus interface model with the second scalable bus model, or connecting the second scalable bus models with each other according to the connection instruction.
[0088] Specifically, the connection model uses the Modelica language to connect the controller model and the controlled object model with a scalable bus interface model to establish a vehicle bus model. Within this model, the controller model and the controlled object model will communicate using the scalable bus interface model.
[0089] The `connect` statement can be used to link two connectors together, enabling variable passing between two or more connectors, thereby establishing a virtual bus connection between different models. For example... Figure 4 The diagram shows the bus interface connection between the controller and the controlled object. Figure 5This is a schematic diagram of the bus interface; Figure 6 The diagram shows the bus connection between the controller and each controlled object in the vehicle. CVT in the diagram stands for Continuously Variable Transmission.
[0090] S140: After the vehicle bus model is built, it is verified and tested; when the verification and testing are successful, the vehicle bus model is considered to have been successfully built.
[0091] In one embodiment of the present invention, the verification and testing of the vehicle bus model specifically includes: sending control signals from the controller model to the virtual bus through the scalable bus interface model; the control signals being determined according to the controlled object; sending the control signals to the scalable bus interface model connected to the controlled object model through the virtual bus; sending the control signals to the controlled object model through the scalable bus interface connected to the controlled object model; the controlled object model performing simulation based on the control signals to obtain simulation results; and determining the construction result of the vehicle bus model based on the simulation results.
[0092] Specifically, model verification and testing are required: After completing the vehicle bus model, it needs to be verified and tested to ensure that it can correctly simulate the bus communication within the vehicle. During verification and testing, the Modelica simulation tool can be used to simulate the behavior of the vehicle bus model.
[0093] The controller model sends control signals to the virtual bus via a scalable bus interface. These control signals include, for example, controller control signals, engine control signals, transmission control signals, driver control signals, battery control signals, brake control signals, body control signals, and motor control signals. The specific meaning and function of the control signal variables transmitted through the Modelica-based scalable bus interface, and how these signals are translated into actual operations, depend on the controlled object. For example, in a real-world engine model, throttle opening and idle speed control are used. Therefore, in Modelica-based controllers, control variables are determined by the controlled object, meaning the controller's behavior is based on the characteristics of the controlled object.
[0094] The controlled object (subsystem) model obtains control signals from the bus interface. The control signals control the controlled object to perform simulation. During the simulation, the controlled object outputs simulation output variables. At this time, the simulation output variables can be sent to the bus through the expandable bus interface. For example, in the engine simulation model, the output torque variable is output by the engine simulation model's output torque calculation module based on the throttle opening signal in the control signal.
[0095] All system variables are determined by the controlled object model, which is a digital model of real components using the Modelica language to determine the input / output variables of the model. A bus system is needed between the subsystems to exchange signals and monitor the relevant control signals of the whole vehicle, thereby realizing the simulation of the whole vehicle.
[0096] In one embodiment of the invention, subsystem output variables are defined in each subsystem bus interface. These subsystem output variables are input to the vehicle bus through the subsystem control bus interface. The vehicle bus subsystem output variables can then be input to other subsystems and controller models for signal and data exchange. For example, variables such as idle speed control signal, fuel consumption mass, engine temperature, engine speed, and engine output torque are defined in the engine bus interface (expandable connector EngineBus) and input to the vehicle bus, enabling closed-loop control of the engine by the controller.
[0097] The controller bus interface defines the signals required for controlling each subsystem. These signals are input to the bus via the controller bus interface, and then to the subsystem via the bus and subsystem interfaces to control the subsystem. For example, the control signals input to the engine model are the engine throttle opening signal and the idle speed control signal. These control signals are input to the engine simulation model to control the engine.
[0098] It connects the bus interfaces of each subsystem and the controller bus interface to realize the transmission and reception of variables of each subsystem on the vehicle bus and to achieve data exchange.
[0099] By clicking on the bus interface or the bus itself in the simulation results, the information data stream in the bus can be obtained, which enables real-time monitoring of the controller's control variables and the subsystem's (controlled object's) output variables, thereby verifying the bus model, controller model, and controlled object model.
[0100] After simulation, the data stream signals in the bus can be compared with the signals acquired by the actual bus. Then, subsystem (controlled object) interfaces, output variables of the subsystem (controlled object) interfaces, and control variables of the control model can be added through the expandable interface.
[0101] In simulation, the variables of the system model must be clearly defined, including the input and output variables of each system. No variables can be missing. The lack of simulation variables will lead to an inconsistency between the number of variables and the number of equations in the simulation model, thus making it impossible to achieve simulation.
[0102] The above describes a method for constructing a vehicle bus system based on Modelica, as provided in an embodiment of the present invention. Based on the same inventive concept, this invention also provides a corresponding device for constructing a vehicle bus system based on Modelica, such as... Figure 7 As shown.
[0103] The model building module 702 is used to build a controller model, a controlled object model, and a scalable bus interface model, which are written in the Modelica language. The matching module 704 is used to determine the first scalable bus interface model that matches the controller model and the second scalable bus interface model that matches the controlled object model based on the attributes of the controller model, the controlled object model, and the scalable bus interface model. The virtual bus connection module 706 is used to connect the scalable bus interface models according to connection instructions to complete the construction of the vehicle bus model. The verification and testing module 708 is used to verify and test the vehicle bus model after it is built. When the verification and testing are passed, the vehicle bus model is considered to have been successfully built.
[0104] This invention also provides a corresponding vehicle bus system construction device based on Modelica, such as... Figure 8 As shown.
[0105] This embodiment provides a vehicle bus system construction device based on Modelica, including:
[0106] At least one processor 801; and a memory 802 communicatively connected to the at least one processor 801 via a bus 803; wherein the memory 802 stores instructions executable by the at least one processor, the instructions being executed by the at least one processor 801 to enable the at least one processor 801 to perform the following:
[0107] A controller model, a controlled object model, and a scalable bus interface model are established, all written in the Modelica language. Based on the attributes of these models, a first scalable bus interface model matching the controller model and a second scalable bus interface model matching the controlled object model are determined. The scalable bus interface models are then connected according to connection instructions to complete the construction of the vehicle bus model. After the vehicle bus model is completed, it is verified and tested. Successful verification and testing indicate that the vehicle bus model has been successfully constructed.
[0108] Based on the same idea, some embodiments of the present invention also provide media corresponding to the above methods.
[0109] Some embodiments of the present invention provide a storage medium storing computer-executable instructions, which are executed by a processor to perform the following steps:
[0110] A controller model, a controlled object model, and a scalable bus interface model are established, all written in the Modelica language. Based on the attributes of these models, a first scalable bus interface model matching the controller model and a second scalable bus interface model matching the controlled object model are determined. The scalable bus interface models are then connected according to connection instructions to complete the construction of the vehicle bus model. After the vehicle bus model is completed, it is verified and tested. Successful verification and testing indicate that the vehicle bus model has been successfully constructed.
[0111] The various embodiments in this invention are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the device and medium embodiments are relatively simple in description because they are fundamentally similar to the method embodiments; relevant parts can be referred to the descriptions in the method embodiments.
[0112] The devices, media, and methods provided in the embodiments of the present invention are one-to-one correspondences. Therefore, the devices and media also have similar beneficial technical effects as their corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the devices and media will not be repeated here.
[0113] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process method or product that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process method or product. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process method or product that includes that element.
[0114] The above are merely embodiments of the present invention and are not intended to limit the invention. Although the present invention has been described in detail above with general descriptions and specific embodiments, modifications or improvements can be made to it, which will be obvious to those skilled in the art. Therefore, all such modifications or improvements made without departing from the spirit of the present invention fall within the scope of protection claimed by the present invention.
Claims
1. A method for constructing a vehicle bus system based on Modelica, characterized in that, include: A controller model, a controlled object model, and a scalable bus interface model are established, and the controller model, the controlled object model, and the scalable bus interface model are written in the Modelica language. The scalable bus interface is an integrated interface of a multi-controlled object bus interface and a controller bus interface; Based on the attributes of the controller model, the controlled object model, and the scalable bus interface model, determine a first scalable bus interface model that matches the controller model, and determine a second scalable bus interface model that matches the controlled object model; According to the connection instructions, the scalable bus interface models are connected to each other to complete the construction of the vehicle bus model; After the vehicle bus model is constructed, it is verified and tested. When verification and testing pass, the vehicle bus model is considered to have been successfully constructed. Establishing a scalable bus interface model specifically includes: determining the attributes of the scalable bus interface and its included variables based on the defined scalable bus interface model; mapping the variables included in the scalable bus interface to input variables, output variables, or parameters of the Modelica platform; determining the type, name, initial value, and position of the transmission variables in the scalable bus interface based on the defined transmission variables; mapping the transmission variables to input variables or output variables of the Modelica platform; and testing the scalable bus interface model to ensure its correctness.
2. The method according to claim 1, characterized in that, Establish a scalable bus interface model, including: Determine the defined sub-interfaces and their paths; The sub-interface is integrated into the scalable bus interface model according to the path of the sub-interface.
3. The method according to claim 1, characterized in that, The scalable bus interface model includes multiple variables, and the data types of these variables are varied.
4. The method according to claim 1, characterized in that, The vehicle bus model is verified and tested, specifically including: Control signals from the controller model are sent to the virtual bus via an extensible bus interface model; the control signals are determined based on the controlled object. The control signal is sent to the expandable bus interface model connected to the controlled object model via the virtual bus; The control signal is sent to the controlled object model through an expandable bus interface connected to the controlled object model; The controlled object model is simulated according to the control signal to obtain simulation results; The construction result of the vehicle bus model is determined based on the simulation results.
5. The method according to claim 1, characterized in that, According to the connection instructions, the scalable bus interface models are connected to each other, specifically including: Generate connection instructions based on the connect statement; According to the connection instructions, the first scalable bus interface model is connected to the second scalable bus interface model, or the second scalable bus interface models are connected to each other.
6. The method according to claim 1, characterized in that, The scalable bus interface model includes parameters and variables required for bus communication, which are used to pass the parameters and variables to the controller model and the controlled object model.
7. A vehicle bus system construction device based on Modelica, characterized in that, include: The model building module is used to build a controller model, a controlled object model, and a scalable bus interface model. The controller model, the controlled object model, and the scalable bus interface model are written in the Modelica language. The scalable bus interface is an integrated interface of a multi-controlled object bus interface and a controller bus interface; The matching module is used to determine a first scalable bus interface model that matches the controller model and a second scalable bus interface model that matches the controlled object model based on the attributes of the controller model, the controlled object model and the scalable bus interface model. The virtual bus connection module is used to connect the expandable bus interface models according to the connection instructions to complete the construction of the vehicle bus model; The verification and testing module is used to verify and test the vehicle bus model after it has been built. When verification and testing pass, the vehicle bus model is considered to have been successfully constructed. Establishing a scalable bus interface model specifically includes: determining the attributes of the scalable bus interface and its included variables based on the defined scalable bus interface model; mapping the variables included in the scalable bus interface to input variables, output variables, or parameters of the Modelica platform; determining the type, name, initial value, and position of the transmission variables in the scalable bus interface based on the defined transmission variables; mapping the transmission variables to input variables or output variables of the Modelica platform; and testing the scalable bus interface model to ensure its correctness.
8. A vehicle bus system construction device based on Modelica, characterized in that, include: At least one processor; as well as, The memory is communicatively connected to the at least one processor via a bus; wherein, The memory stores instructions executable by the at least one processor, which are executed to perform: A controller model, a controlled object model, and a scalable bus interface model are established. The controller model, the controlled object model, and the scalable bus interface model are written in the Modelica language. The scalable bus interface is an integrated interface of the multi-controlled object bus interface and the controller bus interface. Based on the attributes of the controller model, the controlled object model, and the scalable bus interface model, determine a first scalable bus interface model that matches the controller model, and determine a second scalable bus interface model that matches the controlled object model; According to the connection instructions, the scalable bus interface models are connected to each other to complete the construction of the vehicle bus model; After the vehicle bus model is built, it is verified and tested; when the verification and testing are successful, the vehicle bus model is considered to have been successfully built. Establishing a scalable bus interface model specifically includes: determining the attributes of the scalable bus interface and its included variables based on the defined scalable bus interface model; mapping the variables included in the scalable bus interface to input variables, output variables, or parameters of the Modelica platform; determining the type, name, initial value, and position of the transmission variables in the scalable bus interface based on the defined transmission variables; mapping the transmission variables to input variables or output variables of the Modelica platform; and testing the scalable bus interface model to ensure its correctness.
9. A non-volatile storage medium storing computer-executable instructions, characterized in that, The computer-executable instructions are executed by the processor to perform the following steps: A controller model, a controlled object model, and a scalable bus interface model are established, and the controller model, the controlled object model, and the scalable bus interface model are written in the Modelica language. The scalable bus interface is an integrated interface of a multi-controlled object bus interface and a controller bus interface; Based on the attributes of the controller model, the controlled object model, and the scalable bus interface model, determine a first scalable bus interface model that matches the controller model, and determine a second scalable bus interface model that matches the controlled object model; According to the connection instructions, the scalable bus interface models are connected to each other to complete the construction of the vehicle bus model; After the vehicle bus model is constructed, it is verified and tested. When verification and testing pass, the vehicle bus model is considered to have been successfully constructed. Establishing a scalable bus interface model specifically includes: determining the attributes of the scalable bus interface and its included variables based on the defined scalable bus interface model; mapping the variables included in the scalable bus interface to input variables, output variables, or parameters of the Modelica platform; determining the type, name, initial value, and position of the transmission variables in the scalable bus interface based on the defined transmission variables; mapping the transmission variables to input variables or output variables of the Modelica platform; and testing the scalable bus interface model to ensure its correctness.