Method and system for optimizing simulation performance of vehicle model, storage medium, and electronic device

By creating a real-time kernel program for vehicle model simulations with inter-process communication using shared memory, the method addresses the challenge of optimizing simulation performance, achieving improved efficiency and effectiveness in vehicle model simulations.

JP7649065B1Active Publication Date: 2025-03-19SHANGHAI TOSUN TECH LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
JP2023203443
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2023-10-26
Filing Date
2023-11-30
Publication Date
2025-03-19
Estimated Expiration
2043-11-30

AI Technical Summary

Technical Problem

Existing software technologies face challenges in optimizing simulation performance for vehicle models, particularly in achieving high real-time performance for tasks like real-time control and simulation, due to limitations in design frameworks and programming languages.

Method used

A method and system that involve creating a real-time kernel program to perform real-time simulation tasks for vehicle models, with inter-process communication using a shared memory method between the real-time kernel program and host software, allowing for automatic control of simulation commands and data recording.

Benefits of technology

This approach enhances simulation performance by reducing optimization overhead in the host software and allowing independent optimization of the real-time kernel program, thereby improving the efficiency and effectiveness of vehicle model simulations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007649065000001_ABST
    Figure 0007649065000001_ABST
Patent Text Reader

Abstract

The present invention relates to the field of vehicle software development technology, and more particularly to a method for optimizing the simulation performance of a vehicle model. [Solution] The method for optimizing the simulation performance of the vehicle model includes: creating a real-time kernel program for performing a real-time simulation task of the vehicle model; the real-time kernel program and the host software realize inter-process communication through a shared memory manner, reading and writing vehicle simulation signals through the host software, automatically controlling the real-time kernel program through a code program to execute simulation commands, and recording simulation data fed back from the real-time kernel program.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] This application claims priority from Chinese Patent Application No. 202311405199.1, filed on October 26, 2023, and U.S. Patent Application No. 18 / 379,696, filed on October 13, 2023, the entire contents of which are incorporated herein by reference. The present invention belongs to the technical field of vehicle software development, and particularly relates to a method and system for optimizing the simulation performance of a vehicle model.

[0002] When real-time requirements are high, such as in real-time control, real-time simulation, hardware-in-the-loop simulation, and collaborative simulation, program performance is important. Currently, many similar software programs achieve improved performance by optimizing the software. For example, program performance is optimized by using multi-threading to replace single-threading, using lookup tables to convert time to space, and using buffers to avoid repeated calculations. How to optimize program performance to a high-performance level is a difficult problem, because program performance often cannot be continuously optimized due to design frameworks and language limitations. This results in many software programs continuing to try to optimize but failing to reach a higher performance level. Summary of the Invention

[0003] The present invention relates to a method for optimizing the simulation performance of a vehicle model. Step 1 of creating a real-time kernel program for performing a real-time simulation task of the vehicle model; The real-time kernel program and the host software realize inter-process communication through a shared memory sharing method, read and write vehicle simulation signals through the host software, automatically control the real-time kernel program through the code program to execute simulation commands, and record simulation data fed back from the real-time kernel program.

[0004] In a second aspect, the present invention further provides a computer readable storage medium having computer readable instructions stored thereon which, when executed by at least one processor, cause the method of optimizing simulation performance of a vehicle model as described above to be performed.

[0005] In a third aspect, the present invention further provides an electronic device, the electronic device comprising a processor, a readable storage medium, a communication bus, and a communication interface, wherein said processor, said readable storage medium and said communication interface are capable of communicating with each other via said communication bus.

[0006] The readable storage medium is configured to store a program for executing a method for optimizing the simulation performance of the vehicle model, and the processor is configured to execute the program for the method for optimizing the simulation performance of the vehicle model.

[0007] In a fourth aspect, the present invention further provides a system for optimizing simulation performance of a vehicle model, the system including a computer device configured to execute a real-time kernel program and a host software. The real-time kernel program is configured as a daemon process of the host software and performs real-time simulation tasks for the vehicle model. The host software is configured to realize inter-process communication with the real-time kernel program through a shared memory method, read and write vehicle simulation signals, automatically control the real-time kernel program through a code program to execute simulation commands, and record simulation data fed back from the real-time kernel program. After the real-time kernel program is configured as a daemon process of the above host software, the method for automatically controlling the real-time kernel program to execute simulation commands by a code program includes: The host software prepares command data and stores it in the shared memory, and sends a simulation event to the daemon process through the code program, after which the code program enters a state of monitoring the simulation event. After acquiring a simulation event, the daemon process acquires command data corresponding to the simulation event from the shared memory, executes the corresponding command, and feeds back the command execution completion status to the host software, and returns the simulation event. After the code program obtains the simulation event returned from the daemon process, it obtains the corresponding command execution result from the shared memory.

[0008] In a fifth aspect, the present invention further provides a computer program product, comprising a computer readable storage medium having computer readable program code stored thereon, the computer readable program code comprising instructions for causing at least one processor or at least one computing device to perform the method for optimizing simulation performance of a vehicle model as described above.

[0009] Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the invention. The objectives and other advantages of the invention will be realized and obtained by the structure particularly pointed out in the description and drawings. In order to make the above objects, features and advantages of the present invention more comprehensible, preferred embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings.

[0010] In order to more clearly describe the specific embodiments of the present invention or the technical solutions of the prior art, the following briefly describes the drawings that need to be used to describe the specific embodiments or the prior art. The drawings described in the following description are some embodiments of the present invention, and it is obvious that those skilled in the art can obtain other drawings from these drawings without creative efforts. [Brief description of the drawings]

[0011] [Figure 1] FIG. 1 illustrates a step diagram of a method for optimizing simulation performance of a vehicle model according to some embodiments. [Diagram 2] FIG. 2 is a principle block diagram of a computer device in a system for optimizing simulation performance of a vehicle model according to some embodiments. [Diagram 3] FIG. 3 shows a principle block diagram of an electronic device according to some embodiments. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0012] In order to make the objectives, technical aspects and advantages of the embodiments of the present invention clearer, the technical aspects of the present invention will be described clearly and completely below in conjunction with the accompanying drawings, but it is clear that the described embodiments are only some of the embodiments of the present invention, and are not all of the embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without performing creative labor, belong to the scope of protection of the invention.

[0013] When performing a function test on an automobile part, the part must first be operated normally, which requires preparing a vehicle on which the part's operation depends, and providing information such as a complete electrical environment, a network communication environment, vehicle operation state feedback, etc. At the same time, while the vehicle and the part are operating, the part must be controlled in real time and triggered to generate a corresponding function, and the behavior of the part during this process depends on the feedback information of the vehicle itself and the feedback information of other related parts.

[0014] It is very unrealistic to prepare an environment for each part by preparing a car and all other dependent parts, and at the same time, in special operating situations such as emergency braking and vehicle stability testing, the test method itself may cause vehicle destruction and personnel casualties. Therefore, in general, the function test for the part needs to be performed by a virtual method, that is, by using vehicle model software to replace the hardware system such as the actual vehicle, sensors and other parts, thereby reducing costs, improving verification efficiency and ensuring personnel safety. The real-time nature of the simulation imposes higher requirements on the simulation performance of the system program.

[0015] Accordingly, at least one embodiment provides a method for optimizing simulation performance of a vehicle model, the method including: creating a real-time kernel program for performing a real-time simulation task of the vehicle model, the real-time kernel program and a host software realizing inter-process communication in the manner of shared memory, reading and writing vehicle simulation signals through the host software, automatically controlling the real-time kernel program through a code program to execute simulation commands, and recording simulation data fed back from the real-time kernel program.

[0016] In some embodiments, the method for optimizing the simulation performance of a vehicle model introduces an independently running real-time kernel program as a daemon process of the host software, and transfers all performance-related operations in the host software to the real-time kernel program, thereby reducing the optimization overhead of the host software and achieving the purpose of optimizing the simulation performance.

[0017] Various non-limiting embodiments of examples of the present disclosure are described in detail below with reference to the drawings. As shown in Figure 1, some embodiments provide a method for optimizing simulation performance of a vehicle model. The method includes: Create a real-time kernel program to execute real-time simulation tasks for the vehicle model (Step 1). The real-time kernel program and the host software realize inter-process communication through the method of shared memory, read and write vehicle simulation signals through the host software, automatically control the real-time kernel program through the code program to execute simulation commands, and record the simulation data fed back from the real-time kernel program (step 2).

[0018] In some embodiments, the real-time kernel program refers to a kernel program dedicated to performing real-time simulation tasks, and the creation method is, for example, developed by a development environment. The development environment is, but not limited to, Visual Studio. The host software refers to a program that is used to directly serve the simulation and testing needs of users and uses the real-time kernel program. The code program is a user script program that runs in the host software, can access the resources of the host software, and its operation depends on the host software itself. The host software can record simulation data to a local computer, which can be used for data playback and analysis, and recording the simulation data can be used to evaluate the simulation results, making it easy to find problems in the simulation process.

[0019] In some embodiments, the real-time kernel program is configured as a daemon process of the host software. The daemon process can self-control its own process priority and simulation thread priority, thereby optimizing the simulation performance, and is not affected by the host software program, and can interface with host software programs of any architecture, for example, supporting 32-bit host software programs and supporting 64-bit host software programs.

[0020] In some preferred embodiments, after the real-time kernel program is configured as a daemon process of the host software, the real-time kernel program is automatically controlled by the code program to execute the simulation command (step 3). Step 3 includes: The host software prepares command data and stores it in the shared memory, and sends a simulation event to the daemon process through the code program, so that the code program immediately enters a state of monitoring the simulation event; After obtaining the simulation event, the daemon process obtains command data corresponding to the simulation event from the shared memory, executes the corresponding command, and feeds back the execution completion status of the command to the host software, and returns the simulation event; and The code program obtains the simulation event returned from the daemon process, and then obtains the corresponding command execution result from the shared memory.

[0021] Take for example a host software designed and running on a Windows platform that calls a vehicle dynamics simulation engine, CarSim, to simulate a vehicle model. According to the method of some embodiments, a real-time kernel program CSController is designed as a daemon process of the host software, and when the real-time kernel program is started, it calls the Windows API function "SetPriorityClass" to improve the priority of the daemon process, and at the same time, when the real-time kernel program starts a simulation thread (in this case, the simulation thread refers to the thread that calls CarSim), it calls the Windows API function "SetThreadPriority" to improve the priority of the thread, so that the daemon process can independently optimize its own daemon process performance and the simulation thread performance, and the optimization process does not affect or is not affected by the host software program, thereby reducing the optimization overhead of the host software program and achieving the purpose of optimizing the simulation performance.

[0022] After the daemon process CSController starts, it starts a shared memory for executing simulation commands and monitors the event name CmdTx. When the host software starts the simulation, it tries to open this shared memory. If it fails to open, it stops the simulation and reports an error.

[0023] After the host software successfully opens the shared memory, it will enter the simulation phase. The simulation command includes multiple types of operations. Here, take the launch of a simulation command as an example. Set the data of the simulation launch command to 01, and the host software will set the first byte data of the shared memory to 01, then set the event CmdTx to send the simulation launch command to the daemon process. Then the host software will monitor the event name CmdRx and wait for the daemon process to complete the command execution.

[0024] After obtaining the event name CmdTx, the daemon process reads the first byte data in the shared memory to determine what type of simulation command it is, and when it reads that the first byte data is 01, the daemon process starts the simulation. The simulation start may be successful or may fail. The return value of success is 0, and the return value of failure is 1. The daemon process writes the return value of starting the simulation to the first byte of the shared memory, and sets the event CmdRx to feed back the execution result of the simulation command to the host software. Then, the daemon process continues to monitor the event name CmdTx and waits for the next command from the host software.

[0025] After obtaining the event name CmdRx, the host software reads the first byte of the shared memory to determine the execution result of the previous command, and indicates that the simulation was successfully started if the read byte data is 0, and indicates that the simulation was not started if the read byte data is 1. The host software resets the event name CmdTx based on the content that needs to be executed in the next step, and controls the daemon process to continue executing the simulation command.

[0026] In some embodiments, the daemon process can interface with a host software program of any architecture, and not only supports 32-bit host software programs, but also supports 64-bit host software programs. The following takes a 32-bit host software program as an example to describe in detail how to read and write vehicle simulation signals after the real-time kernel program is configured as the daemon process of the host software.

[0027] In some embodiments, after a real-time kernel program is configured as a daemon process of the host software, a method for reading a vehicle simulation signal via the host software includes: For reading a 32-bit integer shaped simulation signal, the reading method includes: The InterlockedIncrement function is called, and the address of the shared memory of the integer simulation signal and the value 0 to be added are introduced as parameters, and the function return value is read, thereby realizing reading of the integer simulation signal.

[0028] The following provides a detailed explanation of the case. Take the example of reading the value of the 32-bit integer gear signal Gear into the 32-bit integer variable “v”. The code to call the InterlockedIncrement function is as follows: v=InterlockedIncrement(&Gear,0); Here, &Gear is the address of the shared memory of the integer gear signal Gear, and 0 is the added value. The above code is executed to obtain the function return value, and the function return value is read to realize the reading of the 32-bit integer gear signal Gear.

[0029] In some embodiments, after a real-time kernel program is configured as a daemon process of the host software, a method for reading a vehicle simulation signal via the host software includes: For reading a 32-bit floating-point simulation signal, the reading method includes: Reading of the floating-point simulation signal is achieved by calling the InterlockedIncrement function, introducing the address of the shared memory for the floating-point simulation signal and the value 0 to be added as parameters, reading the function return value, and then converting it to a 32-bit floating-point value.

[0030] Methods for converting a function return value into a 32-bit floating-point value include the following: The four bytes following the start address of the function return value are converted into a 32-bit floating-point type number. The following provides a detailed explanation of the case. For example, to read the value of a 32-bit floating-point signal Vx into a 32-bit floating-point variable “v”, the code to call the InterlockedIncrement function is as follows: *(int32*)(&v)=InterlockedIncrement(&Vx,0); Here, &Vx is the shared memory address of the floating-point signal Vx, 0 is the numerical value to be added, &v is the starting address of the function return value, and *(int32*) indicates that the four bytes after the starting address of the function return value are taken. By executing the above code and reading the execution result, the 32-bit floating-point signal Vx is read.

[0031] In some embodiments, after a real-time kernel program is configured as a daemon process of the host software, a method for reading a vehicle simulation signal via the host software includes: For reading a 64-bit integer type simulation signal, the reading method includes: Reading of the integer simulation signal is realized by calling the InterlockedIncrement64 function, introducing the address of the shared memory of the integer simulation signal and the value 0 to be added as parameters, and reading the return value of the function. The following provides a detailed explanation of the case. Take the example of reading the value of the 64-bit integer time signal TimeUs into the 64-bit integer variable “v”, and the code for calling the InterlockedIncrement64 function is as follows: v=InterlockedIncrement64(&TimeUs,0); Here, &TimeUs is the address of the shared memory for the integer time signal TimeUs, and 0 is the value to be added. The above code is executed to obtain the function return value, and the function return value is read to realize the reading of the 64-bit integer time signal TimeUs.

[0032] In some embodiments, after a real-time kernel program is configured as a daemon process of the host software, a method for reading a vehicle simulation signal via the host software includes: For reading a 64-bit floating-point simulation signal, the reading method includes: The InterlockedIncrement64 function is called, and the address of the shared memory for the floating-point simulation signal and the value 0 to be added are introduced as parameters. After reading the function return value, the function return value is converted to a 64-bit floating-point value, thereby realizing reading of the floating-point simulation signal. Methods for converting a function return value to a 64-bit floating-point value include: The eight bytes following the start address of the function return value are treated as a 64-bit floating-point value.

[0033] The following provides a detailed explanation of the case. Take the example of reading the value of the 64-bit floating-point signal EngForce into the 64-bit floating-point variable “v”, the code for calling the InterlockedIncrement64 function is as follows: *(int64*)(&v)=InterlockedIncrement64(&EngForce,0); Here, &EngForce is the shared memory address of the floating-point signal EngForce, and 0 is the value to be added. &v is the start address of the function return value, and *(int64*) indicates that the 8 bytes after the start address of the function return value are taken. Executing the above code and reading the execution result realizes the reading of the 64-bit floating-point signal EngForce.

[0034] In some embodiments, after the real-time kernel program is configured as a daemon process of the host software, a method for writing a vehicle simulation signal includes: A 32-bit integer simulation signal is written, and the writing method includes: The InterlockedExchange function is called and takes as parameters the address of the shared memory of the integer simulation signal and the value to be written.

[0035] The following provides a detailed explanation of the case. Take writing the value of a 32-bit integer signal x to a 32-bit integer gear signal Gear as an example, the code for calling the InterlockedExchange function is as follows: InterlockedExchange(&Gear,x); Here, &Gear is the address of the shared memory of the integer gear signal Gear, and x is the value to be written. By executing the above code, the value of the 32-bit integer signal x is written to the 32-bit integer gear signal Gear.

[0036] In some embodiments, after the real-time kernel program is configured as a daemon process of the host software, a method for writing a vehicle simulation signal includes: A 32-bit floating-point simulation signal is written, and the writing method includes: Converts a to-be-written floating-point value to an integer shaping value desired by a function parameter. The InterlockedExchange function is called and takes as parameters the address of the shared memory of the floating-point simulation signal and the converted integer value. Methods for converting a write pending floating-point value to an integer value required for a function parameter include the following: The four bytes following the starting address of the floating-point value are a 32-bit integer value.

[0037] The following provides a detailed explanation of the case. Take writing the value of a 32-bit floating-point signal x to a 32-bit floating-point signal Vx as an example, the code for calling the InterlockedExchange function is as follows: InterlockedExchange(&Vx,*(int32*)(&x)); Here, &Vx is the shared memory address of the floating-point signal Vx, &x is the starting address of the floating-point signal x value, and *(int32*) indicates that the four bytes following the starting address of the floating-point signal x value are to be taken. Executing the above code realizes writing the value of the 32-bit floating-point signal x to the 32-bit floating-point signal Vx.

[0038] In some embodiments, after the real-time kernel program is configured as a daemon process of the host software, a method for writing a vehicle simulation signal includes: A 64-bit integer simulation signal is written, and the writing method includes: The InterlockedExchange64 function is called and passed as parameters the address of the shared memory of the integer simulation signal and the value to be written.

[0039] The following provides a detailed explanation of the case. Take writing the value of a 64-bit integer signal x to a 64-bit integer signal TimeUs as an example, and the code for calling the InterlockedExchange64 function is as follows: InterlockedExchange64(&TimeUs,x); Here, &TimeUs is the shared memory address of the integer signal TimeUs, and x is the value to be written. By executing the above code, the value of the 64-bit integer signal x is written to the 64-bit integer signal TimeUs.

[0040] In some embodiments, after the real-time kernel program is configured as a daemon process of the host software, a method for writing a vehicle simulation signal includes: A 64-bit floating-point simulation signal is written, and the writing method includes: Convert the pending write floating-point value to the integer value required for the function parameter. The InterlockedExchange64 function is called and the address of the shared memory of the floating-point simulation signal and the converted integer value are introduced as parameters. Methods for converting a write pending floating-point value to an integer value required for a function parameter include the following: The eight bytes following the starting address of the floating-point value are assumed to be a 64-bit integer value.

