CN115981286A - Method and device for realizing virtual calibration of automobile based on virtual simulation platform - Google Patents
Method and device for realizing virtual calibration of automobile based on virtual simulation platform Download PDFInfo
- Publication number
- CN115981286A CN115981286A CN202310051871.5A CN202310051871A CN115981286A CN 115981286 A CN115981286 A CN 115981286A CN 202310051871 A CN202310051871 A CN 202310051871A CN 115981286 A CN115981286 A CN 115981286A
- Authority
- CN
- China
- Prior art keywords
- virtual
- calibration
- bus
- data
- upper computer
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 59
- 230000008569 process Effects 0.000 claims abstract description 29
- 230000006870 function Effects 0.000 claims description 58
- 238000012545 processing Methods 0.000 claims description 31
- 108091006146 Channels Proteins 0.000 claims description 25
- 238000012360 testing method Methods 0.000 claims description 7
- 238000001914 filtration Methods 0.000 claims description 6
- 230000008859 change Effects 0.000 claims description 5
- 230000004913 activation Effects 0.000 claims description 3
- 230000007175 bidirectional communication Effects 0.000 claims description 3
- 238000010586 diagram Methods 0.000 description 11
- 230000006854 communication Effects 0.000 description 3
- 238000004891 communication Methods 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 238000004088 simulation Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 2
- 238000005259 measurement Methods 0.000 description 2
- 230000001960 triggered effect Effects 0.000 description 2
- 230000009471 action Effects 0.000 description 1
- 238000005094 computer simulation Methods 0.000 description 1
- 238000012937 correction Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000000977 initiatory effect Effects 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
Images
Classifications
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02P—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
- Y02P90/00—Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
- Y02P90/02—Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]
Landscapes
- Debugging And Monitoring (AREA)
Abstract
The invention provides a method for realizing virtual calibration of an automobile based on a virtual simulation platform, which comprises the following steps: and calling the virtual CAN bus through the XCP drive of the calibration upper computer to send a message which accords with an XCP protocol to the virtual ECU. And the virtual ECU stores the data issued by the calibration upper computer software into a virtual CAN equipment receiving buffer area by calling a message receiving function interface of the virtual CAN bus. After the XCP driver in the virtual ECU processes the message data of the virtual CAN equipment receiving buffer area, the message data to be sent to the calibration upper computer software is sent to a sending buffer area of the virtual CAN equipment. And the XCP driver calls a message sending function interface of the virtual CAN bus and sends a sending frame back to the calibration upper computer. The invention can realize virtual calibration based on the virtual simulation platform, does not need to rely on real ECU and physical environment in the whole calibration process, reduces the dependence of a calibration engineer on hardware environment, and greatly reduces the time cost in the calibration process.
Description
Technical Field
The invention relates to a computer simulation technology, in particular to a calibration technology of an automobile electronic control unit.
Background
In the development process of an Electronic Control Unit (ECU) of an automobile, in order to adapt to different automobile types and working conditions, upper computer software is often required to be communicated with the ECU, and then corresponding parameter values are calibrated according to a plurality of parameter addresses in the ECU, such as parameters of a similar driving motor, an engine Control curve, an air conditioner temperature Control curve and the like, so that matching of a Control algorithm and a Control target is realized, and the optimal effect is achieved.
In the prior art, calibration work can be carried out only by depending on a real environment. Therefore, on one hand, the calibration of the automobile ECU depends on the real physical environment, so that the calibration period is longer and the cost is higher. On the other hand, this increases the time cost in the calibration process.
Disclosure of Invention
The invention aims to provide a method and a device for realizing virtual calibration of an automobile based on a virtual simulation platform, which realize virtual calibration based on the virtual simulation platform, do not need to depend on a real ECU and a physical environment in the whole calibration process, reduce the dependence of a calibration engineer on a hardware environment and greatly reduce the time cost in the calibration process.
In order to achieve the above object, the present invention provides a method for realizing virtual calibration of an automobile based on a virtual simulation platform, the method comprising: the method comprises the steps that a calibration upper computer and a virtual ECU are arranged and are independent of each other, and the virtual ECU comprises a universal measurement and correction calibration drive (XCP drive) and a virtual Controller Area Network Controller (CAN) device. The calibration upper computer comprises an XCP drive. And the XCP driver of the calibration upper computer is communicated with the virtual CAN equipment through a virtual CAN bus. The XCP driver in the virtual ECU communicates with the virtual CAN device through a call of the CAN driver function interface. And the virtual CAN equipment and the virtual CAN bus are communicated by calling a virtual CAN bus function interface. And calling the virtual CAN bus through the XCP drive of the calibration upper computer to send a message which accords with an XCP protocol to the virtual ECU. And the virtual ECU stores the data issued by the calibration upper computer software into a virtual CAN equipment receiving buffer area by calling a message receiving function interface of the virtual CAN bus. After the XCP driver in the virtual ECU processes the message data of the virtual CAN equipment receiving buffer area, the message data to be sent to the calibration upper computer software is sent to a sending buffer area of the virtual CAN equipment. And the XCP driver calls a message sending function interface of the virtual CAN bus and sends a sending frame back to the calibration upper computer.
As a preferred mode, the virtual CAN equipment comprises a register read-write interface, a register implementation module, a data sending processing module, a data receiving processing module and a virtual CAN bus interface calling module. The calibration data are transmitted in two directions between the calibration upper computer and the virtual ECU through the virtual CAN bus. The virtual CAN equipment calls a virtual CAN bus interface through the data processing module to receive calibration data sent by the calibration upper computer. Then, the register read-write interface is called by the register implementation module to store or take out the relevant parameters of the calibration data into or out of the register and the storage space according to the corresponding types. And when the calibration data result needs to be returned, the result calls the virtual CAN bus interface through the data sending processing module to send the calibration data result to the calibration upper computer through the virtual CAN bus.
Preferably, the calling of the virtual CAN bus function interface includes: and calling an opening drive function interface to control the virtual CAN bus drive. And calling the channel selection function interface to select a virtual CAN bus channel, and calling the port opening function to open the corresponding virtual CAN bus channel interface. And calling a function interface for setting the channel mode to control the sending and receiving of the notification mode. And calling a channel filtering setting function interface to set the channel filtering. And calling the channel activation function interface to activate the corresponding channel. And calling a virtual CAN message sending function interface to send a message to the virtual CAN bus. And periodically calling a virtual CAN message receiving function interface to receive the message in the virtual CAN bus.
As a preferred mode, the receiving the calibration data sent by the calibration upper computer by the received data processing module includes: the virtual CAN bus sends the data to the virtual CAN equipment through the virtual CAN bus interface. After receiving the data, the virtual CAN equipment writes the data into a receiving buffer area and sets a receiving interrupt flag bit. If an interrupt feed enable signal is received, a receive interrupt is triggered. And after triggering the receiving interrupt, calling the receiving interrupt service, and setting a corresponding receiving flag variable as 1 in the process of receiving the interrupt service. And when the virtual CAN equipment reads that the receiving mark variable is 1, the virtual CAN equipment sets the receiving mark variable to 0 while reading data from the receiving buffer zone.
As a preferred mode, the sending the calibration data to the calibration upper computer by the data sending processing module includes: and calling the CAN sending driver by the program process to write the data into the sending buffer area. The enable transmit bit of the register of the virtual CAN device is set to 1. And the virtual CAN equipment executes the sending command, reads out data from the sending buffer zone and calls the virtual CAN bus interface to send the data to the virtual CAN bus.
As the preferred mode, the setting of mutually independent calibration upper computer and virtual ECU includes: initializing and calibrating the upper computer and initializing the virtual ECU. And constructing a virtual CAN bus for bidirectional communication between the calibration upper computer and the virtual ECU. Wherein initializing the virtual ECU comprises: initializing a register and a register read-write interface of the virtual CAN equipment according to the chip type classification, and realizing initialization by using the relevant parameters of the register and the register read-write interface of the virtual CAN equipment defined by the register realization module loading structural body.
As a preferred mode, initializing the register and the register read-write interface of the virtual CAN device according to the chip type classification includes: and acquiring a module base address, an address offset value of each register relative to the base address and the size of the register according to the data of the CAN equipment chip, and constructing a register structure variable according to the three items of data. The method for realizing the virtual CAN equipment register defined by the module loading structure body and the relevant parameters of the register read-write interface comprises the following steps: and constructing a function with parameters of an object pointer, an offset value, a data pointer and the number of bytes accessed to the memory. And finding the position of the register variable in the structure body variable according to the parameter deviation value, and performing read-write operation on the register variable. The parameters in the registers are read and written by the object pointers and the parameters of the storage space are read and written by the parameter offset values.
As a preferred mode, the method for implementing virtual calibration of an automobile based on a virtual simulation platform provided by the invention further comprises a calibration test. Wherein, the calibration test comprises: and modifying the parameter value in a parameter control interface of the calibration upper computer interface. And opening a memory interface of the virtual ECU, and comparing whether the memory value corresponding to the parameter address is modified or not. And displaying the semaphore change related to the parameter on the interface of the calibration upper computer.
The invention provides a virtual calibration device for realizing an automobile by a virtual simulation platform, which comprises: the system comprises an upper computer and a virtual ECU which are mutually independent, wherein the virtual ECU comprises an XCP drive and a virtual CAN device. The calibration upper computer comprises an XCP drive. And the XCP driver of the calibration upper computer is communicated with the virtual CAN equipment through a virtual CAN bus. The XCP driver in the virtual ECU communicates with the virtual CAN device through calls of the CAN driver function interface. The virtual CAN equipment and the virtual CAN bus are communicated through calling of a virtual CAN bus function interface. And calling a virtual CAN bus by an XCP driver of the calibration upper computer to send a message which accords with an XCP protocol to the virtual ECU. And the virtual ECU stores the data issued by the calibration upper computer software into a virtual CAN equipment receiving buffer area by calling a message receiving function interface of the virtual CAN bus. After the XCP driver in the virtual ECU processes the message data of the receiving buffer area of the virtual CAN equipment, the message data to be sent to the calibration upper computer software is sent to the sending buffer area of the virtual CAN equipment. And the XCP driver calls a message sending function interface of the virtual CAN bus and sends a sending frame back to the calibration upper computer.
As a preferred mode, the virtual CAN equipment comprises a register read-write interface, a register implementation module, a data sending processing module, a data receiving processing module and a virtual CAN bus interface calling module. The calibration data is bidirectionally transmitted between the calibration upper computer and the virtual ECU through the virtual CAN bus. The virtual CAN equipment calls a virtual CAN bus interface through the data processing module to receive calibration data sent by the calibration upper computer. Then, the register read-write interface is called by the register implementation module to store or take out the relevant parameters of the calibration data into or out of the register and the storage space according to the corresponding categories. And when the calibration data result needs to be returned, the result calls the virtual CAN bus interface through the data sending processing module to send the calibration data result to the calibration upper computer through the virtual CAN bus.
The invention provides a virtual calibration method and a virtual calibration device based on a virtual platform, aiming at the problem that the calibration of an automobile ECU depends on a real physical environment to cause a longer calibration period and higher cost, the virtual calibration method and the virtual calibration device can provide a virtual simulation platform, a virtual bus and a simulation physical model which are separated from the real ECU, the real physical environment and the real bus, most of the workload of the ECU calibration can be completed on intelligent equipment, the whole calibration process does not need to depend on the real ECU and the physical environment, the dependence of a calibration engineer on a hardware environment can be reduced, the problem that the period is longer because the calibration of the real physical environment is required in the prior art is effectively solved, and the time cost in the calibration process is saved.
Drawings
FIG. 1 is a first schematic block diagram of virtual calibration of the present invention.
FIG. 2 is a second schematic block diagram of virtual calibration of the present invention.
Fig. 3 is a schematic diagram illustrating the connection setup of the virtual bus establishing XCP connection according to the present invention.
Fig. 4 is a first diagram of a modified reference value of the present invention.
Fig. 5 is a second diagram of the modified reference value of the present invention.
Fig. 6 is a fourth diagram of the modified reference value of the present invention.
Fig. 7 is a third diagram of the modified reference value of the present invention.
FIG. 8 is a semaphore display diagram in accordance with the invention.
Detailed Description
Hereinafter, embodiments of the method and apparatus for implementing virtual calibration of an automobile based on a virtual simulation platform according to the present invention will be described with reference to the accompanying drawings.
The embodiments described herein are specific embodiments of the present invention, are intended to be illustrative and exemplary in nature, and are not to be construed as limiting the scope of the invention. In addition to the embodiments described herein, those skilled in the art will be able to employ other technical solutions which are obvious based on the disclosure of the claims and the specification of the present application, and these technical solutions include technical solutions which employ any obvious replacement or modification of the embodiments described herein.
The drawings in the present specification are schematic views to assist in explaining the concept of the present invention, and schematically show the shapes of respective portions and their mutual relationships.
FIG. 1 shows a schematic block diagram of a virtual ECU based calibration. As shown in fig. 1, the present invention provides a method for implementing virtual calibration of an automobile based on a virtual simulation platform, the method comprising:
and a calibration upper computer and a virtual ECU which are mutually independent are arranged, and the virtual ECU comprises an XCP drive and a virtual CAN device. The calibration upper computer comprises an XCP drive. The CAN device is a controller local area network controller device. The virtual ECU is a virtual electronic control unit. The XCP drive is a universal measurement and calibration drive.
And the XCP driver of the calibration upper computer is communicated with the virtual CAN equipment through a virtual CAN bus. The XCP driver in the virtual ECU communicates with the virtual CAN device through a call of the CAN driver function interface. The virtual CAN equipment and the virtual CAN bus are communicated through calling of a virtual CAN bus function interface.
And calling the virtual CAN bus through the XCP drive of the calibration upper computer to send a message which accords with an XCP protocol to the virtual ECU. And the virtual ECU stores the data issued by the calibration upper computer software in a virtual CAN equipment receiving buffer area by calling a message receiving function interface of the virtual CAN bus. After the XCP driver in the virtual ECU processes the message data of the receiving buffer area of the virtual CAN equipment, the message data to be sent to the calibration upper computer software is sent to the sending buffer area of the virtual CAN equipment. And the XCP driver calls a message sending function interface of the virtual CAN bus and sends a sending frame back to the calibration upper computer.
Specifically, the calibration upper computer software CAN call a virtual bus through a self-contained XCP Driver to send a message which accords with an XCP protocol to the virtual ECU, the virtual ECU stores data sent by the calibration upper computer software into a virtual CAN equipment receiving buffer area through calling a message receiving function interface of the virtual bus, after the XCP drive in the virtual ECU processes the message data in the virtual CAN equipment receiving buffer area, the message data to be sent to the calibration upper computer software is sent to a sending buffer area of the virtual CAN equipment, the message sending function interface of the virtual bus is called, and a sending frame is sent back to the calibration software upper computer.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Further preferably, the following is a method for implementing virtual calibration of an automobile based on a virtual simulation platform according to an optional embodiment of the present invention, where the method includes the following steps:
step a: and creating and realizing virtual CAN equipment for initiating a virtual bus communication action and controlling and managing a bus system. And defining CAN equipment and an interrupt count mark global variable, and realizing a CAN equipment register read-write access interface and a memory read-write access interface.
Step b: and calling the virtual bus interface function by the CAN equipment.
Step c: and the calibration upper computer and the virtual ECU establish XCP connection through a virtual bus to perform calibration test.
The invention mainly utilizes a computer platform containing a virtual bus to realize virtual calibration based on a virtual simulation platform, the whole calibration process does not need to depend on a real ECU and a physical environment, the dependence of a calibration engineer on a hardware environment is reduced, and most of calibration work is completed on one intelligent terminal.
The device structure of the CAN device is as follows: the CAN equipment is realized by a register read-write interface and a register, the CAN controller sends data to process and the CAN controller receives data to process, and the CAN equipment and the virtual CAN bus interact data.
Fig. 3 shows an installation diagram of the virtual ECU. As shown in fig. 3, the virtual ECU is connected to the Vector calibration upper computer, and is in communication connection with the memory of the virtual ECU, the CAN, and the XCP of the virtual ECU in sequence. The XCP of the CAN and the virtual ECU are connected with each other through a virtual CAN bus. XCP of the virtual ECU can interact with PAR and database data through wired or wireless communication means.
The method for realizing the virtual CAN equipment comprises the following steps:
a. the CAN controller device model is created using the device create command under skyeeye.
b. A structure is used to define the CAN device registers.
c. And constructing a register read-write interface.
d. And realizing all registers of the CAN controller according to the chip manual.
e. And constructing a data receiving and transmitting processing module.
FIG. 2 is a further schematic block diagram of the virtual calibration of the present invention.
Further preferably, as shown in fig. 2, the virtual CAN device includes a register read/write interface, a register implementation module, a data sending processing module, a data receiving processing module, and a virtual CAN bus interface calling module. The calibration data are transmitted in two directions between the calibration upper computer and the virtual ECU through the virtual CAN bus. The virtual CAN equipment calls a virtual CAN bus interface through the data processing module to receive calibration data sent by the calibration upper computer. Then, the register read-write interface is called by the register implementation module to store or take out the relevant parameters of the calibration data into or out of the register and the storage space according to the corresponding types. And when the calibration data result needs to be returned, the result calls the virtual CAN bus interface through the data sending processing module to send the calibration data result to the calibration upper computer through the virtual CAN bus.
Further preferably, the invoking of the virtual CAN bus function interface includes: and calling an opening drive function interface to control the virtual CAN bus drive. And calling the selection channel function interface to select a virtual CAN bus channel, and calling the opening port function to open the corresponding virtual CAN bus channel interface. And calling a function interface for setting the channel mode to control the sending and receiving of the notification mode. And calling a channel filtering setting function interface to set channel filtering. And calling a channel activation function interface to activate the corresponding channel. And calling a virtual CAN message sending function interface to send a message to the virtual CAN bus. And periodically calling a virtual CAN message receiving function interface to receive the message in the virtual CAN bus.
Further preferably, the receiving the calibration data sent by the calibration upper computer by the received data processing module includes: the virtual CAN bus sends the data to the virtual CAN equipment through the virtual CAN bus interface. After receiving the data, the virtual CAN equipment writes the data into a receiving buffer area and sets a receiving interrupt flag bit. If an interrupt feed enable signal is received, a receive interrupt is triggered. And after triggering the receiving interrupt, calling the receiving interrupt service, and setting a corresponding receiving flag variable to be 1 in the process of receiving the interrupt service. And when the virtual CAN equipment reads that the receiving mark variable is 1, the virtual CAN equipment sets the receiving mark variable to 0 while reading data from the receiving buffer zone.
Further preferably, the sending the calibration data to the calibration upper computer by the data sending processing module includes: and calling the CAN sending driver by the program process to write the data into the sending buffer area. The enable transmit bit of the register of the virtual CAN device is set to 1. The virtual CAN equipment executes the sending command, reads data from the sending buffer zone and calls the virtual CAN bus interface to send the data to the virtual CAN bus.
Further preferably, the setting of the calibration upper computer and the virtual ECU that are independent of each other includes: initializing and calibrating the upper computer and initializing the virtual ECU. And constructing a virtual CAN bus for bidirectional communication between the calibration upper computer and the virtual ECU. Wherein initializing the virtual ECU comprises: initializing a register and a register read-write interface of the virtual CAN equipment according to the chip type classification, and realizing initialization by using the relevant parameters of the register and the register read-write interface of the virtual CAN equipment defined by the register realization module loading structural body.
Further preferably, the initializing the register and the register read-write interface of the virtual CAN device according to the chip type classification in this embodiment includes: and acquiring a module base address, an address offset value of each register relative to the base address and the size of the register according to the data of the CAN equipment chip, and constructing a register structure variable according to the three items of data. The method for realizing the virtual CAN equipment register defined by the module loading structure body and the relevant parameters of the register read-write interface comprises the following steps: and constructing a function with parameters of an object pointer, an offset value, a data pointer and the number of bytes accessed to the memory. And finding the position of the register variable in the structure body variable according to the parameter deviation value, and performing read-write operation on the register variable. The parameters in the registers are read and written by the object pointers and the parameters of the storage space are read and written by the parameter offset values.
Further preferably, the method for realizing virtual calibration of an automobile based on a virtual simulation platform further includes a calibration test. Wherein, the calibration test comprises: and modifying the parameter value in a parameter control interface of the calibration upper computer interface. And opening a memory interface of the virtual ECU, and comparing whether the memory value corresponding to the parameter address is modified or not. And displaying the semaphore change related to the parameter on the interface of the calibration upper computer.
The present embodiment further preferably provides that the addresses of the parameters of the calibration data are obtained from a map file generated by compiling, and the values of the parameters are determined by the curve change of the relevant semaphore.
The user modifies the value of the parameter in the interface of the upper computer according to the change of the relevant semaphore curve, and the value of the parameter is finally transmitted to the memory of the virtual ECU through the XCP Driver, the virtual bus and the virtual CAN equipment in sequence; after the values of the parameters in the virtual ECU are modified, the semaphore curve is changed, and the values of the parameters are modified again until an optimal curve is obtained.
For example, suppose there is an expression of a = k × 10 in the program; k is a parameter, a is a signal value, and a curve with the horizontal axis as time and the vertical axis as a value is a signal value curve (here, a horizontal line).
Furthermore, the initial parameter value is a parameter initial value preset in the virtual ECU, and which parameters are calibrated is determined according to actual needs of a user. The user may manually enter calibration parameters.
Specific steps for modifying the reference value and examples of memory value modification for the observation parameter address are shown in fig. 4-7. An example of the semaphore display is shown in figure 8. As shown in fig. 4-5, the example XcpDemo use case modifies the ADC _ task _ timeout parameter value example:
1. as shown in fig. 4, add adc _ task _ timeout to the host computer CANape software Parameter window, with an initial value of 3500.
2. As shown in fig. 5, the value of the parameter adc _ task _ timeout is selected, the value of adc _ task _ timeout is modified by double-clicking, the value of adc _ task _ timeout is changed to 1024, and the Enter key is clicked to confirm after modification, as shown in the following figure (note that the modified value of the data is smaller than the original value).
3. As shown in fig. 7, according to the map file generated by the XcpDemo use case compilation, it can be determined that the memory address corresponding to the adc _ task _ timeout is 0xd00017d0.
4. As shown in fig. 6, the memory display interface of the SkyEye virtual ECU is opened, and it can be seen that the memory value of the address 0xd00017d0 is 0x400 (16 is a value, and the value is converted into 1024 in 10).
The invention provides a virtual calibration method and a virtual calibration device based on a virtual platform, aiming at the problem that the calibration of an automobile ECU depends on a real physical environment to cause a longer calibration period and higher cost, the virtual calibration method and the virtual calibration device can provide a virtual simulation platform, a virtual bus and a simulation physical model which are separated from the real ECU, the real physical environment and the real bus, most of the workload of the ECU calibration can be completed on intelligent equipment, the whole calibration process does not need to depend on the real ECU and the physical environment, the dependence of a calibration engineer on a hardware environment can be reduced, the problem that the period is longer because the calibration of the real physical environment is required in the prior art is effectively solved, and the time cost in the calibration process is saved.
As shown in fig. 1, the present invention provides a virtual calibration apparatus for realizing an automobile by using a virtual simulation platform, including: the system comprises an upper computer and a virtual ECU which are mutually independent, wherein the virtual ECU comprises an XCP drive and a virtual CAN device. The calibration upper computer comprises an XCP drive. And the XCP driver of the calibration upper computer is communicated with the virtual CAN equipment through a virtual CAN bus. The XCP driver in the virtual ECU communicates with the virtual CAN device through a call of the CAN driver function interface. The virtual CAN equipment and the virtual CAN bus are communicated through calling of a virtual CAN bus function interface. And calling a virtual CAN bus by an XCP driver of the calibration upper computer to send a message which accords with an XCP protocol to the virtual ECU. And the virtual ECU stores the data issued by the calibration upper computer software in a virtual CAN equipment receiving buffer area by calling a message receiving function interface of the virtual CAN bus. After the XCP driver in the virtual ECU processes the message data of the virtual CAN equipment receiving buffer area, the message data to be sent to the calibration upper computer software is sent to a sending buffer area of the virtual CAN equipment. And the XCP driver calls a message sending function interface of the virtual CAN bus and sends a sending frame back to the calibration upper computer.
Further preferably, as shown in fig. 2, the virtual CAN device includes a register read/write interface, a register implementation module, a data sending processing module, a data receiving processing module, and a virtual CAN bus interface calling module. The calibration data is bidirectionally transmitted between the calibration upper computer and the virtual ECU through the virtual CAN bus. The virtual CAN equipment calls a virtual CAN bus interface through the data processing module to receive calibration data sent by the calibration upper computer. Then, the register read-write interface is called by the register implementation module to store or take out the relevant parameters of the calibration data into or out of the register and the storage space according to the corresponding types. And when a calibration data result needs to be returned, the result calls the virtual CAN bus interface through the data sending processing module to send the calibration data result to the calibration upper computer through the virtual CAN bus.
The invention provides a virtual calibration method and a virtual calibration device based on a virtual platform, aiming at the problem that the calibration of an automobile ECU depends on a real physical environment to cause a longer calibration period and higher cost, the virtual calibration method and the virtual calibration device can provide a virtual simulation platform, a virtual bus and a simulation physical model which are separated from the real ECU, the real physical environment and the real bus, most of the workload of the ECU calibration can be completed on intelligent equipment, the whole calibration process does not need to depend on the real ECU and the physical environment, the dependence of a calibration engineer on a hardware environment can be reduced, the problem that the period is longer because the calibration of the real physical environment is required in the prior art is effectively solved, and the time cost in the calibration process is saved.
The embodiments of the method and the apparatus for implementing virtual calibration of an automobile based on a virtual simulation platform according to the present invention are described above, and the purpose of the embodiments is to explain the spirit of the present invention. Note that those skilled in the art can modify and combine the features of the above-described embodiments without departing from the spirit of the present invention, and therefore, the present invention is not limited to the above-described embodiments. The specific features such as shape, size and position of the virtual calibration device based on the virtual simulation platform of the present invention can be specifically designed by the functions of the above disclosed features, and the design can be realized by those skilled in the art. Moreover, the technical features disclosed in the above are not limited to the combinations with other features disclosed, and other combinations between the technical features can be performed by those skilled in the art according to the purpose of the invention, so as to achieve the purpose of the invention.
Claims (10)
1. A method for realizing virtual calibration of an automobile based on a virtual simulation platform is characterized by comprising the following steps:
setting a calibration upper computer and a virtual ECU which are mutually independent, wherein the virtual ECU comprises an XCP drive and a virtual CAN device; the calibration upper computer comprises an XCP drive;
the XCP driver of the calibration upper computer is communicated with the virtual CAN equipment through a virtual CAN bus; an XCP driver in the virtual ECU communicates with the virtual CAN device through a call of a CAN driver function interface; the virtual CAN equipment and the virtual CAN bus are communicated by calling the virtual CAN bus function interface;
calling a virtual CAN bus through the XCP drive of the calibration upper computer to send a message which accords with an XCP protocol to a virtual ECU;
the virtual ECU stores data issued by the calibration upper computer software into a virtual CAN equipment receiving buffer area by calling a message receiving function interface of a virtual CAN bus;
after the XCP driver in the virtual ECU processes the message data of the virtual CAN equipment receiving buffer area, the message data to be sent to the calibration upper computer software is sent to a sending buffer area of the virtual CAN equipment;
and the XCP driver calls a message sending function interface of the virtual CAN bus and sends a sending frame back to the calibration upper computer.
2. The method for realizing virtual calibration of an automobile based on a virtual simulation platform of claim 1,
the virtual CAN equipment comprises a register read-write interface, a register implementation module, a sending data processing module, a receiving data processing module and a virtual CAN bus interface calling module; wherein,
calibration data are transmitted in two directions between the calibration upper computer and the virtual ECU through a virtual CAN bus; wherein,
the virtual CAN equipment calls the virtual CAN bus interface through the data processing module to receive calibration data sent by the calibration upper computer; then, calling the register read-write interface through the register implementation module to store or take out relevant parameters of the calibration data into or out of the register and the storage space according to corresponding categories; and when a calibration data result needs to be returned, calling the virtual CAN bus interface through the data sending processing module to send the calibration data result to the calibration upper computer through the virtual CAN bus.
3. The method for realizing the virtual calibration of the automobile based on the virtual simulation platform as claimed in claim 2, wherein the calling of the virtual CAN bus function interface comprises:
calling and opening a driving function interface to control the virtual CAN bus driving;
calling a channel selection function interface to select a virtual CAN bus channel, and calling an opening port function to open a corresponding virtual CAN bus channel interface;
calling a function interface for setting a channel mode to set the channel mode as a notification control sending and receiving mode;
calling a channel filtering setting function interface to set channel filtering;
calling a channel activation function interface to activate a corresponding channel;
calling a virtual CAN message sending function interface to send a message to a virtual CAN bus;
and periodically calling a virtual CAN message receiving function interface to receive the message in the virtual CAN bus.
4. The method for realizing the virtual calibration of the automobile based on the virtual simulation platform according to claim 2, wherein the step of receiving the calibration data sent by the calibration upper computer by the data receiving processing module comprises the steps of:
the virtual CAN bus sends data to the virtual CAN equipment through the virtual CAN bus interface;
after receiving the data, the virtual CAN equipment writes the data into a receiving buffer area and sets a receiving interrupt flag bit;
triggering a reception interrupt if receiving an interrupt feed enable signal; and,
after triggering the receiving interrupt, calling the receiving interrupt service, and setting a corresponding receiving flag variable to be 1 in the process of receiving the interrupt service; and when the virtual CAN equipment reads that the receiving mark variable is 1, the virtual CAN equipment sets the receiving mark variable to 0 while reading data from the receiving buffer zone.
5. The method for realizing the virtual calibration of the automobile based on the virtual simulation platform according to claim 2, wherein the sending the calibration data to the calibration upper computer by the data sending processing module comprises:
the program process calls a CAN sending driver to write data into a sending buffer area;
setting an enabling sending bit of a register of the virtual CAN equipment to be 1;
and the virtual CAN equipment executes a sending command, reads data from the sending buffer zone and calls a virtual CAN bus interface to send the data to the virtual CAN bus.
6. The method for realizing the virtual calibration of the automobile based on the virtual simulation platform according to any one of claims 1 to 5,
the setting of mutually independent calibration upper computer and virtual ECU includes: initializing a calibration upper computer and initializing a virtual ECU; building a virtual CAN bus for bidirectional communication between the calibration upper computer and the virtual ECU; wherein,
initializing the virtual ECU includes: initializing a register and a register read-write interface of the virtual CAN equipment according to the chip type classification, and realizing initialization by using the relevant parameters of the register and the register read-write interface of the virtual CAN equipment defined by the register realization module loading structural body.
7. The method for realizing virtual calibration of an automobile based on a virtual simulation platform of claim 6,
initializing the register and the register read-write interface of the virtual CAN equipment according to the chip type classification comprises the following steps: acquiring a module base address, an address offset value of each register relative to the base address and the size of the register according to data of a CAN equipment chip, and constructing a register structure variable according to the three items of data;
the method for realizing the virtual CAN equipment register defined by the module loading structure body and the relevant parameters of the register read-write interface comprises the following steps: constructing a function with parameters of an object pointer, an offset value, a data pointer and the number of bytes accessing a memory; finding the position of a register variable in the structure body variable according to the parameter deviation value, and performing read-write operation on the register variable; the parameters in the registers are read and written by the object pointers and the parameters of the storage space are read and written by the parameter offset values.
8. The method for realizing the virtual calibration of the automobile based on the virtual simulation platform is characterized by further comprising a calibration test; wherein, the calibration test comprises:
modifying parameter values in a parameter control interface of the calibration upper computer interface;
opening a memory interface of the virtual ECU, and comparing whether a memory value corresponding to a parameter address is modified or not;
and displaying the semaphore change related to the parameter on the interface of the calibration upper computer.
9. A virtual calibration device for realizing an automobile based on a virtual simulation platform is characterized in that the system comprises a calibration upper computer and a virtual ECU (electronic control unit), wherein the calibration upper computer and the virtual ECU are mutually independent, and the virtual ECU comprises an XCP (X-ray computer) driver and a virtual CAN (controller area network) device; the calibration upper computer comprises an XCP drive;
the XCP driver of the calibration upper computer is communicated with the virtual CAN equipment through a virtual CAN bus; an XCP driver in the virtual ECU communicates with the virtual CAN device through a call of a CAN driver function interface; the virtual CAN equipment and the virtual CAN bus are communicated by calling the virtual CAN bus function interface;
calling a virtual CAN bus through the XCP drive of the calibration upper computer to send a message which accords with an XCP protocol to a virtual ECU;
the virtual ECU stores data issued by the calibration upper computer software into a virtual CAN equipment receiving buffer area by calling a message receiving function interface of a virtual CAN bus;
after the XCP driver in the virtual ECU processes the message data of the virtual CAN equipment receiving buffer area, the message data to be sent to the calibration upper computer software is sent to the sending buffer area of the virtual CAN equipment;
and the XCP driver calls a message sending function interface of the virtual CAN bus and sends a sending frame back to the calibration upper computer.
10. The device for realizing virtual calibration of an automobile based on a virtual simulation platform of claim 9,
the virtual CAN equipment comprises a register read-write interface, a register implementation module, a sending data processing module, a receiving data processing module and a virtual CAN bus interface calling module; wherein,
calibration data is transmitted in two directions between the calibration upper computer and the virtual ECU through a virtual CAN bus; wherein,
the virtual CAN equipment calls the virtual CAN bus interface through the data processing module to receive calibration data sent by the calibration upper computer; then, calling the register read-write interface through the register implementation module to store or take out the relevant parameters of the calibration data into or out of the register and the storage space according to the corresponding categories; and when a calibration data result needs to be returned, calling the virtual CAN bus interface through the data sending processing module to send the calibration data result to the calibration upper computer through the virtual CAN bus.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310051871.5A CN115981286A (en) | 2023-02-02 | 2023-02-02 | Method and device for realizing virtual calibration of automobile based on virtual simulation platform |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310051871.5A CN115981286A (en) | 2023-02-02 | 2023-02-02 | Method and device for realizing virtual calibration of automobile based on virtual simulation platform |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115981286A true CN115981286A (en) | 2023-04-18 |
Family
ID=85970171
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310051871.5A Pending CN115981286A (en) | 2023-02-02 | 2023-02-02 | Method and device for realizing virtual calibration of automobile based on virtual simulation platform |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115981286A (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104422593A (en) * | 2013-08-30 | 2015-03-18 | 上海汽车集团股份有限公司 | Testing system of power assembly |
JP2021090160A (en) * | 2019-12-05 | 2021-06-10 | パナソニックIpマネジメント株式会社 | Information processor, abnormality detection method, and computer program |
CN113984395A (en) * | 2021-11-09 | 2022-01-28 | 中国人民解放军陆军军事交通学院 | double-VGT two-stage adjustable supercharged diesel engine variable-altitude simulation test system and method |
CN114638097A (en) * | 2022-03-10 | 2022-06-17 | 潍柴动力股份有限公司 | Method, device and equipment for calibrating ECU (electronic control Unit) program parameters and storage medium |
CN115048308A (en) * | 2022-06-16 | 2022-09-13 | 北京新能源汽车股份有限公司 | Chip simulation method and system based on automobile software test |
CN115542878A (en) * | 2022-09-27 | 2022-12-30 | 重庆长安汽车股份有限公司 | Simulation virtualization test method, system, equipment and medium based on controller |
-
2023
- 2023-02-02 CN CN202310051871.5A patent/CN115981286A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104422593A (en) * | 2013-08-30 | 2015-03-18 | 上海汽车集团股份有限公司 | Testing system of power assembly |
JP2021090160A (en) * | 2019-12-05 | 2021-06-10 | パナソニックIpマネジメント株式会社 | Information processor, abnormality detection method, and computer program |
CN113984395A (en) * | 2021-11-09 | 2022-01-28 | 中国人民解放军陆军军事交通学院 | double-VGT two-stage adjustable supercharged diesel engine variable-altitude simulation test system and method |
CN114638097A (en) * | 2022-03-10 | 2022-06-17 | 潍柴动力股份有限公司 | Method, device and equipment for calibrating ECU (electronic control Unit) program parameters and storage medium |
CN115048308A (en) * | 2022-06-16 | 2022-09-13 | 北京新能源汽车股份有限公司 | Chip simulation method and system based on automobile software test |
CN115542878A (en) * | 2022-09-27 | 2022-12-30 | 重庆长安汽车股份有限公司 | Simulation virtualization test method, system, equipment and medium based on controller |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US5444643A (en) | Method for programming a bus-compatible electronic motor vehicle controller | |
US6867749B1 (en) | Control system, display device, control-use host computer, and data transmission method | |
CN100382016C (en) | Digital signal system possessing accelerator and method of operation | |
CN103605359A (en) | Automobile diagnostic system and method | |
CN111444609B (en) | Data processing method and simulation system | |
JP3456692B2 (en) | Data processing device | |
CN113821440B (en) | VxWorks application software testing method, system and simulator | |
CN117261783A (en) | Multi-screen interconnected vehicle-mounted entertainment system | |
CN109446130B (en) | Method and system for acquiring state information of I/O (input/output) equipment | |
CN113364690A (en) | Method, device, terminal and storage medium for determining network transmission path of receiving card | |
CN115981286A (en) | Method and device for realizing virtual calibration of automobile based on virtual simulation platform | |
CN110362526B (en) | SPI slave device, storage and adaptation method and computer storage medium | |
CN113609052A (en) | Chip simulation system based on FPGA and microprocessor and implementation method | |
JP3516607B2 (en) | Programmable display device | |
CN101223511A (en) | Method and system for direct access to a non-memory mapped device memory | |
JP3400315B2 (en) | Profibus data transmission system | |
US4806927A (en) | Communication control method | |
CN102132528A (en) | Communication system and interface device for a communication system | |
JP3352557B2 (en) | How to monitor the electronic control unit | |
US20230350692A1 (en) | Arithmetic device and computer program | |
US20030101310A1 (en) | Using a PC for testing devices | |
CN117811939B (en) | Remote terminal simulation method based on 1553B bus | |
JP3384443B2 (en) | Test equipment for distributed control systems | |
JP2001318121A (en) | Inspection system for circuit board and circuit board | |
JPH08335201A (en) | Test system device for input/output control |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |