A virtual controller testing method, device, equipment and medium

By creating a virtual control engineering and importing related documents in the simulation software, the simulation test of the virtual controller is achieved, solving the problem of long and not high reliability caused by traditional functional test dependencies, and improved development efficiency and product quality Essence

CN115407756BActive Publication Date: 2025-01-24CHONGQING CHANGAN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211049036.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-30
Publication Date
2025-01-24
Estimated Expiration
2042-08-30

AI Technical Summary

Technical Problem

Traditional functional testing relies on the controller's hardware, resulting in a long system development cycle and its reliability and stability are not guaranteed.

Method used

By creating a virtual control engineering in the simulation software, the source code and description file of the software component are introduced, the instance is created and the interface is associated, the description file of the middleware source code and the micro -controller abstract layer is introduced to obtain the virtual controller and then perform simulation testing.

Benefits of technology

Realize the functional testing in advance, improve development efficiency and quality, and enhance the reliability and stability of the product.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115407756B_ABST
    Figure CN115407756B_ABST
Patent Text Reader

Abstract

The present application provides a virtual controller testing method and device, equipment and medium, wherein the method includes: creating a virtual control project in simulation software; importing the source code of at least one software component, the description file of at least one software component, the middleware source code, the interface configuration description file and the description file of the microcontroller abstraction layer into the virtual control project to obtain a virtual controller; creating an instance for each software component in at least one software component, and associating at least one software component to at least one corresponding interface through a preset interface relationship table; associating a system test task according to the description file of at least one software component through the virtual controller, and calling the executable entity in at least one software component to simulate the system test task. Through this method, functional testing can be performed in advance, which is conducive to improving development efficiency and development quality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a virtual controller testing method, device, equipment and medium. Background Art

[0002] AutoSAR (Automotive Open System Architecture) is increasingly used in the automotive industry, and more and more projects or controllers are being developed based on the AUTOSAR standard. The AUTOSAR standard defines the software components of the application layer as "reusable software components" and defines the input and output interfaces and data type descriptions of the software components. In actual product controllers, a large number of controllers do not implement AUTOSAR standardization. For controllers based on the AUTOSAR architecture, the internal behavior and interface information of some application layer codes are described in detail in the system architecture description file.

[0003] Based on the concept of AUTOSAR architecture, software and hardware are decoupled, and software development, especially application software development, can be ahead of hardware design, independently developed and designed, and only unit tests of single software modules are performed for the testing of application layer software. Although the software integration test in the later stage of development includes application software and middleware software, the focus of the test is more on channel testing and driver testing.

[0004] Traditional functional testing relies too much on the controller hardware through controller single HIL and system HIL. It is necessary to wait until the hardware development is completed before it can be integrated into the test environment to complete the functional testing. This will lead to a long system development cycle and its reliability and stability cannot be guaranteed. Summary of the invention

[0005] In view of the above-mentioned shortcomings of the prior art, the present application provides a virtual controller testing method to solve the above-mentioned technical problems.

[0006] The present application provides a virtual controller testing method, the method comprising:

[0007] Creating a virtual control project in simulation software, the virtual control project including a carrier of a virtual electronic control unit;

[0008] Importing the source code of at least one software component and the description file of at least one software component into the virtual control project to obtain an updated virtual control project;

[0009] Creating an instance for each software component in the at least one software component, and associating the at least one software component with the corresponding at least one interface through a preset interface relationship table, wherein the preset interface relationship table is included in a description file of the at least one software component;

[0010] Importing the middleware source code, the interface configuration description file and the description file of the microcontroller abstraction layer into the updated virtual control project to obtain the virtual controller;

[0011] The system test task is associated with the description file of at least one software component through the virtual controller, and the executable entity in at least one software component is called to perform simulation test on the system test task.

[0012] In one embodiment of the present application, the source code of at least one software component and the description file of at least one software component are imported into the virtual control project. Before obtaining the updated virtual control project, the software engineering code of the real controller is adjusted to make the software engineering code hardware-independent, and the adjusted software engineering code is obtained. The adjusted software engineering code includes the remaining part, and the simulation software is included in the real controller; the remaining part is completed by the microcontroller abstraction layer and the operating system of the microcontroller abstraction layer.

[0013] In one embodiment of the present application, the hardware-related code portion of the software engineering code is stripped.

[0014] In one embodiment of the present application, middleware source code, interface configuration description files, and description files of a microcontroller abstraction layer are obtained, wherein the middleware source code is included in the basic software layer, and the source code and description files of at least one software component are included in the application layer; a calling relationship between the application layer and the basic software layer, and a calling relationship between the basic software layer and the microcontroller abstraction layer are created to obtain a virtual controller.

[0015] In one embodiment of the present application, after calling the executable entity in at least one software component to perform simulation test on the system test task, a debugging access interface is created for each interface in at least one interface; and the at least one interface is observed in combination with the calibration file.

[0016] In one embodiment of the present application, a preset test model is combined with a virtual controller and compiled into a project to be tested; the project to be tested is imported into automated testing software; and the automated testing software calls an executable entity in at least one software component to perform a simulation test on the system testing task.

[0017] In one embodiment of the present application, the number of virtual controllers is at least one;

[0018] In one embodiment of the present application, an external communication connection of at least one virtual controller is created through an environment configuration tool to obtain a virtual test system; and an executable entity in at least one software component is called through the virtual test system to perform simulation testing on a system test task.

[0019] In a second aspect, an embodiment of the present application provides a virtual controller testing device, comprising:

[0020] A creation unit, used for creating a virtual control project in the simulation software, wherein the virtual control project includes a carrier of a virtual electronic control unit;

[0021] An import unit, used to import the source code of at least one software component and the description file of at least one software component into the virtual control project to obtain an updated virtual control project;

[0022] The creation unit is further used to create an instance for each software component in the at least one software component, and associate the at least one software component with the corresponding at least one interface through a preset interface relationship table, wherein the preset interface relationship table is included in the description file of the at least one software component;

[0023] The import unit is also used to import the middleware source code, the interface configuration description file and the description file of the microcontroller abstraction layer into the updated virtual control project to obtain the virtual controller;

[0024] The test unit is used to associate the system test task with the description file of at least one software component through the virtual controller, and call the executable entity in at least one software component to perform simulation test on the system test task.

[0025] In a third aspect, the present application provides an electronic device, including:

[0026] one or more processors;

[0027] The storage device is used to store one or more programs. When the one or more programs are executed by one or more processors, the electronic device implements the virtual controller testing method described in the first aspect.

[0028] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor of a computer, the computer executes the virtual controller testing method described in the first aspect.

[0029] The beneficial effects of this application are: functional testing can be carried out in advance, which is conducive to improving development efficiency, development quality, and improving product quality reliability and stability.

[0030] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0032] Figure 1 is a schematic diagram of the structure of a virtual controller shown in an exemplary embodiment of the present application;

[0033] Figure 2 is a flowchart of a virtual controller testing method shown in an exemplary embodiment of the present application;

[0034] Figure 3 is a schematic diagram of a virtual controller and its creation components shown in an exemplary embodiment of the present application;

[0035] Figure 4 is a schematic diagram showing a combination of a virtual controller and a test model according to an exemplary embodiment of the present application;

[0036] Figure 5 is a schematic diagram of a virtual test system shown in an exemplary embodiment of the present application.

[0037] Figure 6 is a block diagram of a virtual controller testing device shown in an exemplary embodiment of the present application;

[0038] Figure 7 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION

[0039] The following will describe the implementation methods of the present application with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific implementation methods, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be understood that the preferred embodiments are only for illustrating the present application, not for limiting the scope of protection of the present application.

[0040] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present application, and thus the drawings only show components related to the present application rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed at will, and the component layout may also be more complicated.

[0041] In the following description, a large number of details are discussed to provide a more thorough explanation of the embodiments of the present application. However, it is obvious to those skilled in the art that the embodiments of the present application can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present application difficult to understand.

[0042] First of all, it should be noted that AutoSAR (Automotive Open System Architecture) is a cooperative development framework for automotive electronic systems jointly participated by global automobile manufacturers, parts suppliers, and various research and service organizations, and has established an open automotive controller (ECU) standard software architecture. AutoSAR is mainly divided into three layers: ASW (Application Software Layer), RTE (Runtime Environment) and BSW (Basic Software Layer). To ensure the independence of the upper and lower layers, under normal circumstances, each layer can only use the interface provided by the next layer and provide the corresponding interface to the upper layer. The layered architecture is the key to achieving the separation of hardware and software. It enables automotive embedded system control software developers to get rid of the dependence on hardware systems in the previous ECU software development and verification.

[0043] The application software layer includes several SWCs (Software Components), which interact with each other through ports. Each software component may include one or more Runnable Entities (REs), which encapsulate relevant control algorithms and can be triggered by RTE events. In the embodiments of the present application, a SWC file can be regarded as a .c file.

[0044] As a bridge between the application software layer and the basic software layer, the runtime environment makes it possible to separate software from hardware. RTE can realize communication between software components, between basic software, and between software components and basic software.

[0045] The basic software layer contains many basic software modules, which are responsible for the non-application related functions of ECU. One of the most important functions of basic software is the communication between ECUs, that is, signal interaction. The basic software layer can be divided into four layers, namely, the services layer, the ECU abstraction layer, the microcontroller abstraction layer (MCAL) and the complex drivers.

[0046] Among them, MCAL (Microcontroller Abstraction Layer) is a special layer that unifies different hardware interfaces. The microcontroller abstraction layer can encapsulate the hardware to prevent the upper-layer software from directly operating the microcontroller's registers.

[0047] Middleware is a type of software between the application system and the system software. It uses the basic services (functions) provided by the system software to connect the various parts of the application system or different applications on the network, thereby achieving the purpose of resource sharing and function sharing.

[0048] Ethernet is the most widely used LAN communication method and also a protocol. The Ethernet protocol defines a series of software and hardware standards to connect different computer devices together. The basic elements of Ethernet device networking are switches, routers, hubs, optical fibers and ordinary network cables, as well as Ethernet protocols and communication rules. The port for network data connection in Ethernet is the Ethernet interface, also known as the Ethernet interface.

[0049] Figure 1 FIG. 1 is a schematic diagram of a virtual controller according to an exemplary embodiment of the present application. Figure 1 As shown, the structure of the virtual controller includes an application (App) layer, an RTE layer, and a BSW layer, wherein the BSW layer may include an MCAL layer and a corresponding OS (Operating System). In the embodiment of the present application, the software layer structures of the real controller and the virtual controller are the same, but the real controller has a physical hardware interface, and the virtual controller has a virtual interface. The real controller needs to be externally connected to a hardware load before simulation testing can be performed, while the virtual controller can be simulated without connecting to an external load.

[0050] See also Figure 2 , Figure 2 is a flowchart of a virtual controller testing method shown in an exemplary embodiment of the present application. The method can be applied to Figure 1It should be understood that the method can also be applied to other exemplary implementation environments and specifically executed by devices in other implementation environments, and this embodiment does not limit the implementation environment to which the method is applicable.

[0051] like Figure 2 As shown, in an exemplary embodiment, the virtual controller testing method includes at least steps S210 to S250, which are described in detail as follows:

[0052] Step S210: creating a virtual control project in simulation software, where the virtual control project includes a carrier of a virtual electronic control unit.

[0053] Among them, the simulation software can run in a computer, and the virtual control engineering can create a carrier of a virtual electronic control unit (ECU).

[0054] Step S220: importing the source code of at least one software component and the description file of at least one software component into the virtual control project to obtain an updated virtual control project.

[0055] In one embodiment of the present application, before this, the software engineering code of the real controller can be adjusted to make the software engineering code hardware-independent, thereby obtaining the adjusted software engineering code, which includes the remaining part, and the simulation software is included in the real controller.

[0056] The method for adjusting the software engineering code of the real controller may be to strip the hardware-related code portion of the software engineering code. For example, the code that directly accesses the hardware and directly operates the registers of the hardware may be stripped, so that it is impossible to simulate on a non-virtual controller. After stripping, the code portion originally related to the hardware will be freed up, and the remaining portion is obtained.

[0057] Furthermore, the remaining part can be completed by the microcontroller abstraction layer (MCAL) and the operating system of the microcontroller abstraction layer (AUTOSAR OS). This is because if the virtual control project is incomplete, simulation compilation cannot be performed directly. In this case, the remaining part can be completed by MCAL and OS, thereby providing a simulated OS to interact with the application layer code. Among them, for the convenience of explanation, the embodiment of the present application abbreviates AUTOSAR OS as OS, and the two are the same.

[0058] Step S230, creating an instance for each software component in the at least one software component, and associating the at least one software component with the corresponding at least one interface through a preset interface relationship table, wherein the preset interface relationship table is included in the description file of the at least one software component.

[0059] The software component is recorded as SWC, and the SWC is included in the application layer. The application layer may include at least one SWC. An instance may be created for each SWC, and the instance may include a SWC and a description file of the SWC.