[0041] The following provides a detailed explanation of the case. Take writing the value of a 64-bit floating-point signal x to a 64-bit floating-point signal EngForce as an example, the code for calling the InterlockedExchange64 function is as follows: InterlockedExchange64(&EngForce, *(int64*)(&x)); Here, &EngForce is the shared memory address of the floating-point signal EngForce, &x is the starting address of the floating-point signal x value, and *(int64*) indicates that the 8 bytes following the starting address of the floating-point signal x value are taken. Executing the above code realizes writing the value of the 64-bit floating-point signal x to the 64-bit floating-point signal EngForce.

[0042] As shown in FIG. 2, some embodiments further provide a system for optimizing simulation performance of a vehicle model, including a computing device that executes a real-time kernel program and a host software. The real-time kernel program is configured as a daemon process of the host software and performs real-time simulation tasks for the vehicle model. The host software is configured to realize inter-process communication with the real-time kernel program through a shared memory method, read and write vehicle simulation signals, control the real-time kernel program through a code program to execute simulation commands, and record simulation data fed back from the real-time kernel program.

[0043] Specifically, for the specific operation methods of the real-time kernel program and the host software, please refer to the contents of the method for optimizing the simulation performance of the vehicle model described above, and the description will be omitted here. The following describes the electronic device in some embodiments from the perspective of hardware processing. Some embodiments are not limited to a specific implementation of an electronic device.

[0044] As shown in Fig. 3, the electronic device includes a processor, a readable storage medium, a communication bus, and a communication interface. Here, the processor, the readable storage medium, and the communication interface realize communication between each other via the communication bus. The readable storage medium is configured to store a program for executing the method for optimizing simulation performance of the vehicle model, and the processor is configured to execute the program for the method for optimizing simulation performance of the vehicle model.

[0045] In other embodiments, computer equipment, industrial computers, etc. may also be considered types of electronic devices.

[0046] It should be noted that the configuration shown in FIG. 3 is not intended to limit the electronic device and may include fewer or more components than those shown, may combine some components, or may have different arrangements of components.

[0047] In some embodiments, the communication interface may be a communication interface connectable to an external bus adapter, such as RS232, RS485, USB port, TYPE port, etc. A wired or wireless network interface may also be included, which may optionally include wired and / or wireless interfaces typically used to establish communication connections between the computing device and other electronic devices (e.g., a WI-FI interface, a Bluetooth interface, etc.). The storage module, readable storage medium or computer readable storage medium includes at least one type of memory. The memory includes flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, it may be an internal storage unit of the computer device, such as the hard disk of the computer device. In other embodiments, the memory may be an external storage device of the computer device, such as a plug-in hard disk mounted on the computer device, a Smart Media Card (SMC), a Secure Digital Card (SD), a Flash Card, etc. Furthermore, the memory may include both the internal storage unit of the computer device and an external storage device. The memory is used to store various data such as application software and computer program codes installed in the computer device, as well as to temporarily store output data or data to be output.

[0048] In some embodiments, the processor may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data processing chip for executing program code stored in memory or processing data, e.g., executing a computer program.

[0049] In some embodiments, the communication bus may be an I / O bus, which may be a Peripheral Component Interconnect (PCI) bus or an Enhanced Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc.

[0050] Optionally, the computer device may further include a user interface. The user interface may include an input unit such as a display, a keyboard, etc., and optionally the user interface may also include a standard wired interface, a wireless interface. Optionally, in some embodiments, the display or display module may be an LED display, a liquid crystal display, a touch-type liquid crystal display, an OLED (Organic Light-Emitting Diode) toucher, etc. In this case, the display or display module is also called a display screen or a display unit, for displaying information processed in the computer device and for displaying a visualized user interface.

[0051] When the processor executes the program, it realizes the steps in the embodiment of the method for optimizing simulation performance of a vehicle model shown in Fig. 1, for example steps S101 and S102 shown in Fig. 1. Alternatively, when the processor executes the computer program, it realizes the functions of each module or unit in the embodiments of each device.

[0052] In some embodiments, the processor is specifically used to implement the following steps: Create a real-time kernel program to perform real-time simulation tasks for the vehicle model. The real-time kernel program and the host software realize inter-process communication through a shared memory method, read and write vehicle simulation signals through the host software, control the real-time kernel program through the code program to execute simulation commands, and record simulation data fed back from the real-time kernel program.

[0053] Optionally, as a possible embodiment, the processor can be further used to implement the following steps: The real-time kernel program is configured as a daemon process of the host software.

[0054] Optionally, as a possible embodiment, the processor can be further used to implement the following steps: After the real-time kernel program is configured as a daemon process of the above host software, the method for automatically controlling the real-time kernel program to execute simulation commands by a code program includes: The host software prepares command data and stores it in the shared memory, and sends a simulation event to the daemon process through the code program, after which the code program enters a state of monitoring the simulation event. After acquiring a simulation event, the daemon process acquires command data corresponding to the simulation event from the shared memory, executes the corresponding command, and feeds back the command execution completion status to the host software, and returns the simulation event. After obtaining the simulation event returned from the daemon process, the code program obtains the corresponding command execution result from the shared memory.