[0060] Step S240, importing the middleware source code, the interface configuration description file and the description file of the microcontroller abstraction layer into the updated virtual control project to obtain a virtual controller.

[0061] Specifically, the middleware source code, interface configuration description file and microcontroller abstraction layer description file can be obtained first, wherein the middleware source code is included in the basic software layer, and the source code of at least one SWC and the description files corresponding to each SWC are included in the application layer.

[0062] Furthermore, the calling relationship between the application layer and the basic software layer, and the calling relationship between the basic software layer and the microcontroller abstraction layer can be created to obtain a virtual controller. The virtual controller can realize complete simulation. Figure 3 As shown, the virtual controller at this time has the source code and corresponding description files of the application layer, the source code and corresponding description files of the BSW layer, and the description files of the OS and MCAL of the software simulation. Among them, the description files are ARXML files.

[0063] Step S250: associating the system test task with the description file of at least one software component through the virtual controller, and calling the executable entity in at least one software component to perform simulation test on the system test task.

[0064] The system test task (OS Task) is included in the OS and can be saved in the OS in the form of a list. The virtual controller can associate the OS Task with the description file of at least one SWC to automatically generate RTE code and other BSW layer codes. Furthermore, the runnable entity (Runable) in at least one SWC is called to perform simulation test on the system test task.

[0065] In one embodiment of the present application, after calling the executable entity in at least one software component to perform simulation test on the system test task, a debug access (DAP) interface can be created for each of the at least one interface, and the at least one interface can be observed in combination with the calibration (A2L) file. In other words, the operation status of each interface can be observed by creating a DAP interface and combining it with the A2L file.

[0066] In one embodiment of the present application, the preset test model is combined with the virtual controller and compiled into a project to be tested, and the project to be tested is imported into the automated test software. The preset test model can be a Simulink model. Furthermore, the automated test software calls the executable entity in at least one software component to perform a simulation test on the system test task. In other words, the automated test software can realize automated testing after being combined with Simulink. Figure 4 As shown, the virtual controller (V-ECU) is combined with Simulink moel to obtain an automated testing tool.

[0067] In one embodiment of the present application, the number of virtual controllers is at least one. An external communication connection of at least one virtual controller can be created through an environment configuration tool to obtain a virtual test system; the virtual test system includes at least one virtual controller, each virtual controller corresponds to its own SWC set, and multiple SWC sets can form at least one SWC. Furthermore, the virtual test system can call the executable entity in at least one SWC to perform simulation testing on the system test task. Figure 5 As shown, the virtual test system includes virtual controller 1 (V-VIU1), virtual controller 2 (V-VIU2) and virtual controller 3 (V-VIU3), and each virtual controller can be connected together through virtual Ethernet (Virtual ETH), virtual CAN bus, virtual LIN bus or Single base, and connected to the object model (Plant Model) for simulation.

[0068] Through the embodiment of the present application, the computer can create a virtual control project in the simulation software, and the virtual control project includes a carrier of a virtual electronic control unit; import the source code of at least one software component and the description file of at least one software component into the virtual control project to obtain an updated virtual control project; create an instance for each software component in the at least one software component, and associate at least one software component to the corresponding at least one interface through a preset interface relationship table, and the preset interface relationship table is included in the description file of at least one software component; import the middleware source code, the interface configuration description file and the description file of the microcontroller abstraction layer into the updated virtual control project to obtain a virtual controller; associate the system test task according to the description file of at least one software component through the virtual controller, and call the executable entity in at least one software component to simulate the system test task. Through this method, functional testing can be carried out in advance, which is conducive to improving development efficiency, development quality, and improving product quality reliability and stability. In addition, the pure software development environment of the system does not depend on the changes in peripheral hardware, is convenient for system transplantation and system generalization, and is convenient for the integrated operation of CI / CD.

[0069] Figure 6 is a block diagram of a virtual controller testing device shown in an exemplary embodiment of the present application. The device can be applied to Figure 1 The device can also be applied to other exemplary implementation environments and specifically configured in other devices. This embodiment does not limit the implementation environment to which the device is applied.

[0070] like Figure 6 As shown, the exemplary virtual controller testing device comprises:

[0071] A creation unit 610 is used to create a virtual control project in the simulation software, wherein the virtual control project includes a carrier of a virtual electronic control unit;

[0072] An importing unit 620, used to import the source code of at least one software component and the description file of at least one software component into the virtual control project to obtain an updated virtual control project;

[0073] The creation unit 610 is further configured to create an instance for each software component in the at least one software component, and associate the at least one software component with the corresponding at least one interface through a preset interface relationship table, wherein the preset interface relationship table is included in the description file of the at least one software component;

[0074] The import unit 620 is further used to import the middleware source code, the interface configuration description file and the description file of the microcontroller abstraction layer into the updated virtual control project to obtain the virtual controller;

[0075] The testing unit 630 is used to associate the system testing task with the description file of at least one software component through the virtual controller, and call the executable entity in at least one software component to perform simulation testing on the system testing task.

[0076] In one embodiment of the present application, the source code of at least one software component and the description file of at least one software component are imported into the virtual control project. Before obtaining the updated virtual control project, the processing unit 640 is used to adjust the software engineering code of the real controller so that the software engineering code is hardware-independent, and the adjusted software engineering code is obtained. The adjusted software engineering code includes the remaining part, and the simulation software is included in the real controller; the remaining part is completed by the microcontroller abstraction layer and the operating system of the microcontroller abstraction layer.

[0077] In one embodiment of the present application, the hardware-related code portion of the software engineering code is stripped.

[0078] In one embodiment of the present application, the processing unit 640 is also used to obtain the middleware source code, the interface configuration description file and the description file of the microcontroller abstraction layer, wherein the middleware source code is included in the basic software layer, and the source code and description file of at least one software component are included in the application layer; the creation unit 610 is also used to create a calling relationship between the application layer and the basic software layer, and a calling relationship between the basic software layer and the microcontroller abstraction layer to obtain a virtual controller.

[0079] In one embodiment of the present application, after calling the executable entity in at least one software component to perform simulation testing on the system test task, the creation unit 610 is also used to create a debugging access interface for each interface in at least one interface; and observe at least one interface in combination with the calibration file.

[0080] In one embodiment of the present application, the processing unit 640 is also used to combine the preset test model with the virtual controller and compile it into a project to be tested; import the project to be tested into the automated testing software; the testing unit 630 is also used to call the executable entity in at least one software component through the automated testing software to perform simulation testing on the system testing task.

[0081] In one embodiment of the present application, the number of virtual controllers is at least one;

[0082] In one embodiment of the present application, the creation unit 610 is also used to create an external communication connection of at least one virtual controller through an environment configuration tool to obtain a virtual test system; the test unit 630 is also used to call an executable entity in at least one software component through the virtual test system to perform simulation testing on the system test task.

[0083] It should be noted that the virtual controller test device provided in the above embodiment and the virtual controller test method provided in the above embodiment belong to the same concept, wherein the specific manner in which each module and unit performs the operation has been described in detail in the method embodiment and will not be repeated here. In practical applications, the virtual controller test device provided in the above embodiment can distribute the above functions to different functional modules as needed, that is, divide the internal structure of the device into different functional modules to complete all or part of the functions described above, and this is not limited here.

[0084] An embodiment of the present application also provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the electronic device implements the virtual controller testing method provided in the above-mentioned embodiments.

[0085] Figure 7The structure diagram of the computer system suitable for implementing the electronic device of the embodiment of the present application is shown. It should be noted that: Figure 7 The computer system 700 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0086] like Figure 7 As shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 702 or the program loaded from the storage part 708 to the random access memory (RAM) 703, such as executing the method described in the above embodiment. In the RAM 703, various programs and data required for system operation are also stored. The CPU 701, the ROM 702 and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0087] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed so that a computer program read therefrom is installed into the storage section 708 as needed.

[0088] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 709, and / or installed from a removable medium 711. When the computer program is executed by a central processing unit (CPU) 701, various functions defined in the system of the present application are executed.

[0089] It should be noted that the computer-readable medium shown in the embodiment of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable computer program is carried. This propagated data signal can take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. A computer program contained on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0090] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0091] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.

[0092] Another aspect of the present application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor of a computer, causes the computer to execute the virtual controller test method as described above. The computer-readable storage medium may be included in the electronic device described in the above embodiment, or may exist independently without being assembled into the electronic device.

[0093] Another aspect of the present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. A processor of a computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the virtual controller test method provided in each of the above embodiments.

[0094] The above embodiments are merely illustrative of the principles and effects of the present application, and are not intended to limit the present application. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed in the present application shall still be covered by the claims of the present application.

Claims