[0055] Optionally, as a possible embodiment, the processor can be further used to implement the following steps: After the real-time kernel program is configured as a daemon process of the host software, the method for reading a vehicle simulation signal through the host software includes: For reading a 32-bit integer type simulation signal, the reading method includes: The InterlockedIncrement function is called, and the address of the shared memory of the integer simulation signal and the value 0 to be added are introduced as parameters, and the function return value is read, that is, reading of the integer simulation signal is realized.

[0056] Optionally, as a possible embodiment, the processor can be further used to implement the following steps: After the real-time kernel program is configured as a daemon process of the host software, the method for reading a vehicle simulation signal through the host software includes: For reading a 32-bit floating-point simulation signal, the reading method includes: Reading of the floating-point simulation signal is realized by calling the InterlockedIncrement function, and introducing the address of the shared memory of the floating-point simulation signal and the numerical value 0 to be added as parameters, reading the function return value, and then converting the function return value to a 32-bit floating-point value.

[0057] Optionally, as a possible embodiment, the processor can be further used to implement the following steps: Methods for converting a function return value to a 32-bit floating-point value include: The four bytes following the start address of the function return value are treated as a 32-bit floating-point number.

[0058] Optionally, as a possible embodiment, the processor can be further used to implement the following steps: After the real-time kernel program is configured as a daemon process of the host software, the method for reading a vehicle simulation signal through the host software includes: For reading a 64-bit integer type simulation signal, the reading method includes: Reading of the integer simulation signal is realized by calling the InterlockedIncrement64 function, introducing the address of the shared memory of the integer simulation signal and the value 0 to be added as parameters, and reading the return value of the function.

[0059] Optionally, as a possible embodiment, the processor can be further used to implement the following steps: After the real-time kernel program is configured as a daemon process of the host software, the method for reading a vehicle simulation signal through the host software includes: For reading a 64-bit floating-point simulation signal, the reading method includes: The InterlockedIncrement64 function is called, and the address of the shared memory for the floating-point simulation signal and the value 0 to be added are introduced as parameters. After reading the function return value, the function return value is converted to a 64-bit floating-point value, thereby realizing reading of the floating-point simulation signal.

[0060] Optionally, as a possible embodiment, the processor can be further used to implement the following steps: Methods for converting a function return value to a 64-bit floating-point value include: The eight bytes following the start address of the function return value are treated as a 64-bit floating-point value.

[0061] Optionally, as a possible embodiment, the processor can be further used to implement the following steps: After the real-time kernel program is configured as a daemon process of the host software, the method for writing a vehicle simulation signal includes: A 32-bit integer simulation signal is written, and the writing method includes: The InterlockedExchange function is called and takes as parameters the address of the shared memory of the integer simulation signal and the value to be written.

[0062] Optionally, as a possible embodiment, the processor can be further used to implement the following steps: After the real-time kernel program is configured as a daemon process of the host software, the method for writing a vehicle simulation signal includes: A 32-bit floating-point simulation signal is written, and the writing method includes: Convert the pending write floating-point value to the integer value required for the function parameter. The InterlockedExchange function is called and takes as parameters the address of the shared memory of the floating-point simulation signal and the converted integer value.

[0063] Optionally, as a possible embodiment, the processor can be further used to implement the following steps: Methods for converting a write pending floating-point value to an integer value required for a function parameter include the following: The four bytes following the starting address of the floating-point value are a 32-bit integer value.

[0064] Optionally, as a possible embodiment, the processor can be further used to implement the following steps: After the real-time kernel program is configured as a daemon process of the host software, the method for writing a vehicle simulation signal includes: A 64-bit integer simulation signal is written, and the writing method includes: The InterlockedExchange64 function is called and passed as parameters the address of the shared memory of the integer simulation signal and the value to be written.

[0065] Optionally, as a possible embodiment, the processor can be further used to implement the following steps: After the real-time kernel program is configured as a daemon process of the host software, the method for writing a vehicle simulation signal includes: A 64-bit floating-point simulation signal is written, and the writing method includes: Convert the pending write floating-point value to the integer value required for the function parameter. The InterlockedExchange64 function is called and the address of the shared memory of the floating-point simulation signal and the converted integer value are introduced as parameters.

[0066] Optionally, as a possible embodiment, the processor can be further used to implement the following steps: Methods for converting a write pending floating-point value to an integer value required for a function parameter include the following: The eight bytes following the starting address of the floating-point value are a 64-bit integer value.

[0067] Some embodiments provide a computer program product, comprising a computer readable storage medium having computer readable program code stored thereon, the computer readable program code comprising instructions that cause at least one processor or at least one computing device to perform any of the methods for optimizing simulation performance of a possible vehicle model described above.

[0068] Some embodiments provide a computer-readable storage medium having computer-readable instructions stored thereon that, when executed by at least one processor, cause the method of optimizing simulation performance of a vehicle model of any of the embodiments described above to be performed.