1. A virtual controller testing method, characterized in that: include: Creating a virtual control project in simulation software, wherein the virtual control project includes a carrier of a virtual electronic control unit; Importing the source code of at least one software component and the description file of the at least one software component into the virtual control project to obtain an updated virtual control project; Creating an instance for each software component in the at least one software component, and associating the at least one software component with the corresponding at least one interface through a preset interface relationship table, wherein the preset interface relationship table is included in a description file of the at least one software component; Importing the middleware source code, the interface configuration description file and the description file of the microcontroller abstraction layer into the updated virtual control project to obtain a virtual controller; Associating a system test task according to a description file of the at least one software component through the virtual controller, and calling an executable entity in the at least one software component to perform a simulation test on the system test task; Before the source code of at least one software component and the description file of at least one software component are imported into the virtual control project to obtain the updated virtual control project, the method further includes: adjusting the software engineering code of the real controller so that the software engineering code has hardware independence, obtaining the adjusted software engineering code, the adjusted software engineering code including the remaining part, the simulation software is included in the real controller; completing the remaining part by the microcontroller abstraction layer and the operating system of the microcontroller abstraction layer; The step of importing middleware source code, interface configuration description file and description file of microcontroller abstraction layer into the updated virtual control project to obtain a virtual controller comprises: obtaining the middleware source code, interface configuration description file and description file of microcontroller abstraction layer, wherein the middleware source code is included in the basic software layer, and the source code and description file of at least one software component are included in the application layer; and creating a calling relationship between the application layer and the basic software layer, and a calling relationship between the basic software layer and the microcontroller abstraction layer to obtain the virtual controller.

2. The method according to claim 1, characterized in that The adjustment of the software engineering code of the real controller includes: Stripping the hardware-related code portion from the software engineering code.

3. The method according to claim 1, characterized in that After calling the executable entity in the at least one software component to perform simulation test on the system test task, the method further includes: creating a debug access interface for each of the at least one interface; The at least one interface is observed in conjunction with the calibration file.

4. The method according to claim 1, characterized in that: The calling of the executable entity in the at least one software component to perform simulation test on the system test task includes: Combining the preset test model with the virtual controller and compiling them into a project to be tested; Importing the project to be tested into automated testing software; The automated testing software calls the executable entity in the at least one software component to perform simulation testing on the system testing task.

5. The method according to claim 1, characterized in that The number of the virtual controller is at least one; The calling of the executable entity in the at least one software component to perform simulation test on the system test task includes: By using an environment configuration tool, creating an external communication connection of at least one virtual controller to obtain a virtual test system; The virtual test system calls the executable entity in the at least one software component to perform simulation test on the system test task.

6. A virtual controller testing device, characterized in that: include: A creation unit, used for creating a virtual control project in the simulation software, wherein the virtual control project includes a carrier of a virtual electronic control unit; An import unit, used to import the source code of at least one software component and the description file of at least one software component into the virtual control project to obtain an updated virtual control project; The creation unit is further used to create an instance for each software component in the at least one software component, and associate the at least one software component with the corresponding at least one interface through a preset interface relationship table, wherein the preset interface relationship table is included in the description file of the at least one software component; The import unit is further used to import the middleware source code, the interface configuration description file and the description file of the microcontroller abstraction layer into the updated virtual control project to obtain the virtual controller; A test unit, configured to associate a system test task with a description file of at least one software component through a virtual controller, and call an executable entity in at least one software component to perform a simulation test on the system test task; The processing unit is used to adjust the software engineering code of the real controller so that the software engineering code has hardware independence, obtain the adjusted software engineering code, the adjusted software engineering code includes the remaining part, the simulation software is included in the real controller; the remaining part is completed by the microcontroller abstraction layer and the operating system of the microcontroller abstraction layer; The import unit is specifically used to obtain the middleware source code, interface configuration description file and description file of the microcontroller abstraction layer, wherein the middleware source code is included in the basic software layer, and the source code and description file of the at least one software component are included in the application layer; create a calling relationship between the application layer and the basic software layer, and a calling relationship between the basic software layer and the microcontroller abstraction layer, to obtain the virtual controller.

7. An electronic device, characterized in that: The electronic device comprises: one or more processors; A storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, enables the electronic device to implement the virtual controller testing method as described in any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor of a computer, the computer is caused to execute the virtual controller testing method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Virtual controller simulation test method and system and storage medium

    CN113946405A

  • CPU imitation device and method

    CN1514363A