[0069] In some embodiments of the present invention, it is to be understood that the disclosed apparatus and method may be realized in other manners. The above-described apparatus embodiments are merely exemplary, and for example, the flowcharts and block diagrams in the drawings illustrate possible architectures, functions, and operations of the apparatus, methods, and computer program products according to some embodiments of the present invention. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code. The module, the program segment, or the part of code includes executable instructions for implementing one or more predetermined logical functions. It is to be noted that in some alternative implementations, the functions depicted in the blocks may occur in a different order than the order depicted in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and may sometimes be executed in a reverse order depending on the functions involved. It is also to be noted that each block of the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts may be implemented in a dedicated hardware-based system that executes a predetermined function or operation, or may be implemented in a combination of dedicated hardware and computer instructions.

[0070] In addition, each functional module in each embodiment of the present invention may be integrated together to form a single independent part, each module may exist independently, or two or more modules may be integrated together to form a single independent part.

[0071] The above functions can be realized in the form of software functional modules and stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present invention essentially or the part that contributes to the prior art or the part of the technical solution can be expressed in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the method according to each embodiment of the present invention.

[0072] The above-mentioned preferred embodiments of the present invention have been enlightened, and those skilled in the art can make various changes and modifications based on the above description without departing from the technical spirit of the present invention. The technical scope of the present invention is not limited to the contents of the specification, but should be determined based on the claims.

Claims

1. 1. A method for optimizing simulation performance of a vehicle model, comprising: Step 1 of creating a real-time kernel program for performing a real-time simulation task of a vehicle model; Step 2: the real-time kernel program and the host software realize inter-process communication by a shared memory method, read and write vehicle simulation signals through the host software, automatically control the real-time kernel program through a code program to execute simulation commands, and record simulation data fed back from the real-time kernel program; and (3) after the real-time kernel program is configured as a daemon process of the host software, automatically controlling the real-time kernel program by the code program to execute the simulation command; Step 3 includes: The host software prepares command data and stores it in the shared memory, and sends a simulation event to the daemon process through a code program, and the code program immediately enters a state of monitoring the simulation event; After the daemon process acquires a simulation event, the daemon process acquires command data corresponding to the simulation event from the shared memory, executes the corresponding command, and feeds back the execution completion status of the command to the host software to continue monitoring the simulation event; and The code program obtains the simulation event returned from the daemon process, and then obtains the corresponding command execution result from the shared memory. A method for optimizing simulation performance of a vehicle model, comprising:

2. A method for reading vehicle simulation signals via the host software after a real-time kernel program is configured as a daemon process of the host software, comprising: A read on a 32-bit integer simulation signal, the read comprising:

2. The method for optimizing the simulation performance of a vehicle model according to claim 1, further comprising the step of: calling an InterlockedIncrement function, introducing the address of the shared memory of the integer simulation signal and the numerical value 0 to be added as parameters, and reading the return value of the function to realize reading of the integer simulation signal.

3. A method for reading vehicle simulation signals via the host software after a real-time kernel program is configured as a daemon process of the host software, comprising: reading into a 32-bit floating point simulation signal, the reading comprising:

2. The method for optimizing the simulation performance of a vehicle model according to claim 1, further comprising: calling an InterlockedIncrement function, introducing the address of the shared memory of the floating-point simulation signal and the numerical value 0 to be added as parameters, and converting the function return value into a 32-bit floating-point value after reading the function return value, thereby realizing reading of the floating-point simulation signal.

4. Converting the function return value to a 32-bit floating-point value 4. The method for optimizing simulation performance of a vehicle model according to claim 3, further comprising the step of: making four bytes following the top address of the function return value into a 32-bit floating-point value.

5. A method for reading vehicle simulation signals via the host software after a real-time kernel program is configured as a daemon process of the host software, comprising: reading a 64-bit integer simulation signal, the reading comprising:

2. The method for optimizing the simulation performance of a vehicle model according to claim 1, further comprising the steps of: calling an InterlockedIncrement64 function, introducing the address of the shared memory of the integer simulation signal and the numerical value 0 to be added as parameters, and reading the return value of the function to realize reading of the integer simulation signal.

6. A method for reading a vehicle simulation signal through a host software after a real-time kernel program is configured as a daemon process of the host software, comprising: reading a 64-bit floating point simulation signal, said reading comprising: The method for optimizing the simulation performance of a vehicle model according to claim 1, further comprising: calling an InterlockedIncrement64 function; introducing the address of the shared memory of the floating-point simulation signal and the value 0 to be added as parameters; and converting the function return value into a 64-bit floating-point value after reading the function return value, thereby realizing reading the floating-point simulation signal.

7. Converting a function return value to a 64-bit floating-point value is 7. The method for optimizing simulation performance of a vehicle model according to claim 6, further comprising: making eight bytes following the top address of the function return value into a 64-bit floating-point value.

8. A method for writing vehicle simulation signals via the host software after a real-time kernel program has been configured as a daemon process of the host software, comprising: writing a 32-bit integer simulation signal, the writing comprising:

2. A method for optimizing the simulation performance of a vehicle model according to claim 1, characterized in that it includes calling an InterlockedExchange function and introducing as parameters the address of the shared memory of integer simulation signals and the value to be written.

9. After a real-time kernel program is configured as a daemon process of the host software, a method of writing a vehicle simulation signal via the host software comprises: writing 32-bit floating point simulation signals, the writing comprising: Convert the pending floating-point value to the integer value required for the function parameter, 2. The method for optimizing the simulation performance of a vehicle model according to claim 1, further comprising: calling an InterlockedExchange function and introducing as parameters an address of the shared memory for the floating-point simulation signal and the converted integer value.

10. Converting a pending floating-point value to an integer value required for a function parameter is 10. The method for optimizing simulation performance of a vehicle model according to claim 9, further comprising: making four bytes following the leading address of the floating-point value into a 32-bit integer value.

11. After a real-time kernel program is configured as a daemon process of the host software, a method of writing a vehicle simulation signal via the host software comprises: writing a 64-bit integer simulation signal, the writing comprising:

2. A method for optimizing the simulation performance of a vehicle model according to claim 1, characterized in that it includes calling the InterlockedExchange64 function and introducing as parameters the address of the shared memory of integer simulation signals and the value to be written.

12. A method for writing vehicle simulation signals via the host software after a real-time kernel program has been configured as a daemon process of the host software, comprising: writing a 64-bit floating point simulation signal, the writing comprising: Convert the pending floating-point value to the integer value required for the function parameter, 2. The method of claim 1, further comprising: calling an InterlockedExchange64 function and introducing as parameters the address of the shared memory for the floating-point simulation signal and the converted integer value.

13. Converting a pending floating-point value to an integer value required for a function parameter is 13. The method for optimizing simulation performance of a vehicle model according to claim 12, further comprising: making eight bytes following a starting address of the floating-point value into a 64-bit integer value.

14. 1. A computer-readable storage medium, comprising: A computer readable storage medium having computer readable instructions stored thereon which, when executed by at least one processor, cause the method for optimizing simulation performance of a vehicle model according to any one of claims 1 to 13 to be performed.

15. 1. An electronic device comprising: a processor, a computer-readable storage medium, a communication bus, and a communication interface, the processor, the computer-readable storage medium, and the communication interface realizing communication between each other via the communication bus; The readable storage medium is configured to store a program for executing the method for optimizing simulation performance of a vehicle model according to any one of claims 1 to 13, and the processor is configured to execute the program of the method for optimizing simulation performance of the vehicle model.

16. 1. A system for optimizing a simulation performance of a vehicle model, the system comprising: the computing device is configured to execute a real-time kernel program and host software; The real-time kernel program is configured as a daemon process in the host software and performs real-time simulation tasks for the vehicle model. The host software is configured to realize inter-process communication through a real-time kernel program and a shared memory, read and write vehicle simulation signals, and automatically control the real-time kernel program through a code program to execute simulation commands and record simulation data fed back from the real-time kernel program; After the real-time kernel program is configured as a daemon process of the host software, automatically controlling the real-time kernel program by a code program to execute simulation commands; In the course of carrying out the said implementation, The host software prepares command data and stores it in the shared memory, and sends a simulation event to the daemon process through the code program, so that the code program immediately enters a state of monitoring the simulation event; After the daemon process obtains a simulation event, the daemon process obtains command data corresponding to the simulation event from the shared memory, executes the corresponding command, and feeds back the execution completion status of the command to the host software, thereby continuously monitoring the simulation event; A system for optimizing simulation performance of a vehicle model, characterized in that a code program obtains a simulation event returned from a daemon process and then obtains a corresponding command execution result from the shared memory.

17. A system for optimizing simulation performance of a vehicle model, comprising: a computer device; the computing device is configured to execute a real-time kernel program and host software; The real-time kernel program is configured as a daemon process in the host software and performs real-time simulation tasks for the vehicle model. The host software is configured to realize inter-process communication through a real-time kernel program and a shared memory, read and write vehicle simulation signals, and automatically control the real-time kernel program through a code program to execute simulation commands and record simulation data fed back from the real-time kernel program; After the real-time kernel program is configured as a daemon process of the host software, automatically controlling the real-time kernel program by a code program to execute simulation commands; In the course of carrying out the said implementation, The host software prepares command data and stores it in the shared memory, and sends a simulation event to the daemon process through the code program, so that the code program immediately enters a state of monitoring the simulation event; After the daemon process obtains a simulation event, the daemon process obtains command data corresponding to the simulation event from the shared memory, executes the corresponding command, and feeds back the execution completion status of the command to the host software, thereby continuously monitoring the simulation event; The code program obtains the simulation event returned from the daemon process, and then obtains the corresponding command execution result from the shared memory. The computer device is configured to execute a real-time kernel program and a host software according to the method for optimizing the simulation performance of a vehicle model according to any one of claims 1 to 13.

18. A program for causing a computer device to execute a method for optimizing the simulation performance of a vehicle model described in any one of claims 1 to 13.

Citation Information

Patent Citations

  • Interconnection system and method for hybrid simulation

    CN111381980A

  • Implementation method for guaranteeing real-time performance of semi-physical simulation through three-layer structure

    CN113110108A