WO2023082199A1 - 资源分配方法、hil测试设备及相关装置 - Google Patents

资源分配方法、hil测试设备及相关装置 Download PDF

Info

Publication number
WO2023082199A1
WO2023082199A1 PCT/CN2021/130442 CN2021130442W WO2023082199A1 WO 2023082199 A1 WO2023082199 A1 WO 2023082199A1 CN 2021130442 W CN2021130442 W CN 2021130442W WO 2023082199 A1 WO2023082199 A1 WO 2023082199A1
Authority
WO
WIPO (PCT)
Prior art keywords
controlled devices
simulation
processor
functional domain
simulation model
Prior art date
Application number
PCT/CN2021/130442
Other languages
English (en)
French (fr)
Inventor
王庆昕
杨宸
周维
杨辉明
Original Assignee
华为技术有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to CN202180102111.1A priority Critical patent/CN117940925A/zh
Priority to PCT/CN2021/130442 priority patent/WO2023082199A1/zh
Publication of WO2023082199A1 publication Critical patent/WO2023082199A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/20Design optimisation, verification or simulation

Definitions

  • the present invention relates to the technical field of test equipment, in particular to a resource allocation method, HIL test equipment and related devices.
  • HIL hardware-in-the-loop
  • the hardware-in-the-loop (HIL) test uses the simulation model of the processor to run the motor simulator to simulate the running state of the controlled object (or controlled equipment), and conduct comprehensive, Test systematically.
  • HIL testing can reduce the number of real vehicle road tests, shorten development time, and reduce development costs. It has high safety, feasibility and rationality, so it can comprehensively improve the research and development and design level of motor controllers.
  • the electrical/electronic (E/E) architecture of the car changes from decentralized control to domain control, and then to the central control architecture .
  • E/E electrical/electronic
  • the test scope increases from a single component or single domain to the whole vehicle level, the scope of the tested functions is greatly increased, and the corresponding test environment is also more complex. How to make the HIL test equipment meet the current test function requirements and complex test environment is a technical problem urgently needed to be solved by those skilled in the art.
  • Embodiments of the present application provide a resource allocation method, HIL test equipment and related devices, which can improve test efficiency.
  • a resource allocation method provided in the embodiment of the present application includes:
  • N controlled devices receiving control signals from N controlled devices, where N is a positive integer greater than 1, and any one of the N controlled devices includes one or more domain controllers, or includes one or more functional domain, or include one or more components;
  • computing resources on the processor are respectively allocated to the simulation environment corresponding to each of the N controlled devices; wherein, the processor is configured to at least run the A simulation environment, where the simulation environment is used to perform simulation tests according to the computing resources.
  • computing resources on the processor are respectively assigned to the respective simulation environments corresponding to the N controlled devices , may include: according to the computing capability of the processor and the simulation environment corresponding to each of the N controlled devices, respectively allocating computing resources on the processor to the simulation environment corresponding to each of the N controlled devices.
  • the domain controller is at least configured to control objects controlled by the domain controller to perform corresponding operations
  • the functional domain is at least configured to control objects controlled by the functional domain to perform corresponding operations operate.
  • any one of the N controlled devices is the vehicle under test.
  • the simulation environment corresponding to each of the N controlled devices includes a simulation model corresponding to each of the N controlled devices.
  • the simulation environment corresponds to one or more simulation models, or the simulation environment is implemented based on the corresponding one or more simulation models.
  • the processor is configured to run at least the simulation environment, including the processor being configured to run at least a simulation model included in the simulation environment, and the simulation environment is used to perform calculations according to the allocated computing resources. Simulation test.
  • the simulation model is used to perform a simulation test based on the computing resources, which can be understood as: the simulation model is used for a simulation test, and the simulation test is implemented based on the computing resources.
  • control signals from N controlled devices can be received, so that simulation models corresponding to each of the N controlled devices can be determined. Therefore, according to the computing power of the processor and the simulation models corresponding to the N controlled devices, the computing resources on the processor can be allocated to the simulation models corresponding to the N controlled devices, so that the simulation model can be based on the allocated computing resources. Carry out the simulation test and complete the simulation scheduling. Therefore, simulation scheduling can be performed on the simulation models of multiple controlled devices at the same time, so the test efficiency can be improved and the test period can be shortened.
  • the simulation models corresponding to the N controlled devices are respectively assigned
  • the computing resources on the processor include: determining the running time of simulation models corresponding to each of the N controlled devices on the processor; according to the running time of each of the simulation models on the processor, determining A target unit corresponding to a simulation model corresponding to each group of the N controlled devices, the target unit belongs to the processor, and the target unit is configured to provide computing resources for the corresponding simulation model.
  • a unit may include: constructing a first loss function of the N controlled devices according to the running time of each of the simulation models on the processor; determining the N controlled devices according to the first loss function The target units corresponding to the respective simulation models.
  • the loss function is usually associated with the optimization problem as a learning criterion, and the loss function of the running time of the simulation model on the processor is constructed, and then the assignment of the target unit to the simulation model through the loss function can guarantee the allocation result.
  • Reasonability which can improve the test efficiency and shorten the test cycle.
  • the number of simulation models corresponding to any one of the N controlled devices is one or more; according to each of the simulation models in the constructing the first loss function of the N controlled devices according to the running time on the processor, comprising: constructing the first loss function of the first functional domain according to the running time of the simulation model in the first functional domain on the processor Two loss functions, the first functional domain is any one of the at least one functional domain, and any simulation model corresponding to any controlled device belongs to one of the at least one functional domain; according to the The respective second loss functions of the at least one functional domain determine the first loss functions of the N controlled devices.
  • the processor before constructing the second loss function of the first functional domain according to the simulation model in the first functional domain at runtime on the processor, it may further include : determining the at least one functional domain.
  • any simulation model corresponding to any controlled device belongs to one of the multiple functional domains, and the loss functions of the N controlled devices are determined through the respective loss functions corresponding to the multiple functional domains. Fully consider the impact of the functional domain on the controlled equipment to meet the needs of users.
  • the constructing the second loss function of the first functional domain according to the running time of the simulation model in the first functional domain on the processor includes:
  • the running time of the simulation models in the first functional domain of the N controlled devices is accumulated on the processor to form a second loss function of the first functional domain.
  • the running time of the simulation models in the first functional domain of the N controlled devices is accumulated on the processor to form the first Before the second loss function of a functional domain, it may further include: determining simulation models in the first functional domain of the N controlled devices.
  • the determining the first loss functions of the N controlled devices according to the respective second loss functions of the plurality of functional domains includes: determining the at least one function A first weight of each functional domain in the domain; determining the N controlled devices according to the first weight of each functional domain of the plurality of functional domains and the respective second loss functions of the plurality of functional domains The first loss function of .
  • the weight can represent the proportion of the loss function of each functional domain. Therefore, the loss function obtained through the loss function of the functional domain and the weight of the functional domain fully considers the priority of the functional domain and can meet the actual needs of users. .
  • the determining the target unit corresponding to the simulation model corresponding to each of the N controlled devices according to the first loss function includes: determining the first loss function The minimum value of the minimum value; the processor core corresponding to the simulation model corresponding to each of the N controlled devices in the target state is used as the target unit corresponding to the simulation model corresponding to each of the N controlled devices, and the target state is the state of the minimum value of the first loss function.
  • minimizing the loss function can be solved to obtain the result in the state of the minimum value of the loss function, so that the target unit assigned to the simulation model can improve the running speed of the simulation model and shorten the test cycle.
  • the processor is deployed on a local device or a cloud device.
  • the cloud device has more computing resources than the local device, and the user can call the local device or the cloud device according to his own needs, so as to adapt to the needs of different scenarios and ensure the realization of HIL testing flexibility.
  • the embodiment of the present application provides a hardware-in-the-loop testing device, which may include:
  • a communication unit configured to receive control signals from N controlled devices, where N is a positive integer greater than 1, and any one of the N controlled devices includes one or more domain controllers, or one or more functional domains, or one or more components;
  • a processing unit configured to determine a simulation environment corresponding to each of the N controlled devices according to the control signal
  • the processing unit is further configured to allocate computing resources on the processor to the respective simulation environments corresponding to the N controlled devices according to the respective simulation environments corresponding to the N controlled devices; wherein, the The processor is configured at least to run the simulation environment for performing simulation tests according to the computing resources.
  • the processing unit is specifically configured to: according to the computing capability of the processor and the simulation environment corresponding to each of the N controlled devices, provide the N controlled devices The corresponding simulation environments allocate computing resources on the processors respectively.
  • the domain controller is at least configured to control objects controlled by the domain controller to perform corresponding operations
  • the functional domain is at least configured to control objects controlled by the functional domain to perform corresponding operations operate.
  • any one of the N controlled devices is the vehicle under test.
  • the simulation environment corresponding to each of the N controlled devices includes a simulation model corresponding to each of the N controlled devices.
  • the simulation environment corresponds to one or more simulation models, or the simulation environment is implemented based on the corresponding one or more simulation models.
  • the processor is configured to run at least the simulation environment, including the processor being configured to run at least a simulation model included in the simulation environment, and the simulation environment is used to perform calculations according to the allocated computing resources. Simulation test.
  • the simulation model is used to perform a simulation test based on the computing resources, which can be understood as: the simulation model is used for a simulation test, and the simulation test is implemented based on the computing resources.
  • the processing unit is specifically configured to:
  • the target unit According to the running time of each of the simulation models on the processor, determine the target unit corresponding to the simulation model corresponding to each of the N controlled devices, the target unit belongs to the processor, and the target unit The configuration is used to provide computing resources for the corresponding simulation model.
  • the processing unit is specifically configured to: construct the first losses of the N controlled devices according to the running time of each of the simulation models on the processor function; determining the target unit corresponding to the simulation model corresponding to each of the N controlled devices according to the first loss function.
  • the number of simulation models corresponding to any one of the N controlled devices is one or more; the processing unit is specifically configured to:
  • the first functional domain being any one of the at least one functional domain, so Any one of the simulation models corresponding to any one of the controlled devices belongs to one of the at least one functional domain; and the first losses of the N controlled devices are determined according to the respective second loss functions of the at least one functional domain function.
  • the processing unit may be further configured to: determine the at least one functional domain.
  • the processing unit is specifically configured to:
  • the running time of the simulation models in the first functional domain of the N controlled devices is accumulated on the processor to form a second loss function of the first functional domain.
  • the processing unit may be further configured to: determine a simulation model in the first functional domain of the N controlled devices. In a possible implementation manner of the second aspect, the processing unit is specifically configured to:
  • the processing unit is specifically configured to:
  • the processor core corresponding to the simulation model corresponding to each of the N controlled devices in the target state as the core corresponding to the simulation model corresponding to each of the N controlled devices
  • a target unit, the target state is the state of the minimum value of the first loss function.
  • the processor is deployed on a local device or a cloud device.
  • the embodiment of the present application provides a test system
  • the system may include the hardware-in-the-loop test device described in any one of the second aspect, N controlled devices, and the hardware-in-the-loop test through the interface board Device connection, wherein, N is a positive integer greater than 1, and any one of the N controlled devices includes one or more domain controllers, or includes one or more functional domains, or includes one or more parts.
  • an embodiment of the present application provides a computing device, the computing device includes a processor and a communication interface, the communication interface is used to receive and/or send data, and/or, the communication interface is used to provide The processor provides input and/or output.
  • the processor is configured to implement the method described in any one of the first aspect.
  • processor included in the computing device described in the fourth aspect above may be a processor dedicated to executing these methods (referred to as a dedicated processor for easy distinction), or it may be executed by calling a computer program Handlers for these methods, such as general-purpose handlers.
  • processors may also include both a special-purpose processor and a general-purpose processor.
  • the above computer programs may be stored in memory.
  • the memory can be a non-transitory (non-transitory) memory, such as a read-only memory (Read Only Memory, ROM), which can be integrated with the processor on the same device, or can be respectively arranged on different devices , the embodiment of the present application does not limit the type of the memory and the arrangement of the memory and the processor.
  • ROM Read Only Memory
  • the at least one memory is located outside the computing device.
  • the at least one memory is located within the computing device.
  • part of the memory of the at least one memory is located inside the computing device, and another part of the memory is located outside the computing device.
  • processor and the memory may also be integrated into one device, that is, the processor and the memory may also be integrated together.
  • the embodiment of the present application provides a chip system
  • the chip system includes a processor and a communication interface
  • the communication interface is used to receive and/or send data
  • the communication interface is used to provide the Processors provide input and/or output.
  • the chip system is used to implement the method described in any one of the first aspect.
  • an embodiment of the present application provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and when the instructions are run on at least one processor, any one of the aforementioned first aspects is implemented. method described.
  • the present application provides a computer program product, the computer program product includes computer instructions, and when the instructions are run on at least one processor, the method described in any one of the foregoing first aspects is implemented.
  • the computer program product may be a software installation package. If the aforementioned method needs to be used, the computer program product may be downloaded and executed on the computing device.
  • FIG. 1 is a schematic diagram of a central computing architecture provided by an embodiment of the present application.
  • Fig. 2 is a schematic structural diagram of a test system provided by an embodiment of the present application.
  • FIG. 3A is a schematic structural diagram of a local testing system provided by an embodiment of the present application.
  • FIG. 3B is a schematic structural diagram of a local HIL testing device provided in an embodiment of the present application.
  • FIG. 3C is a schematic diagram of the software composition of a local HIL testing device provided in the embodiment of the present application.
  • FIG. 4A is a schematic structural diagram of a cloud testing system provided by an embodiment of the present application.
  • FIG. 4B is a schematic structural diagram of a cloud-based HIL testing device provided in an embodiment of the present application.
  • FIG. 4C is a schematic diagram of the software composition of a cloud HIL testing device provided in the embodiment of the present application.
  • FIG. 5 is a schematic flowchart of a resource allocation method provided by an embodiment of the present application.
  • FIG. 6A is a schematic diagram of allocating computing resources for a simulation model provided by an embodiment of the present application.
  • FIG. 6B is a schematic flow diagram of resource allocation provided by an embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of a hardware-in-the-loop testing device provided by an embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of a computing device provided by an embodiment of the present application.
  • HIL Hardware-In-Loop
  • FIG. 1 is a schematic diagram of a central computing architecture (Central Computing Architecture, CCA) 100 provided by an embodiment of the present application.
  • CCA Central Computing Architecture
  • the cars mentioned in the embodiments of this application include but are not limited to smart cars, new energy cars, or traditional cars.
  • smart cars can include smart driving cars, unmanned cars, etc.
  • New energy vehicles include pure electric vehicles, enhanced electric vehicles, hybrid vehicles, fuel cell electric vehicles, hydrogen engine vehicles, and other new energy vehicles.
  • Traditional vehicles include gasoline vehicles, diesel vehicles, etc., which are not limited in this embodiment of the present application.
  • the central computing architecture 100 may include distributed gateways (such as one or more I/O gateways) and data centers (xData Center, xDC).
  • xDC may include smart cockpit CDC, vehicle control VDC and smart driving MDC.
  • Smart cockpit CDC is used for smart cockpit control; vehicle control VDC is used for vehicle power control; smart driving MDC is used for smart driving control.
  • the distributed gateway can provide access to devices, while connecting to xDC, connecting to vehicle parts, and also connecting to the car box (Telematics BOX, T-box). Therefore, the distributed gateway can be the core component in the vehicle central computing architecture and the data exchange hub of the vehicle network. Distributed gateways and xDCs can run incorporated controller logic. T-box is mainly used to communicate with the exterior of the car, background systems and mobile phone applications.
  • Vehicle components including actuators, which are used to achieve specific functions.
  • the actuator may be, for example, an actuator or a sensor in the vehicle.
  • Vehicle components may also include ECUs.
  • the vehicle parts may include one or more of the following: vehicle parts with partial or complete electronic control functions, and vehicle parts without electronic control functions.
  • the vehicle components that realize the automatic driving function include, for example, one or more of a monocular camera, a binocular camera, millimeter wave radar, a laser radar, and an ultrasonic radar, and may also include other vehicle parts used to realize the automatic driving function. Components are not limited in this embodiment of the application.
  • the vehicle parts that realize the smart cockpit include, for example, one or more of the head-up display, instrument display, radio, navigation, and camera, and may also include other vehicle parts used to realize the smart cockpit, which is not covered in this embodiment of the present application. limited.
  • the vehicle components that realize the control of the whole vehicle include, for example, one or more of the vehicle components used in the body domain and the vehicle components in the chassis domain.
  • the vehicle components in the body domain include, for example, door and window lift controllers, electric rearview mirrors One or more of air conditioners, central door locks, and other vehicle components used in the body area.
  • the vehicle components in the chassis domain include, for example, one or more of vehicle components in the braking system, vehicle components in the steering system, and vehicle components in the acceleration system, such as an accelerator.
  • ECU is located in the interior of auto parts and is composed of one or more of large-scale integrated circuits such as processors, memories, input/output (I/O) interfaces, analog-to-digital converters (A/D), and shaping and driving.
  • electronic control function it can complete various functions.
  • the auto parts can be controlled based on the control information, and for example, data processing can be performed on the data to be transmitted in the auto parts.
  • the above-mentioned electronic control functions mainly include logic control functions and data processing functions.
  • the logic control function includes controlling vehicle components to perform certain operations based on the obtained control information, for example, controlling the action of the wiper based on the control information; another example, controlling the switch state of the door lock based on the control information, etc.
  • the data processing function includes processing the data to be processed in the vehicle components, for example, processing the rain information collected by the sensitive elements of the wiper to determine the working status of the wiper, where the working status includes the working frequency of the wiper or switch status. For another example, data processing is performed on the fingerprint information obtained by the sensitive element of the door lock on the car door to determine the opening and closing status information of the car door.
  • the ECU in the embodiments of the present application refers to the electronic control components located in the vehicle components, which is different from the engine control unit (Engine Control Unit) in the prior art.
  • the engine control unit is located outside the multiple vehicle components in the engine system and is used to control multiple vehicle components in the engine system, which can be regarded as an independent centralized controller.
  • the electronic control unit in the embodiment of the present application that is, ECU refers to an electronic control unit located inside a vehicle component, for example, it may be an electronic control unit inside multiple vehicle components in an engine system.
  • the above-mentioned communication connection can be understood as a wireless connection or a wired connection for information transmission, which is not limited in the embodiment of the present application, wherein the wireless connection can be understood as the communication between the xDC and other units in the vehicle without going through the bus.
  • Communication connection for example, short-distance wireless communication technology can be used, such as Bluetooth (bluetooth) communication technology, wireless fidelity (wireless fidelity, Wi-Fi), near field communication (near field communication, NFC) technology, Wi-Fi Aware technology , general short-distance communication technology, short-distance communication technology standardized by Starlight Alliance, etc.
  • Wired connection can be understood as the communication connection between DC and other units in the vehicle based on bus or Ethernet connection, for example, Controller Area Network (CAN) bus, Local Interconnect Network (LIN) bus can be used , high-speed serial computer expansion bus standard (peripheral component interconnect express, PCI-e), or Ethernet (ethernet) communication technology.
  • CAN Controller Area Network
  • LIN Local Interconnect Network
  • PCI-e peripheral component interconnect express
  • Ethernet Ethernet
  • the existing vehicle-level HIL test equipment can only build a test environment for one car, which cannot meet the requirements of simultaneous testing of multiple cars.
  • FIG. 2 is a schematic structural diagram of a test system 200 provided in an embodiment of the present application.
  • the test system 200 may include an HIL test device 201 and N controlled devices 202 .
  • N is a positive integer greater than 1
  • any one of the N controlled devices contains one or more components, or includes one or more functional domains, or includes one or more domain controllers, or Each controlled device can be considered as a vehicle under test. Any one of the controlled devices between the HIL testing device 201 and the N controlled devices 202 can perform information interaction.
  • the corresponding simulation environment of each of the N controlled devices can be determined according to the corresponding control signals of each controlled device, and then the corresponding simulation environment for each of the N controlled devices can be determined.
  • the simulation environment allocates computing resources on the processors respectively.
  • the simulation environments corresponding to each of the above N controlled devices may correspond to Mi simulation models, or the respective simulation environments corresponding to the N controlled devices are based on their corresponding Mi simulation models (that is, one or more simulation models) Realized, Mi is a positive integer greater than or equal to 1, and Mi can be expressed as the number of simulation models included in the simulation environment corresponding to the i-th controlled device, 1 ⁇ i ⁇ N.
  • the simulation environment is carried in the HIL test equipment, that is, the simulation model can be deployed in the HIL test equipment 201, and the simulation model is used to perform simulation operation according to the allocated computing resources.
  • the simulation model is deployed in the HIL test equipment 201, and the simulation model is used to perform a simulation test or operation, and the simulation test or operation is implemented based on computing resources corresponding to or allocated to the simulation model.
  • the HIL test equipment 201 can be used to simulate the test environment of the whole vehicle, can simulate various simulation signals required by one or more controlled devices, and can collect control signals sent by one or more controlled devices at the same time, and the simulation model can be Update the state according to the control signal to simulate the running state of the controlled equipment. For example, it can simulate various working conditions of the controlled equipment, including extreme conditions; or it can simulate the failure modes faced by the controlled equipment, and so on.
  • One or more controlled devices and the simulation model running in the HIL test device form a closed loop, thereby realizing the hardware-in-the-loop test of one or more controlled devices.
  • the controlled device 202 can implement one or more logic functions of the car.
  • the controlled device 202 may include one or more domain controllers.
  • the domain controller may be an on-board controller or an on-board central processing unit for running logic functions of the car. Therefore, one controlled device 202 can be equivalent to one vehicle under test.
  • the controlled device 202 may specifically be a mirroring device, and the mirroring device is equipped with one or more domain controllers in the car to implement the logic function of a certain functional domain in the car.
  • the controlled device 202 may specifically be a device including one or more electronic control units, and a combination of the above one or more electronic control units may implement a logic function of a certain functional domain of the vehicle.
  • the N controlled devices 202 may be independent entities, or may be integrated together.
  • a control program to be tested is configured in the controlled device 202.
  • the control program to be tested needs a control program verified by HIL simulation test, and the program to be tested can realize at least one software logic function.
  • the test system 200 may also include a host computer and a simulated driver.
  • the host computer can communicate with the HIL test equipment, and the host computer is pre-configured with a result analysis program for analyzing the simulation test running results and a test case queue for generating simulation test instructions carrying simulation model setting parameters.
  • the result analysis program is a pre-set computer program for automatic analysis of the simulation test results obtained by the hardware-in-the-loop simulation test, which helps to improve the efficiency of result analysis and save analysis costs.
  • the test case queue is a preset queue of simulation test instructions used to assist the HIL test equipment in hardware-in-the-loop simulation tests, which helps to improve the efficiency of obtaining simulation test instructions. Therefore, the operation interface of the monitor of the host computer can provide test instructions and visualization. In some cases, one or more of configuration management, test automation, analysis and reporting tasks may also be provided.
  • the simulator driver is used to simulate the driving situation of the car, such as turning and so on.
  • FIG. 3A is a schematic structural diagram of a local testing system 300 provided in an embodiment of the present application.
  • the local test system 300 may include a local HIL test device 301 and N controlled devices 202 . Any one of the controlled devices 202 between the local HIL test device 301 and the N controlled devices 202 can exchange information.
  • the local HIL test device 301 includes one or more computing units 302 , a computing scheduling board 303 and an interface board 304 .
  • the computing unit 302 may specifically be a processor deployed in a local device, and the interface board 304 is respectively connected to N controlled devices 202, and the computing unit 302 in the local HIL test device 301 is scheduled by the computing scheduling board 303 to be N controlled devices.
  • the vehicle corresponding to the control device 202 provides a verification test.
  • FIG. 3B is a schematic structural diagram of a local HIL testing device 301 provided by an embodiment of the present application.
  • the local HIL test equipment 301 may include one or more of the following: an interface board 304 , one or more boards 305 , one or more computing units 302 , a power supply 308 , a memory 309 and the like.
  • the calculation unit 302 may include a device having a calculation function.
  • the calculation unit 302 may include one or more of the following devices: central processing unit (central processing unit, CPU), graphics processing unit (graphics processing unit, GPU), application processor (application processor, AP), time Digital converter (Time-to-Digital Converter, TDC), filter, microprocessor (microprocessor unit, MPU), application specific integrated circuit (Application Specific Integrated Circuit, ASIC), image signal processor (image signal processor, ISP) , digital signal processor (digital signal processor, DSP), field programmable logic gate array (Field Programmable Gate Array, FPGA), complex programmable logic device (Complex programmable logic device, CPLD), coprocessor (assisting central processing unit Complete corresponding processing and application), Microcontroller Unit (Microcontroller Unit, MCU), and/or neural network processor (neural-network processing unit, NPU), etc.
  • CPU central processing unit
  • graphics processing unit graphics processing unit
  • application processor application processor
  • AP application processor
  • TDC time Digital converter
  • filter microprocessor
  • microprocessor unit, MPU microprocessor
  • the interface board includes low-speed input/output (I/O) interfaces such as digital signal (DI/DO) interfaces and analog signal (AD/DA) interfaces.
  • the interface board can also include a control area network (controller area network, CAN) interface, a local area interconnection network (Local Interconnect Network, LIN) interface, and high-speed interfaces such as Ethernet (ethernet, ETH). Therefore, the interface board 304 can support various interface requirements of the vehicle-level controller corresponding to the controlled device 202 .
  • the board 305 is used to convert digital signals to analog signals, so that signals from different controlled devices 202 can be received.
  • the CPU 306 or GPU 307 can be used to run a vehicle-level simulation model. Further, the CPU 306 or GPU 307 in the computing unit 302 can allocate computing resources for the simulation model, so the simulation model can perform simulation operation according to the allocated computing resources, and provide verification tests for the vehicles corresponding to the multiple controlled devices 202 .
  • the simulation model performs simulation operation according to the allocated computing resources, which can be understood as: the simulation model is used for the simulation test, and the simulation test is implemented based on the above-mentioned computing resources.
  • FIG. 3C is a schematic diagram of software composition of a local HIL testing device provided by an embodiment of the present application.
  • the software of the local HIL test equipment consists of a simulation bus 308 and a simulation model 309 .
  • the simulation bus 308 is deployed in the computing scheduling board, and its functions include at least one or more of simulation task scheduling, simulation operation control and simulation data distribution.
  • Simulation task scheduling includes assigning calculation tasks of the simulation model 309 to the calculation unit 302 according to the calculation capability of the calculation unit 302 and the simulation model 309 (eg, the calculation complexity of the simulation model 309 ).
  • Simulation operation control refers to controlling the operation of each simulation model 309 , for example, controlling the operation of each simulation model 309 according to the clock cycle of the computing unit 302 .
  • the simulation task scheduling affects the simulation operation control. Only when the simulation task allocation results are reasonable can the simulation operation control meet the cycle requirements of each simulation model calculation task. For example, assign a simulation model with high complexity to a computing unit with abundant computing resources and require more time to complete the calculation; assign a simulation model with a lower complexity to a computing unit with less computing resources and require less time to complete the calculation. Therefore, when scheduling simulation tasks, it is necessary to comprehensively consider the execution time of simulation model calculations, the execution efficiency of simulation model calculations, and the load balance of computing units.
  • FIG. 4A is a schematic structural diagram of a cloud-based testing system provided by an embodiment of the present application.
  • the cloud test system 400 may include a cloud HIL test device 401 and N controlled devices 202 .
  • the cloud HIL test equipment 401 includes a scheduling board 402 deployed locally, an interface board 403 and one or more computing units 404 deployed in a cloud server.
  • the computing unit 404 may specifically be a processor deployed in a cloud device (such as a cloud server).
  • the N controlled devices 202 shown in FIG. 4A can be integrated together, so that the interface board 405 can be connected with the interface board 403 in the cloud HIL test device 401 .
  • the locally deployed device can exchange information with the computing unit 404 deployed in the cloud server, so the scheduling board 402 can communicate with any one of the one or more computing units 404 in the cloud server, and
  • the calling interface board 403 provides a verification test for the plurality of controlled devices 202 or the vehicles corresponding to the plurality of controlled devices 202 . It can be understood that, because the cloud server has more computing resources, the cloud-based test system 400 shown in FIG. 4A is suitable for the HIL test of a large number of vehicles.
  • FIG. 4B is a schematic diagram of a local device structure of a cloud-based HIL test device 401 provided by an embodiment of the present application.
  • the local device of the cloud HIL testing device 401 may include one or more of the following: an interface board 403 , one or more boards 406 and a communication board 407 .
  • the interface board includes low-speed input/output (input/output, I/O) interfaces such as digital signal (DI/DO) interface and analog signal (AD/DA) interface.
  • I/O input/output
  • the interface board can also include a control area network (controller area network, CAN) interface, a local area interconnection network (Local Interconnect Network, LIN) interface, and high-speed interfaces such as Ethernet (ethernet, ETH). Therefore, the interface board 304 can support various interface requirements of the vehicle-level controller corresponding to the controlled device 202 .
  • the board 305 is used to convert digital signals to analog signals.
  • the communication board 407 may specifically be located in the scheduling board 402 shown in FIG. 4A , and is used for communicating with the cloud server.
  • FIG. 4C is a schematic diagram of the software composition of a cloud HIL testing device provided by the embodiment of the present application.
  • the software part of the cloud-based HIL test equipment can be composed of local software and cloud software.
  • the local software includes a functional part 408 for communication
  • the cloud software includes a simulation model 4010 and a simulation bus 409 .
  • the functional part 408 for communication can be located in the communication board 407 of the cloud HIL test equipment 401 shown in FIG. .
  • the function part 408 for communication can also be used to realize the function of distributing the received cloud data to each board.
  • the simulation bus 409 is at least used to implement one or more of the following functions: simulation task scheduling, simulation operation control, simulation data distribution and remote communication.
  • the simulation task scheduling includes allocating calculation tasks of the simulation model to the calculation units according to the calculation capabilities of the calculation units and the simulation model (eg, the calculation complexity of the simulation model).
  • the simulation operation control includes controlling each simulation model to run at a specified period. It should be noted that the results of simulation task scheduling affect the simulation operation control. Only when the simulation task scheduling or simulation task allocation results are reasonable can the simulation operation control meet the cycle requirements of each simulation model calculation task.
  • the cloud test system 400 moves the construction task of the simulation environment to the cloud server, only keeps the communication unit locally, and transfers one or more controlled
  • the input of the device and the output of the cloud server are connected to the interface board.
  • FIG. 5 is a schematic flow chart of a resource allocation method provided by an embodiment of the present application. This method can be applied to any of the test systems described in FIGS.
  • the HIL test equipment 301 or the cloud HIL test equipment 401) can be used to support the process steps of the method shown in FIG. 5 .
  • the method may include some or all of the following steps.
  • Step S501 receiving control signals from N controlled devices.
  • each of the N controlled devices is configured with a control program to be tested that needs to be tested, and a simulation model that can simulate the working state of the controlled device is configured in the HIL test device, so the controlled device can be simulated through the simulation model work to verify one or more of the following: whether the software logic function of the control program to be tested in the controlled device can be realized, and the realization effect of the software logic function of the control program to be tested in the controlled device, so as to complete the simulation test. Purpose.
  • the HIL test equipment can receive the simulation test instruction carrying the simulation model setting parameters, and use the real-time simulation model to simulate the test situation corresponding to the above setting parameters to obtain The measurement signal output by the simulation model is then sent to the corresponding controlled equipment.
  • the HIL test device needs to receive a corresponding number of simulation test instructions for setting parameters of the simulation model.
  • the above-mentioned simulation test instructions for setting parameters of the simulation model correspond to the simulation models of different controlled devices, that is, which controlled device needs to be tested, and the simulation model setting parameters of which controlled device need to be tested.
  • the simulation test instruction is an instruction for triggering a simulation test, and the simulation model setting parameters are preset data for simulating the working state of the controlled equipment.
  • each controlled device After each controlled device receives the corresponding measurement signal, it can use the corresponding control program to be tested to process the measurement signal to obtain the control signal. It can be understood that the embodiment of the present application can perform simulation tests on multiple controlled devices at the same time, so when the HIL test equipment receives multiple simulation test instructions carrying simulation model setting parameters, the HIL test equipment needs to send multiple The controlled device sends a corresponding measurement signal. Each controlled device can generate a corresponding control signal according to the received measurement signal, and then send it to the HIL test device. Therefore, the HIL test device can receive control signals from N controlled devices.
  • N is a positive integer greater than 1, and any one of the above-mentioned N controlled devices contains one or more components, or contains one or more functional domains, or contains one or more domain controllers, Or each controlled device can be regarded as a vehicle to be tested. It can be understood that the measurement signals received by different controlled devices from the HIL test device may be different, so the control signals received by the HIL test device from the N controlled devices may also be different.
  • the controlled device can also generate control signals in other ways.
  • the controlled device can generate control signals through the function to be tested or the simulation environment or tasks or requirements. The method is not limited.
  • Step S502 determining simulation models corresponding to each of the N controlled devices according to the control signal.
  • the HIL test device may receive control signals from the N controlled devices.
  • the HIL test equipment is equipped with multiple simulation models of the controlled equipment, so the HIL test equipment needs to determine the corresponding simulation model from the simulation models of the multiple controlled equipment according to the control signal of each controlled equipment.
  • the respective simulation models of each controlled device can build a simulation environment, that is, the simulation environment corresponds to one or more simulation models, or the simulation environment is realized based on the corresponding one or more simulation models.
  • Step S503 according to the computing capability of the processor and the simulation models corresponding to the N controlled devices, respectively allocate computing resources on the processor for the simulation models corresponding to the N controlled devices.
  • the control signals may correspond to different simulation environments.
  • the HIL testing device can allocate computing resources on the processor for the simulation environments corresponding to the N controlled devices respectively according to the simulation environments corresponding to the N controlled devices.
  • the HIL test equipment can allocate computing resources on the processor for the corresponding simulation environments of the N controlled devices respectively according to the respective simulation environments of the N controlled devices, which may include :
  • the HIL testing device can allocate computing resources on the processor for the corresponding simulation environments of the N controlled devices respectively according to the computing capability of the processor and the corresponding simulation environments of the N controlled devices.
  • the simulation environment corresponds to one or more simulation models, or the simulation environment is realized based on the corresponding one or more simulation models.
  • the simulation model includes one or more of the following: MCU model, battery management system model, vehicle charger model, electronically controlled braking system model, electronically controlled steering assist system model, and so on. Because the controlled devices may be of different brands or types, the simulation models corresponding to the controlled devices are also different.
  • the simulation model is obtained by modeling a certain domain controller or a certain functional domain of the controlled equipment by modeling. Therefore, when the controlled equipment is different, the complexity of the simulation model obtained by modeling is also different. of. That is, the complexity of MCU models of different controlled devices may be different.
  • the complexity of the simulation model can be understood as the mathematical equations used when modeling the simulation model, the mathematical equations used are more complex, it can be considered that the complexity of the simulation model is higher; the mathematical equations used are more complex Simple, it can be considered that the complexity of the simulation model is low.
  • the simulation model is carried in the processor of the HIL test equipment. Further, in an optional design, the HIL test equipment can be based on the computing power of the processor and the complexity of the simulation model corresponding to each of the N controlled devices. Allocate computing resources on the processor for the respective simulation models corresponding to the N controlled devices, so as to obtain simulation test running results corresponding to the N controlled devices.
  • the complexity may include one or more of time complexity and space complexity. Time complexity includes the time consumed to run the current model, and space complexity includes the memory space required to run the current model.
  • the HIL test equipment can determine the running time of the simulation models corresponding to the N controlled devices on the processor or the required memory space according to the complexity of the simulation models corresponding to the N controlled devices. Therefore, the HIL test equipment can determine the simulation models corresponding to the above-mentioned N controlled devices or the simulation environments corresponding to the above-mentioned N controlled devices according to the memory space that each simulation model will or needs to occupy when running on the processor. the corresponding target unit.
  • the target units belong to the above-mentioned processors, and the target units are at least configured to provide computing resources for the corresponding simulation models, so that the simulation models can perform simulation tests on the respective corresponding target units.
  • the target unit may be a processor core on a processor.
  • a target unit corresponding to a simulation model corresponding to each of the N controlled devices may be determined through a loss function.
  • the loss function is to map the running time of the simulation model or the value of other variables related to it (such as the occupied memory space) to a non-negative real number to represent the "risk" or "loss" of the simulation model. ” function, which solves and evaluates the model by minimizing the loss function. Therefore, the HIL test equipment can construct the first loss function of the N controlled devices according to the running time of each simulation model on the processor or the memory space that needs to be occupied, and then determine the N controlled devices according to the first loss function.
  • the car with the central computing architecture may include a distributed gateway (such as Said one or more I/O gateways) and data centers (xData Center, xDC), xDC can include smart cockpit CDC, vehicle control VDC and smart driving MDC.
  • xDC can include smart cockpit CDC, vehicle control VDC and smart driving MDC.
  • vehicle components for realizing the intelligent driving function, vehicle components for realizing the intelligent cockpit, and vehicle components for realizing the control of the whole vehicle.
  • the simulation model may specifically be the simulation model corresponding to the above domain controller or functional domain or component, the number of simulation models corresponding to any one controlled device may be one or more.
  • the simulation models can be divided into corresponding functional domains, so that at least one functional domain can be determined.
  • Functional domains can include body domains, powertrain domains, chassis domains, and so on.
  • each functional domain can correspond to a data center.
  • parts in the body domain can correspond to parts in the smart cockpit
  • parts in the power domain can correspond to parts in smart driving
  • parts in the chassis domain The components in can correspond to the components in the vehicle control. That is, any simulation model corresponding to any controlled device belongs to one functional domain in one or more functional domains, or one data center in one or more data centers.
  • the simulation models corresponding to the N controlled devices may belong to different functional domains, it is necessary to divide the simulation models corresponding to the N controlled devices into the corresponding functional domains, so that multiple a functional domain. Then, the HIL test equipment can construct the second loss function of the first functional domain according to the running time of the simulation model in the first functional domain on the processor, where the first functional domain is any one of the multiple functional domains.
  • the simulation model in the first functional domain refers to the simulation model corresponding to the first functional domain, or the simulation model summarized in the first functional domain, and the simulation model in the first functional domain may include one or more simulation models.
  • the HIL test equipment can accumulate the running time of the simulation models in the first functional domain of the N controlled devices on the processor, so as to obtain the first functional domain (which can be understood as at least one of the functional domains contained in The second loss function of any functional domain).
  • the HIL testing device may determine the first loss functions of the N controlled devices according to the respective second loss functions of the at least one functional domain.
  • the respective second loss functions of at least one functional domain may be understood as the respective second loss functions of each functional domain in the at least one functional domain.
  • the priorities of different functional domains may be different, for example, the priority of the power domain and the chassis domain may be higher than that of the body domain. That is, when allocating resources to the respective simulation environments or simulation models contained in the simulation environments corresponding to the N controlled devices, it is necessary to consider the functional domain to which each simulation environment or the simulation models contained in each simulation environment belongs. Therefore, the HIL test equipment needs to determine the first weight of each functional domain in at least one functional domain, and then according to the first weight of each functional domain of at least one functional domain and the respective second loss functions of at least one functional domain, to A first loss function corresponding to the N controlled devices is determined.
  • the first weight may be 0.5
  • the first weight of the chassis domain may be 0.3
  • the first weight of the body domain may be 0.2.
  • the HIL testing device determines the simulation environment corresponding to each of the N controlled devices or the target unit corresponding to the simulation model included in the simulation environment through the first loss function, the priority of the functional domain may be considered.
  • the second loss function and the first weight mentioned in the embodiment of the present application may be embodied in the process of constructing the first loss function in the form of static features instead of actions.
  • the second loss function and the first weight may be embodied in the first loss function.
  • the HIL test device can determine the minimum value of the first loss function for the N controlled devices
  • the simulation environments corresponding to the controlled devices or the simulation models included in the simulation environments are assigned corresponding target units. That is, the HIL test equipment can first determine the minimum value of the first loss function, and then use the simulation environment corresponding to each of the N controlled devices in the target state or the processor core corresponding to the simulation model contained in the simulation environment as N
  • Each controlled device corresponds to the simulation environment or the target unit corresponding to the simulation model contained in the simulation environment.
  • the target state is the state of the minimum value of the first loss function.
  • the HIL test equipment can allocate appropriate processor cores to the simulation environment or the simulation models included in the simulation environment according to the complexity of each simulation model, thereby improving test efficiency.
  • the simulation model is used for the simulation test, and the simulation test is implemented based on computing resources of the processor core.
  • the processor core can be regarded as a core chip among the processors, which is used to complete calculations, receive/store commands, process data, and so on.
  • different controlled devices may correspond to the same functional domain, or may correspond to different functional domains, where different controlled devices correspond to different functional domains, and may include at least There is one functional domain that is different.
  • the simulation models may be considered to be different if the functional domains corresponding to the simulation models and/or the simulation parameters in the simulation models are different.
  • the priority mentioned in this embodiment of the present application is not limited to the functional domain, and may also be the priority of the controlled device, or the priority of the domain controller or functional domain included in the controlled device, and so on.
  • FIG. 6A is a schematic diagram of allocating computing resources for a simulation model according to an embodiment of the present application.
  • the simulation model carried in the HIL test equipment includes the simulation model corresponding to the domain controller (or functional domain) of each controlled device.
  • the domain controllers in each controlled device may include one or more of the body domain controllers, power domain controllers and chassis domain controllers.
  • Fig. 6A takes the controlled device 3 as an example, but the domain controllers in other controlled devices (such as the controlled device 1, the controlled device 2, etc.) may also include the vehicle body domain controller, the power domain controller and One or more of the chassis domain controllers. Based on FIG.
  • each controlled device includes one or more of the body domain, power domain, and chassis domain. It can be understood that the controlled device may also include other functional domains than the above-mentioned functional domains, or include other domain controllers except the above-mentioned domain controllers, which is not limited in this embodiment of the present application.
  • each controlled device can be regarded as a large computing task, such as Controlled device 1 , controlled device 2 , controlled device 3 , . . . , controlled device N. That is, all the simulation environments corresponding to each controlled device or the simulation models contained in the simulation environments are regarded as a large computing task.
  • the computing tasks corresponding to each controlled device can be subdivided into computing tasks in the body domain, power domain, and chassis domain according to the division of functional domains. And, according to different controlled devices, the number of domains is k i , 1 ⁇ i ⁇ N. Among them, i represents the controlled device.
  • the calculation tasks of each functional domain can be further divided.
  • the simulation environment corresponding to the tested functional domain includes one or more components, and the calculation tasks of each functional domain can be based on the one or more components Split computing tasks, or, for example, according to different objects controlled by the functional domains, the computing tasks of each functional domain may continue to be split.
  • computing tasks in the power domain can be split into computing tasks corresponding to the Microcontroller Unit (MCU), computing tasks corresponding to the battery management system (BMS), and on-board chargers (OBC). ) corresponding computing tasks, and so on. Therefore, according to different controlled devices, the number of computing tasks that each functional domain continues to be split is h j , 1 ⁇ j ⁇ ki .
  • the simulation model corresponding to the calculation tasks in the HIL test equipment that each of the above-mentioned functional domains continue to be split can be used as the smallest calculation unit, so that the calculation tasks can be expressed as ⁇ i,j,l , 1 ⁇ l ⁇ h j .
  • the mathematical problem of allocating resources can be expressed as min ⁇ E ⁇ , for example, e i, j, l, f represents the execution time of the computing task ⁇ i, j, l on the processor core p f .
  • the simulation environment corresponding to the lth computing task corresponding to the j domain of all controlled devices or the computing task of the simulation model contained in the simulation environment can be
  • the computing task of the j domain of N controlled devices can be
  • the second loss function of domain j can be determined as:
  • domain j represents any functional domain in at least one functional domain.
  • the priorities of different functional domains are different. For example, the priority of the power domain and chassis domain is higher than that of the body domain. Therefore, next, assign the first weight w j to the computing tasks in domain j, and the first weights corresponding to all functional domains in at least one functional domain satisfy the following relationship:
  • K represents the number of functional domains to be assigned weights or the number of all functional domains in at least one functional domain.
  • Finding the minimum value of the first loss function can obtain the optimal allocation result of the simulation environment corresponding to each of the N controlled devices or the simulation model contained in the simulation environment, that is, the computing resources of the target unit on the processor.
  • the simulation model is used for the simulation test, and the simulation test is implemented based on computing resources.
  • FIG. 6B is a schematic flowchart of resource allocation provided by an embodiment of the present application. It can be seen from FIG. 6B that after the HIL test equipment determines the simulation environments corresponding to the N controlled devices or the simulation models contained in the simulation environments according to the control signal, the HIL test equipment can initialize each simulation environment or the simulation models contained in the simulation environments. The relevant parameters of the model are used to calculate the available performance of each processing node in the HIL test equipment, such as the computing resources available in each processor core of the processor. According to the method shown in Fig. 5 or Fig.
  • target units assign target units to the simulation environments corresponding to the N controlled devices or the simulation models included in the simulation environments, wherein the target units can be based on the computing power of the processor and the N controlled devices. It is determined by the simulation environment corresponding to each device or the simulation model included in the simulation environment. Then, if there are already allocated computing tasks on the target unit, delete the simulation environment that has been allocated and processed on the target unit or the calculation tasks of the simulation model contained in the simulation environment, and replace the newly determined simulation environment or simulation The calculation tasks of the simulation model included in the environment are assigned to the corresponding target units. When the simulation model of each controlled device is allocated to the corresponding target unit, it can be considered that the calculation task is allocated.
  • the simulation model is used for the simulation test, and the simulation test is realized based on the computing resources provided by the target unit.
  • the devices provided in the embodiments of the present application include corresponding hardware structures, software modules, or combinations of hardware structures and software structures for performing various functions.
  • the embodiments of the present application can be implemented in the form of hardware or a combination of hardware and computer software in combination with the example units and algorithm steps described in the embodiments disclosed herein. Whether a certain function is executed by hardware or computer software drives hardware depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different device implementations in different usage scenarios to implement the aforementioned method embodiments, and different implementations of devices should not be considered beyond the scope of the embodiments of the present application.
  • the device may be divided into functional modules.
  • each functional module may be divided corresponding to each function, or two or more functions may be integrated into one functional module.
  • the above-mentioned integrated modules can be implemented in the form of hardware or in the form of software function modules. It should be noted that the division of modules in the embodiment of the present application is schematic, and is only a logical function division, and there may be other division methods in actual implementation.
  • FIG. 7 is a schematic structural diagram of a hardware-in-the-loop testing device 700 provided in an embodiment of the present application.
  • the hardware-in-the-loop testing device 700 may be a computing device, or a device in the computing device, such as a chip, a software module, an integrated circuit, and the like.
  • the hardware-in-the-loop testing device 700 is used to implement the aforementioned resource configuration method, such as the method shown in FIG. 5 .
  • the hardware-in-the-loop testing device 700 may include a communication unit 701 and a processing unit 702 .
  • the communication unit 701 receives control signals from N controlled devices, where N is a positive integer greater than 1, and any controlled device in the N controlled devices includes one or more domain controller, or one or more functional domains, or one or more components;
  • the processing unit 702 determines the simulation environment corresponding to each of the N controlled devices according to the control signal
  • the processing unit 702 allocates computing resources on the processor for the simulated marriage leave corresponding to each of the N controlled devices according to the simulation environment corresponding to each of the N controlled devices; wherein, the processor is configured to at least run the A simulation environment, where the simulation environment is used to perform simulation tests according to the computing resources.
  • the processing unit 702 is specifically configured to: according to the computing capability of the processor and the simulation environment corresponding to each of the N controlled devices, provide the simulation environment corresponding to each of the N controlled devices The simulation environment allocates computing resources on the processors respectively.
  • the domain controller is at least configured to control objects controlled by the domain controller to perform corresponding operations
  • the functional domain is at least configured to control objects controlled by the functional domain to perform corresponding operations operate.
  • any one of the N controlled devices is the vehicle under test.
  • the simulation environment corresponding to each of the N controlled devices includes a simulation model corresponding to each of the N controlled devices.
  • the simulation environment corresponds to one or more simulation models, or the simulation environment is implemented based on the corresponding one or more simulation models.
  • the processor is configured to run at least the simulation environment, including the processor being configured to run at least a simulation model included in the simulation environment, and the simulation environment is used to perform calculations according to the allocated computing resources. Simulation test.
  • the simulation model is used to perform a simulation test based on the computing resources, which can be understood as: the simulation model is used for a simulation test, and the simulation test is implemented based on the computing resources.
  • processing unit 702 is specifically configured to:
  • the target unit According to the running time of each simulation model on the processor, determine the target unit corresponding to the simulation model corresponding to each of the N controlled devices, the target unit belongs to the processor, and the target unit is configured to provide computing resources for the corresponding simulation model .
  • processing unit 702 is specifically configured to:
  • the number of simulation models corresponding to any one of the N controlled devices is one or more; the processing unit 702 is specifically used for:
  • the first functional domain is any one of at least one functional domain, and any one corresponding to any controlled device the simulation model belongs to one of the at least one functional domain;
  • the first loss functions of the N controlled devices are determined according to the respective second loss functions of at least one functional domain.
  • the processing unit 702 may be further configured to: determine the at least one functional domain.
  • processing unit 702 is specifically configured to:
  • the running time of the simulation models in the first functional domain of the N controlled devices on the processor is accumulated to form a second loss function of the first functional domain.
  • processing unit 702 may also be used to:
  • a simulation model in the first functional domain of the N controlled devices is determined.
  • processing unit 702 is specifically configured to:
  • the first loss functions of the N controlled devices are determined according to the first weight of each functional domain of the at least one functional domain and the respective second loss functions of the at least one functional domain.
  • processing unit 702 is specifically configured to:
  • the processor core corresponding to the simulation model corresponding to each of the N controlled devices in the target state is used as the target unit corresponding to the simulation model corresponding to each of the N controlled devices, and the target state is the state of the minimum value of the first loss function .
  • the processor is deployed on a local device or a cloud device.
  • FIG. 8 is a schematic structural diagram of a computing device 800 provided by an embodiment of the present application.
  • the computing device 800 may be an independent device (such as one or more of a server, or a terminal device, etc.), or may be It is an internal component of an independent device (such as a chip, a software module or a hardware module, etc.).
  • the computing device 800 may include at least one processor 801 .
  • at least one memory 803 may also be included.
  • the computing device 800 may further include a communication interface 802 .
  • a bus 804 may also be included, wherein the processor 801 , the communication interface 802 and the memory 803 are connected through the bus 804 .
  • the processor 801 is a module for performing arithmetic operations and/or logic operations, specifically, a central processing unit (central processing unit, CPU), a picture processing unit (graphics processing unit, GPU), a microprocessor (microprocessor unit, MPU) ), Application Specific Integrated Circuit (ASIC), Field Programmable Logic Gate Array (Field Programmable Gate Array, FPGA), Complex Programmable Logic Device (Complex programmable logic device, CPLD), coprocessor (assisting central processing One or more combinations of processing modules such as processors to complete corresponding processing and applications), Microcontroller Unit (MCU) and other processing modules.
  • a central processing unit central processing unit, CPU
  • a picture processing unit graphics processing unit, GPU
  • microprocessor microprocessor unit, MPU
  • ASIC Application Specific Integrated Circuit
  • FPGA Field Programmable Gate Array
  • FPGA Field Programmable Gate Array
  • CPLD Complex Programmable Logic Device
  • coprocessor assisting central processing
  • MCU Microcontroller Unit
  • Communication interface 802 may be used to provide information input or output to at least one processor. And/or, the communication interface 802 can be used to receive data sent from the outside and/or send data to the outside, and can be a wired link interface such as an Ethernet cable, or a wireless link (Wi-Fi, Bluetooth, General wireless transmission, vehicle short-range communication technology and other short-range wireless communication technologies, etc.) interface. Optionally, the communication interface 802 may further include a transmitter (such as a radio frequency transmitter, an antenna, etc.) or a receiver coupled with the interface.
  • a transmitter such as a radio frequency transmitter, an antenna, etc.
  • the memory 803 is used to provide a storage space, in which data such as operating systems and computer programs can be stored.
  • Memory 803 can be random access memory (random access memory, RAM), read-only memory (read-only memory, ROM), erasable programmable read-only memory (erasable programmable read only memory, EPROM), or portable read-only memory One or more combinations of memory (compact disc read-only memory, CD-ROM), etc.
  • At least one processor 801 in the computing device 800 is configured to execute the foregoing resource allocation method, for example, the resource allocation method described in the embodiment shown in FIG. 5 .
  • the processor 801 may be a processor dedicated to executing these methods (referred to as a dedicated processor for convenience), or a processor that executes these methods by invoking computer programs, such as a general-purpose processor.
  • at least one processor may also include both a special-purpose processor and a general-purpose processor.
  • the above computer programs may be stored in the memory 803 .
  • At least one processor 801 in the computing device 800 is configured to execute calling computer instructions to perform the following operations:
  • Control signals from N controlled devices are received through the communication interface 802, where N is a positive integer greater than 1, and any controlled device in the N controlled devices includes one or more domain controllers, or one or more a functional domain, or one or more components;
  • computing resources on the processor are respectively allocated to the simulation environment corresponding to each of the N controlled devices; wherein, the processor is configured to at least run the simulation environment, so The simulation environment is used for performing simulation tests according to the computing resources.
  • the processor 801 is specifically configured to: according to the computing capability of the processor and the simulation environment corresponding to each of the N controlled devices, provide the simulation environment corresponding to each of the N controlled devices The simulation environment allocates computing resources on the processors separately.
  • the domain controller is at least configured to control objects controlled by the domain controller to perform corresponding operations
  • the functional domain is at least configured to control objects controlled by the functional domain to perform corresponding operations.
  • any one of the N controlled devices is the vehicle under test.
  • the simulation environment corresponding to each of the N controlled devices includes a simulation model corresponding to each of the N controlled devices.
  • the simulation environment corresponds to one or more simulation models, or the simulation environment is implemented based on the corresponding one or more simulation models.
  • the processor is configured to run at least the simulation environment, including the processor being configured to run at least a simulation model included in the simulation environment, and the simulation environment is used to perform calculations according to the allocated computing resources. Simulation test.
  • the simulation model is used to perform a simulation test based on the computing resources, which can be understood as: the simulation model is used for a simulation test, and the simulation test is implemented based on the computing resources.
  • the processor 801 is specifically configured to:
  • the target unit belongs to the processor, and the target unit is configured to provide computing resources for the corresponding simulation model.
  • the processor 801 is specifically configured to: construct the first loss function of the N controlled devices according to the running time of each of the simulation models on the processor; The first loss function determines the target unit corresponding to the simulation model corresponding to each of the N controlled devices.
  • the number of simulation models corresponding to any one of the N controlled devices is one or more; the processor 801 is specifically used for:
  • the first functional domain is any one of at least one functional domain, and any one corresponding to any controlled device
  • the simulation model belongs to one functional domain in the at least one functional domain; and the first loss function of the N controlled devices is determined according to the respective second loss functions of the at least one functional domain.
  • the processor 801 may be further configured to: determine the at least one functional domain.
  • the processor 801 is specifically configured to:
  • the running time of the simulation models in the first functional domain of the N controlled devices on the processor is accumulated to form a second loss function of the first functional domain.
  • the processor 801 may be further configured to: determine a simulation model in the first functional domain of the N controlled devices.
  • the processor 801 is specifically configured to:
  • the first loss functions of the N controlled devices are determined according to the first weight of each functional domain of the at least one functional domain and the respective second loss functions of the at least one functional domain.
  • the processor 801 is specifically configured to:
  • the processor core corresponding to the simulation model corresponding to each of the N controlled devices in the target state is used as the target unit corresponding to the simulation model corresponding to each of the N controlled devices, and the target state is the state of the minimum value of the first loss function .
  • the processor is deployed on a local device or a cloud device.
  • the present application also provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and when the instructions are run on at least one processor, the aforementioned resource allocation method is implemented, for example, as shown in FIG. 5 resource allocation method shown.
  • the present application also provides a computer program product, which includes computer instructions, and when executed by a computing device, implements the aforementioned resource allocation method, for example, the resource allocation method shown in FIG. 5 .
  • words such as “exemplary” or “for example” are used as examples, illustrations or descriptions. Any embodiment or design described herein as “exemplary” or “for example” is not to be construed as preferred or advantageous over other embodiments or designs. Rather, the use of words such as “exemplary” or “such as” is intended to present related concepts in a concrete manner.
  • At least one refers to one or more, and the “multiple” refers to two or more.
  • At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items.
  • at least one item (piece) of a, b, or c may represent: a, b, c, (a and b), (a and c), (b and c), or (a and b and c), where a, b, c can be single or multiple.
  • first and second use ordinal numerals such as "first" and “second” to distinguish multiple objects, and are not used to limit the order, timing, priority or importance of multiple objects degree.
  • first user equipment and the second user equipment are only for the convenience of description, and do not represent the differences in structure, importance, etc. between the first user equipment and the second user equipment.
  • the first user equipment The device and the second user device may also be the same device.
  • the program can be stored in a computer-readable storage medium.
  • the above-mentioned The storage medium mentioned may be a read-only memory, a magnetic disk or an optical disk, and the like.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Evolutionary Computation (AREA)
  • Geometry (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

本申请实施例提供了一种资源分配方法、HIL测试设备及相关装置,该方法可以包括:接收来自N个受控设备的控制信号,其中,N为大于1的正整数,N个受控设备中的任意一个受控设备包含一个或多个域控制器;根据控制信号确定N个受控设备各自对应的仿真模型;根据处理器的计算能力和N个受控设备各自对应的仿真模型,为N个受控设备各自对应的仿真模型分别分配处理器上的计算资源;其中,仿真模型用于根据计算资源进行仿真测试。通过本申请实施例可以同时对多个受控设备进行仿真测试,提高测试效率。

Description

资源分配方法、HIL测试设备及相关装置 技术领域
本发明涉及测试装备技术领域,尤其涉及一种资源分配方法、HIL测试设备及相关装置。
背景技术
硬件在环(hardware-in-the-loop,HIL)测试是以处理器运行电机模拟器的仿真模型来模拟受控对象(或者受控设备)的运行状态,对被测控制器进行全方面、系统地测试。HIL测试可以减少实车路试的次数、缩短开发时间、降低开发成本,具有较高的安全性、可行性和合理性,从而能够全面提升电机控制器的研发和设计水平。
当受控对象(或者受控设备)为汽车时,随着汽车电子电控技术的发展,汽车的电子电气(Electrical/Electronic,E/E)架构从分散控制走向域控制,再到中央控制架构。当测试范围由单部件或者单域上升到整车级,所测试的功能范围大大增加,对应的测试环境也更加复杂。如何使得HIL测试设备满足当前的测试功能需求和复杂的测试环境,是本领域技术人员目前亟需解决的技术问题。
发明内容
本申请实施例提供了资源分配方法、HIL测试设备及相关装置,能够提高测试效率。
第一方面,本申请实施例提供的一种资源分配方法,包括:
接收来自N个受控设备的控制信号,其中,N为大于1的正整数,所述N个受控设备中的任意一个受控设备包含一个或多个域控制器,或者包括一个或多个功能域,或者包括一个或多个零部件;
根据所述控制信号确定所述N个受控设备各自对应的仿真环境;
根据所述N个受控设备各自对应的仿真环境,为所述N个受控设备各自对应的仿真环境分别分配处理器上的计算资源;其中,所述处理器被配置至少用于运行所述仿真环境,所述仿真环境用于根据所述计算资源进行仿真测试。
在第一方面的一种可能的实施方式中,所述根据所述N个受控设备各自对应的仿真环境,为所述N个受控设备各自对应的仿真环境分别分配处理器上的计算资源,可以包括:根据所述处理器的计算能力和所述N个受控设备各自对应的仿真环境,为所述N个受控设备各自对应的仿真环境分别分配处理器上的计算资源。
示例性地,所述域控制器至少被配置用于控制受控于该域控制器的对象执行相应的操作,所述功能域至少被配置用于控制受控于该功能域的对象执行相应的操作。
示例性地,N个受控设备中的任意一个受控设备为被测车辆。
示例性地,所述N个受控设备各自对应的仿真环境包括所述N个受控设备各自对应的仿真模型。所述仿真环境对应一个或多个仿真模型,或者所述仿真环境是基于其所对应的一个或多个仿真模型实现的。所述处理器被配置至少用于运行所述仿真环境,包括所述处理器被配置至少用于运行所述仿真环境包括的仿真模型,所述仿真环境用于根据被分配的所述计算 资源进行仿真测试。在本申请实施例中,所述仿真模型用于根据所述计算资源进行仿真测试,可以理解为:所述仿真模型用于仿真测试,所述仿真测试基于所述计算资源实现。
通过本申请实施例,可以接收来自N个受控设备的控制信号,从而可以确定N个受控设备各自对应的仿真模型。因此,可以根据处理器的计算能力和N个受控设备各自对应的仿真模型,为N个受控设备各自对应的仿真模型分配处理器上的计算资源,使得仿真模型可以根据所分配的计算资源进行仿真测试,完成仿真调度。因此,可以同时对多个受控设备的仿真模型进行仿真调度,所以可以提高测试效率,缩短测试周期。
在第一方面的一种可能的实施方式中,所述根据处理器的计算能力和所述N个受控设备各自对应的仿真模型,为所述N个受控设备各自对应的仿真模型分别分配所述处理器上的计算资源,包括:确定N个受控设备各自对应的仿真模型在所述处理器上的运行时间;根据每一个所述仿真模型在所述处理器上的运行时间,确定所述N个受控设备各组对应的仿真模型所对应的目标单元,所述目标单元属于所述处理器,所述目标单元配置用于为所对应的仿真模型提供计算资源。
在第一方面的一种可能的实施方式中,所述根据每一个所述仿真模型在所述处理器上的运行时间,确定所述N个受控设备各组对应的仿真模型所对应的目标单元,可以包括:根据每一个所述仿真模型在所述处理器上的运行时间构建所述N个受控设备的第一损失函数;根据所述第一损失函数确定所述N个受控设备各自对应的仿真模型所对应的目标单元。
在本申请实施例中,损失函数通常作为学习准则与优化问题相联系,构造仿真模型在处理器上的运行时间的损失函数,然后在通过损失函数为仿真模型来分配目标单元可以保证分配结果的合理性,从而可以提高测试效率,缩短测试周期。
在第一方面的一种可能的实施方式中,所述N个受控设备中的任意一个受控设备对应的仿真模型的数量为一个或多个;所述根据每一个所述仿真模型在所述处理器上的运行时间构建所述N个受控设备的第一损失函数,包括:根据第一功能域中的仿真模型在所述处理器上的运行时间构建所述第一功能域的第二损失函数,所述第一功能域为所述至少一个功能域中的任意一个,所述任意一个受控设备对应的任意一个仿真模型属于所述至少一个功能域中的一个功能域;根据所述至少一个功能域各自的第二损失函数确定所述N个受控设备的第一损失函数。
在第一方面的一种可能的实施方式中,所述根据第一功能域中的仿真模型在所述处理器上的运行时间构建所述第一功能域的第二损失函数之前,还可以包括:确定所述至少一个功能域。
可以看出,任意一个受控设备对应的任意一个仿真模型属于所述多个功能域中的一个功能域,通过多个功能域各自对应的损失函数来确定N个受控设备的损失函数,可以充分考虑功能域对受控设备的影响,满足用户的需求。
在第一方面的一种可能的实施方式中,所述根据第一功能域中的仿真模型在所述处理器上的运行时间构建所述第一功能域的第二损失函数,包括:
将所述N个受控设备的所述第一功能域中的仿真模型在所述处理器上的运行时间累加起来,构成所述第一功能域的第二损失函数。
在第一方面的一种可能的实施方式中,所述将所述N个受控设备的所述第一功能域中的仿真模型在所述处理器上的运行时间累加起来,构成所述第一功能域的第二损失函数之前,还可以包括:确定所述N个受控设备的所述第一功能域中的仿真模型。
在第一方面的一种可能的实施方式中,所述根据所述多个功能域各自的第二损失函数确 定所述N个受控设备的第一损失函数,包括:确定所述至少一个功能域中的每个功能域的第一权重;根据所述多个功能域的每个功能域的第一权重和所述多个功能域各自的第二损失函数,确定所述N个受控设备的第一损失函数。
可以看出,权重可以表示各个功能域的损失函数所占得比重,因此,通过功能域的损失函数以及功能域的权重所得到的损失函数充分考虑了功能域优先级,可以满足用户的实际需求。
在第一方面的一种可能的实施方式中,所述根据所述第一损失函数确定所述N个受控设备各自对应的仿真模型所对应的目标单元,包括:确定所述第一损失函数的最小值;将目标状态下的所述N个受控设备各自对应的仿真模型所对应的处理器核,作为所述N个受控设备各自对应的仿真模型对应的目标单元,所述目标状态为所述第一损失函数的最小值的状态。
可以看出,最小化损失函数可以求解得到损失函数的最小值状态下的结果,从而为仿真模型所分配的目标单元可以提高仿真模型的运行速度,缩短测试周期。
在第一方面的一种可能的实施方式中,所述处理器部署在本地设备或者云端设备。
在本申请实施例中,云端设备相较于本地设备而言拥有更多的计算资源,用户可以根据自己的需求去调用本地设备或者云端设备,从而可以适应不同的场景需求,保证了HIL测试实现的灵活性。
第二方面,本申请实施例提供了一种硬件在环测试设备,该设备可以包括:
通信单元,用于接收来自N个受控设备的控制信号,其中,N为大于1的正整数,所述N个受控设备中的任意一个受控设备包含一个或多个域控制器,或者一个或多个功能域,或者一个或多个零部件;
处理单元,用于根据所述控制信号确定所述N个受控设备各自对应的仿真环境;
所述处理单元,还用于根据所述N个受控设备各自对应的仿真环境,为所述N个受控设备各自对应的仿真环境分别分配所述处理器上的计算资源;其中,所述处理器被配置至少用于运行所述仿真环境,所述仿真环境用于根据所述计算资源进行仿真测试。
在第二方面的一种可能的实施方式中,处理单元,具体用于:根据所述处理器的计算能力和所述N个受控设备各自对应的仿真环境,为所述N个受控设备各自对应的仿真环境分别分配处理器上的计算资源。
示例性地,所述域控制器至少被配置用于控制受控于该域控制器的对象执行相应的操作,所述功能域至少被配置用于控制受控于该功能域的对象执行相应的操作。
示例性地,N个受控设备中的任意一个受控设备为被测车辆。
示例性地,所述N个受控设备各自对应的仿真环境包括所述N个受控设备各自对应的仿真模型。所述仿真环境对应一个或多个仿真模型,或者所述仿真环境是基于其所对应的一个或多个仿真模型实现的。所述处理器被配置至少用于运行所述仿真环境,包括所述处理器被配置至少用于运行所述仿真环境包括的仿真模型,所述仿真环境用于根据被分配的所述计算资源进行仿真测试。在本申请实施例中,所述仿真模型用于根据所述计算资源进行仿真测试,可以理解为:所述仿真模型用于仿真测试,所述仿真测试基于所述计算资源实现。
在第二方面的一种可能的实施方式中,所述处理单元,具体用于:
确定所述N个受控设备各自对应的仿真模型在所述处理器上的运行时间;
根据每一个所述仿真模型在所述处理器上的运行时间,确定所述N个受控设备各自对应 的仿真模型所对应的目标单元,所述目标单元属于所述处理器,所述目标单元配置用于为所对应的仿真模型提供计算资源。
在第二方面的一种可能的实施方式中,所述处理单元,具体用于:根据每一个所述仿真模型在所述处理器上的运行时间构建所述N个受控设备的第一损失函数;根据所述第一损失函数确定所述N个受控设备各自对应的仿真模型所对应的目标单元。
在第二方面的一种可能的实施方式中,所述N个受控设备中的任意一个受控设备对应的仿真模型的数量为一个或多个;所述处理单元,具体用于:
根据第一功能域中的仿真模型在所述处理器上的运行时间构建所述第一功能域的第二损失函数,所述第一功能域为所述至少一个功能域中的任意一个,所述任意一个受控设备对应的任意一个仿真模型属于所述至少一个功能域中的一个功能域;根据所述至少一个功能域各自的第二损失函数确定所述N个受控设备的第一损失函数。
在第二方面的一种可能的实施方式中,所述处理单元,还可以用于:确定所述至少一个功能域。
在第二方面的一种可能的实施方式中,所述处理单元,具体用于:
将所述N个受控设备的所述第一功能域中的仿真模型在所述处理器上的运行时间累加起来,构成所述第一功能域的第二损失函数。
在第二方面的一种可能的实施方式中,所述处理单元,还可以用于:确定所述N个受控设备的所述第一功能域中的仿真模型。在第二方面的一种可能的实施方式中,所述处理单元,具体用于:
确定所述至少一个功能域中的每个功能域的第一权重;根据所述至少一个功能域的每个功能域的第一权重和所述至少一个功能域各自的第二损失函数,确定所述N个受控设备的第一损失函数。
在第二方面的一种可能的实施方式中,所述处理单元,具体用于:
确定所述第一损失函数的最小值;将目标状态下的所述N个受控设备各自对应的仿真模型所对应的处理器核,作为所述N个受控设备各自对应的仿真模型对应的目标单元,所述目标状态为所述第一损失函数的最小值的状态。
在第二方面的一种可能的实施方式中,所述处理器部署在本地设备或者云端设备。
第三方面,本申请实施例提供了一种测试系统,该系统可以包括第二方面任一项所描述的硬件在环测试设备,N个受控设备,通过接口板与所述硬件在环测试装置连接,其中,N为大于1的正整数,所述N个受控设备中的任意一个受控设备包含一个或多个域控制器,或者包含一个或多个功能域,或者包含一个或多个零部件。
第四方面,本申请实施例提供了一种计算设备,该计算设备包括处理器和通信接口,所述通信接口用于接收和/或发送数据,和/或,所述通信接口用于为所述处理器提供输入和/或输出。所述处理器用于实现第一方面任一项所描述的方法。
需要说明的是,上述第四方面所描述的计算设备所包含的处理器,可以是专门用于执行这些方法的处理器(便于区别称为专用处理器),也可以是通过调用计算机程序来执行这些方法的处理器,例如通用处理器。可选的,至少一个处理器还可以既包括专用处理器也包括通用处理器。
可选的,上述计算机程序可以存在存储器中。示例性的,存储器可以为非瞬时性 (non-transitory)存储器,例如只读存储器(Read Only Memory,ROM),其可以与处理器集成在同一块器件上,也可以分别设置在不同的器件上,本申请实施例对存储器的类型以及存储器与处理器的设置方式不做限定。
在一种可能的实施方式中,上述至少一个存储器位于上述计算设备之外。
在又一种可能的实施方式中,上述至少一个存储器位于上述计算设备之内。
在又一种可能的实施方式之中,上述至少一个存储器的部分存储器位于上述计算设备之内,另一部分存储器位于上述计算设备之外。
本申请中,处理器和存储器还可能集成于一个器件中,即处理器和存储器还可以被集成在一起。
第五方面,本申请实施例提供一种芯片系统,该芯片系统包括处理器和通信接口,所述通信接口用于接收和/或发送数据,和/或,所述通信接口用于为所述处理器提供输入和/或输出。所述芯片系统用于实现第一方面任一项所描述的方法。
第六方面,本申请实施例提供一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当所述指令在至少一个处理器上运行时,实现前述第一方面任一项所描述的方法。
第七方面,本申请提供了一种计算机程序产品,计算机程序产品包括计算机指令,当所述指令在至少一个处理器上运行时,实现前述第一方面任一项所描述的方法。
可选的,该计算机程序产品可以为一个软件安装包,在需要使用前述方法的情况下,可以下载该计算机程序产品并在计算设备上执行该计算机程序产品。
本申请第二至第七方面所提供的技术方案,其有益效果可以参考第一方面所提供的技术方案的有益效果,此处不再赘述。
附图说明
图1是本申请实施例提供的一种中央计算架构的示意图;
图2是本申请实施例提供的一种测试系统的结构示意图;
图3A是本申请实施例提供的一种本地测试系统的结构示意图;
图3B是本申请实施例提供的一种本地HIL测试设备的结构示意图;
图3C是本申请实施例提供的一种本地HIL测试设备的软件组成示意图;
图4A是本申请实施例提供的一种云化测试系统的结构示意图;
图4B是本申请实施例提供的一种云化HIL测试设备的结构示意图;
图4C是本申请实施例提供的一种云化HIL测试设备的软件组成示意图;
图5是本申请实施例提供的一种资源分配方法的流程示意图;
图6A是本申请实施例提供的一种为仿真模型分配计算资源的示意图;
图6B是本申请实施例提供的一种资源分配的流程示意图;
图7是本申请实施例提供的一种硬件在环测试设备的结构示意图;
图8是本申请实施例提供的一种计算设备的结构示意图。
具体实施方式
下面结合本申请实施例中的附图对本申请实施例进行描述。
在汽车、航空航天等一些电控设备的开发过程中,硬件在环(Hardware-In-Loop,HIL)测试已经成为电子控制单元(Electronic Control Unit,ECU)开发流程中非常重要的一环。这样可以缩短开发时间和降低验证成本,同时,还可以确保ECU的软件质量。
以受控设备可以用于实现汽车的相关功能为例,请参见图1,图1是本申请实施例提供的一种中央计算架构(Central Computing Architecture,CCA)100的示意图。需要说明的是,本申请实施例提及的汽车包括但不限于智能汽车、新能源汽车或者传统汽车等。其中,智能汽车可以包括智能驾驶汽车、无人小车等。新能源汽车包括纯电动汽车、增强式电动汽车、混合动力汽车、燃料电池电动汽车、氢发动机汽车、其他新能源汽车等。传统汽车包括汽油汽车、柴油汽车等,本申请实施例对此不做限制。
中央计算架构100可以包括分布式网关(比如说一个或多个I/O网关)和数据中心(xData Center,xDC),例如xDC可以包括智能座舱CDC、整车控制VDC和智能驾驶MDC。智能座舱CDC用于智能座舱的控制;整车控制VDC用于整车动力控制;智能驾驶MDC用于智能驾驶的控制。
分布式网关可以提供设备的接入,一边连接xDC,一边连接车辆零部件,还可以连接汽车盒子(Telematics BOX,T-box)。因此,分布式网关可以是整车中央计算架构中的核心部件和整车网络的数据交换枢纽。分布式网关和xDC可以运行收编的控制器逻辑。T-box主要用于和汽车外部、后台系统和手机应用通信。
车辆零部件,包含执行元件,执行元件用于实现特定的功能。其中,执行元件例如可以是车辆中的执行器或者传感器等。车辆零部件还可以包括ECU。其中,车辆零部件可以包含以下一种或多种:具有部分或完整电子控制功能的车辆零部件,以及不具有电子控制功能的车辆零部件。
其中,实现自动驾驶功能的车零部件例如包括单目摄像头、双目摄像头、毫米波雷达、激光雷达、超声波雷达中的一种或多种,也可以包括其他用于实现自动驾驶功能的车辆零部件,本申请实施例对此不做限定。
实现智能座舱的车辆零部件例如包括抬头显示器、仪表显示器、收音机、导航、摄像头中的一种或多种,也可以包括其他用于实现智能座舱的车辆零部件,本申请实施例对此不做限定。
实现整车控制的车辆零部件例如包括用于车身域的车辆零部件及底盘域的车辆零部件中的一种或多种,车身域的车辆零部件例如包括门窗升降控制器、电动后视镜、空调、中央门锁中的一种或多种,也可以包括其他用于车身域的车辆零部件。底盘域的车辆零部件例如包括制动系统的车辆零部件、转向系统中的车辆零部件、加速系统中的车辆零部件中的一种或多种,比如油门等。
ECU位于汽车零部件的内部,由处理器、存储器、输入/输出(I/O)接口、模数转换器(A/D)以及整形、驱动等大规模集成电路中的一个或者多个组成,具有电子控制功能,可以完成多种多样的功能。例如,可以基于控制信息对汽车零部件进行控制,又例如,可以对汽车零部件中待传输数据进行数据处理。
需要说明的是,上述电子控制功能主要包括逻辑控制功能以及数据处理功能。其中逻辑控制功能包括基于获取的控制信息控制车辆零部件执行某种操作,例如,基于控制信息控制雨刷器的动作;又例如,基于控制信息控制车门门锁的开关状态等。数据处理功能包括对车辆零部件中待处理的数据进行处理,例如,将通过雨刷器的敏感元件采集的雨量信息进行数据处理,确定雨刷器的工作状态,其中工作状态包括雨刷器的工作频率或开关状态。又例如,将车门上通过门锁的敏感元件获取的指纹信息进行数据处理,确定车门的开关状态信息。
需要说明的是,除非有特殊的说明,否则本申请实施例中的ECU都是指位于车辆零部件内的电子控制元件,与现有技术中的发动机控制单元(Engine Control Unit)不同。发动机控制 单元位于发动机系统中的多个车辆零部件之外,用于控制发动机系统中的多个车辆零部件,可以视为一种独立的集中控制器。然而,本申请实施例中的电子控制单元,即ECU指位于车辆零部件内部的电子控制单元,例如,可以是发动机系统中的多个车辆零部件内部的电子控制单元。
需要说明的是,上述通信连接可以理解为进行信息传输的无线连线或者有线连接,本申请实施例对此不做限定,其中,无线连接可以理解为xDC无需通过总线即与车辆中的其他单元通信连接,例如,可以采用短距无线通信技术,比如蓝牙(bluetooth)通信技术、无线保真(wireless fidelity,Wi-Fi)、近场通讯(near field communication,NFC)技术、Wi-Fi Aware技术、通用短距通信技术、星闪联盟规范的短距通信技术等。有线连接可以理解为DC基于总线或以太连接等与车辆中的其他单元通信连接,例如,可以采用控制器局域网络(Controller Area Network,CAN)总线、局域互联网络(Local Interconnect Network,LIN)总线、高速串行计算机扩展总线标准(peripheral component interconnect express,PCI-e)、或者以太网(ethernet)通信技术。
可以看出,随着汽车电子电控技术的发展,汽车从分散控制器架构,走向域控制架构,再到图1所示的中央计算架构。因此,汽车的开发验证也将随之变化,最明显的不同有以下几点:
(1)首先是受控设备(即汽车)的范围发生变化:以前,ECU的开发验证主要以单部件或者单域为主。现在,则上升到整车级,涉及到的内容和范围将更加广泛。
(2)验证环境搭建更为复杂:当测试范围由单部件上升到整车级,所测试的功能范围大大增加,对应的测试环境也更加复杂。因此,传统的HIL测试设备中单个处理器的计算能力已经很难满足整车测试环境的计算要求。
(3)在软件定义汽车的背景下,验证测试周期需要大大缩短,这就对测试工具和测试环境提出了更高的要求。
但是,现有的面向整车级HIL测试设备只能搭建一辆汽车的测试环境,不能满足多辆汽车同时测试的要求。
为解决上述技术问题,首先,本申请实施例提供了一种系统。请参见图2,图2是本申请实施例提供的一种测试系统200的结构示意图。如图2所示,测试系统200可以包括HIL测试设备201以及N个受控设备202。其中,N为大于1的正整数,N个受控设备中的任意一个受控设备包含一个或多个零部件,或者包括一个或多个功能域,或者包括一个或多个域控制器,或者每一个受控设备可以认为是一台被测车辆。HIL测试设备201与N个受控设备202之间的任意一个受控设备可以进行信息的交互。比如说,接收来自N个受控设备的控制信号,根据每个受控设备各自对应的控制信号可以确定上述N个受控设备各自对应的仿真环境,然后再为N个受控设备各自对应的仿真环境分别分配处理器上的计算资源。其中,上述N个受控设备各自对应的仿真环境可以对应Mi个仿真模型,或者N个受控设备各自对应的仿真环境是基于其所对应的Mi个仿真模型(即一个或多个仿真模型)实现的,Mi为大于等于1的正整数,Mi可以表示为第i个受控设备对应的仿真环境中所包含的仿真模型的数量,1≤i≤N。可以理解的是,当受控设备不同时,受控设备的控制信号也可能是不同的。所以受控设备各自对应的仿真环境也可能是不同的,因此每一个仿真环境所对应的仿真模型的数量可以是相同的,也可以是不相同的,对此本申请实施例不做任何限制。其中,仿真环境搭载于HIL测试设备中,也即仿真模型可以部署在HIL测试设备201中,仿真模型用于根据分配的 计算资源进行仿真运行。或者,也可以理解为,仿真模型部署在HIL测试设备201中,仿真模型用于进行仿真测试或运行,该仿真测试或运行是基于为该仿真模型对应的或分配的计算资源实现的。
HIL测试设备201可以用于进行整车测试环境的模拟,可以模拟一个或多个受控设备所需要的各类仿真信号,同时可以采集一个或多个受控设备发出的控制信号,仿真模型可以根据控制信号进行状态的更新,模拟受控设备的运行状态。比如说可以模拟受控设备的各种工况,包括极限工况;或者可以模拟受控设备所面对的故障模式,等等。一个或多个受控设备与运行在HIL测试设备中的仿真模型构成闭环,由此实现一个或多个受控设备的硬件在环测试。
受控设备202可以实现汽车的一种或多种逻辑功能。示例性地,受控设备202可以包括一个或多个域控制器,域控制器具体可以是车载控制器或者车载中央处理器,用于运行汽车的逻辑功能。因此,一个受控设备202可以相当于一台被测车辆。可以理解的是,受控设备202具体可以是一个镜像设备,该镜像设备上搭载有汽车中的一个或多个域控制器,用于实现汽车上某个功能域的逻辑功能。或者受控设备202具体可以是包含一个或多个电子控制单元的设备,上述一个或多个电子控制单元的组合可以实现汽车的某个功能域的逻辑功能。其中,N个受控设备202可以是独立的个体,也可以集成在一起。其中,在受控设备202中配置有待测试控制程序,该待测试控制程序需要通过HIL仿真测试验证的控制程序,该待测试程序可以实现至少一个软件逻辑功能。
需要说明的是,测试系统200还可以包括上位机和模拟驾驶器。上位机可以与HIL测试设备通信,上位机上预先配置有用于对仿真测试运行结果进行分析的结果分析程序和用于生成携带仿真模型设定参数的仿真测试指令的测试用例队列。其中,结果分析程序是预先设置的用于对硬件在环仿真测试获取的仿真测试结果进行自动化分析的计算机程序,有助于提高结果分析的效率,并节约分析成本。测试用例队列是预先设置的用于辅助HIL测试设备进行硬件在环仿真测试的仿真测试指令的队列,有助于提高仿真测试指令的获取效率。因此,上位机的显示器的操作界面可以提供测试指令和可视化。在一些情况下,还可以提供配置管理、测试自动化、分析和报告任务中的一项或多项。模拟驾驶器用于模拟汽车的驾驶情况,比如说转弯等等。
在一种可能的实施方式中,在图2所示的HIL测试设备201部署在本地的情况下。请参见图3A,图3A是本申请实施例提供的一种本地测试系统300的结构示意图。如图3A所示,本地测试系统300可以包括本地HIL测试设备301以及N个受控设备202。本地HIL测试设备301与N个受控设备202之间的任意一个受控设备可以进行信息的交互。
本地HIL测试设备301包含一个或多个计算单元302,计算调度板303和接口板304。其中,计算单元302具体可以是部署在本地设备中的处理器,接口板304分别与N个受控设备202连接,通过计算调度板303调度本地HIL测试设备301内的计算单元302为N个受控设备202所对应的车辆提供验证测试。
请参见图3B,图3B是本申请实施例提供的一种本地HIL测试设备301的结构示意图。从图3B可以看出,本地HIL测试设备301可以包含以下一种或多种:接口板304,一个或多个板卡305,一个或多个计算单元302,电源308,内存309等。其中,计算单元302可以包含具有计算功能的装置。例如,计算单元302可以包含以下装置中的一项或多项:中央处理器(central processing unit,CPU)、图形处理器(graphics processing unit,GPU)、应用处理器(application processor,AP)、时间数字转换器(Time-to-Digital Converter,TDC)、滤波器、微处 理器(microprocessor unit,MPU)、专用集成电路(Application Specific Integrated Circuit,ASIC)、图像信号处理器(image signal processor,ISP)、数字信号处理器(digital signal processor,DSP)、现场可编程逻辑门阵列(Field Programmable Gate Array,FPGA)、复杂可编程逻辑器件(Complex programmable logic device,CPLD)、协处理器(协助中央处理器完成相应处理和应用)、微控制单元(Microcontroller Unit,MCU)、和/或神经网络处理器(neural-network processing unit,NPU)等。接口板包含数字信号(DI/DO)接口、模拟信号(AD/DA)接口等低速输入输出(input/output,I/O)接口。接口板还可以包含控制局域网络(controller area network,CAN)接口和局域互联网络(Local Interconnect Network,LIN)接口,以及以太网(ethernet,ETH)等高速接口。因此,接口板304可以支持受控设备202对应的整车级控制器多样的接口需求。板卡305用于进行数字信号到模拟信号的转换,从而使得可以接收来自不同受控设备202的信号。假设计算单元302中包含的装置为CPU306或GPU307时,CPU306或者GPU307可以用于运行整车级的仿真模型。进一步地,计算单元302中CPU306或者GPU307可以为仿真模型分配计算资源,因此仿真模型可以根据分配的计算资源进行仿真运行,为多个受控设备202所对应的车辆提供验证测试。在本申请实施例中,仿真模型根据分配的计算资源进行仿真运行,可以理解为:仿真模型用于仿真测试,仿真测试基于上述计算资源实现。
请参见图3C,图3C是本申请实施例提供的一种本地HIL测试设备的软件组成示意图。从图3C可以看出,本地HIL测试设备的软件由仿真总线308与仿真模型309组成。其中,仿真总线308部署在计算调度板中,其功能至少包括仿真任务调度、仿真运行控制和仿真数据分发中的一项或多项。仿真任务调度包括根据计算单元302的计算能力以及仿真模型309(例如仿真模型309的计算复杂度)为计算单元302分配仿真模型309的计算任务。仿真运行控制是指控制各仿真模型309的运行情况,比如说按照计算单元302的时钟周期控制各仿真模型309的运行。需要说明的是,仿真任务调度影响着仿真运行控制,只有仿真任务分配的结果是合理的,才能保证仿真运行控制可以满足各仿真模型计算任务的周期要求。比如说,为计算资源丰富的计算单元分配复杂度较高,需要较多时间完成计算的仿真模型;为计算资源不丰富的计算单元分配复杂度较低,需要较少时间完成计算的仿真模型。因此,在进行仿真任务调度时,需要综合考虑仿真模型计算的执行时间、仿真模型计算的执行效率和计算单元负载平衡。
在一种可能的实施方式中,在图2所示的HIL测试设备201中的部分功能模块部署在云服务器的情况下。请参见图4A,图4A是本申请实施例提供的一种云化测试系统的结构示意图。如图4A所示,云化测试系统400可以包含云化HIL测试设备401以及N个受控设备202。其中,云化HIL测试设备401包含部署在本地的调度板402,接口板403以及部署在云服务器中的一个或多个计算单元404。其中,计算单元404具体可以是部署在云端设备(例如云服务器)中的处理器。
其中,图4A所示的N个受控设备202可以集成在一起,从而通过接口板405可以与云化HIL测试设备401中的接口板403进行连接。而部署在本地的设备可以与部署在云服务器中的计算单元404进行信息的交互,因此通过调度板402可以与云服务器中的一个或多个计算单元404中的任意一个计算单元进行通信,并调用接口板403为多个受控设备202或多个受控设备202所对应的车辆提供验证测试。可以理解的是,因为云服务器中拥有更多的计算资源,所以图4A所示的云化测试系统400适合大批量汽车的HIL测试。
请参见图4B,图4B是本申请实施例提供的一种云化HIL测试设备401的本地设备结构示意图。从图4B可以看出,云化HIL测试设备401的本地设备可以包含以下一种或多种: 接口板403、一个或多个板卡406和通信板卡407。其中,接口板包含数字信号(DI/DO)接口、模拟信号(AD/DA)接口等低速输入输出(input/output,I/O)接口。接口板还可以包含控制局域网络(controller area network,CAN)接口和局域互联网络(Local Interconnect Network,LIN)接口,以及以太网(ethernet,ETH)等高速接口。因此,接口板304可以支持受控设备202对应的整车级控制器多样的接口需求。板卡305用于进行数字信号到模拟信号的转换。示例性地,通信板卡407具体可以位于图4A所示的调度板402中,用于与云端服务器进行通信。
请参见图4C,图4C是本申请实施例提供的一种云化HIL测试设备的软件组成示意图。从图4C可以看出,云化HIL测试设备的软件部分可以由本地软件和云端软件组成。本地软件包含用于通信的功能部分408,云端软件包含仿真模型4010和仿真总线409。示例性地,用于通信的功能部分408可以位于图4B所示的云化HIL测试设备401的通信板卡407中,用于实现云化HIL测试设备包括的本地设备与云端服务器之间的通信。此外,示例性地,该用于通信的功能部分408还可以用于实现将接收到的云端数据分配到各个板卡中的功能。其中,仿真总线409至少用于实现如下功能中的一项或多项:仿真任务调度、仿真运行控制、仿真数据分发和远程通信。仿真任务调度包括根据计算单元的计算能力以及仿真模型(例如仿真模型的计算复杂度)为计算单元分配仿真模型计算任务。仿真运行控制包括控制各仿真模型以指定周期运行。需要说明的是,仿真任务调度的结果影响着仿真运行控制,只有仿真任务调度或者仿真任务分配的结果是合理的,才能保证仿真运行控制可以满足各仿真模型计算任务的周期要求。比如说,为计算资源丰富的计算单元分配复杂度较高,需要较多时间完成计算的仿真模型;为计算资源不丰富的计算单元分配复杂度较低,需要较少时间完成计算的仿真模型。因此,在进行仿真任务调度或分配时,需要综合考虑仿真模型计算的执行时间、仿真模型计算的执行效率和计算单元负载平衡。
可以看出,云化测试系统400与本地测试系统300相比,云化测试系统400中将仿真环境的构建任务上移到云服务器,仅在本地中保留通信单元,将一个或多个受控设备的输入和云服务器的输出与接口板对接。
需要说明的是,图2、图3A、图3C、图4A以及图4C所示的受控设备202与汽车之间的虚线在本申请实施例中仅仅表示对应关系,不表示受控设备202与汽车之间具有通信关系。
请参见图5,图5是本申请实施例提供的一种资源分配方法的流程示意图,该方法可应用于上述图2至图4C所述的任意一个测试系统,其中的HIL测试设备(包含本地HIL测试设备301或云化HIL测试设备401)可以用于支持图5中所示的方法流程步骤。该方法可以包括以下部分或全部步骤。
步骤S501,接收来自N个受控设备的控制信号。示例性地,N个受控设备上分别配置有需要进行测试的待测试控制程序,而在HIL测试设备中配置有可以模拟受控设备工作状态的仿真模型,因此可以通过仿真模型模拟受控设备的工作来验证如下一项或多项:受控设备中的待测试控制程序的软件逻辑功能能否实现,受控设备中的待测试控制程序的软件逻辑功能的实现效果,从而完成仿真测试的目的。进一步地,在一种可选的设计中,在HIL测试中,HIL测试设备可以接收携带有仿真模型设定参数的仿真测试指令,采用实时仿真模型模拟上述设定参数对应的测试情况,以获取仿真模型输出的测量信号,然后将测量信号发送给对应的受控设备。可以理解的是,需要对几个受控设备进行测试,则HIL测试设备需要接收对应数量的仿真模型设定参数的仿真测试指令。其中,上述提及的仿真模型设定参数的仿真测试指令对应于不同受控设备的仿真模型,也即需要对哪一个受控设备进行测试,则需要哪一个 受控设备的仿真模型设定参数的仿真测试指令。仿真测试指令是用于触发仿真测试的指令,仿真模型设定参数是预先设置的用于模拟受控设备工作状态的数据。
当每一个受控设备接收到对应的测量信号后,可以采用对应的待测试控制程序对测量信号进行处理,得到控制信号。可以理解的是,本申请实施例可以同时对多个受控设备进行仿真测试,所以当HIL测试设备接收到多个携带有仿真模型设定参数的仿真测试指令时,HIL测试设备需要向多个受控设备发送对应的测量信号。而每一个受控设备可以根据接收到的测量信号生成对应的控制信号,然后再向HIL测试设备发送。因此,HIL测试设备可以接收来自N个受控设备的控制信号。其中,N为大于1的正整数,上述N个受控设备中的任意一个受控设备包含一个或多个零部件,或者包含一个或多个功能域,或者包含一个或多个域控制器,或者每个受控设备可以认为是一台待测车辆。可以理解的是,不同的受控设备所接收到的来自HIL测试设备的测量信号可能是不一样的,所以HIL测试设备接收到来自N个受控设备的控制信号也可能是不一样的。
在本申请实施例中,受控设备还可以通过其他方式生成控制信号,例如受控设备可以通过待测试的功能或仿真环境或任务或需求,生成控制信号,本申请实施例对控制信号的生成方式不做限定。
步骤S502,根据控制信号确定N个受控设备各自对应的仿真模型。
示例性地,当需要对N个受控设备进行仿真测试时,HIL测试设备可以接收来自N个受控设备的控制信号。而HIL测试设备中搭载有多个受控设备的仿真模型,所以HIL测试设备需要根据每一个受控设备的控制信号从多个受控设备的仿真模型中确定各自对应的仿真模型。进一步地,每个受控设备各自对应的仿真模型可以搭建一个仿真环境,也即仿真环境对应一个或多个仿真模型,或者仿真环境是基于其所对应的一个或多个仿真模型实现的。
步骤S503,根据处理器的计算能力和N个受控设备各自对应的仿真模型,为N个受控设备各自对应的仿真模型分别分配处理器上的计算资源。
示例性地,由于控制信号是来自不同的受控设备,所以控制信号可以对应于不同的仿真环境。HIL测试设备可以根据N个受控设备各自对应的仿真环境,为N个受控设备各自对应的仿真环境分别分配处理器上的计算资源。进一步地,在一种可选的设计中,HIL测试设备可以根据N个受控设备各自对应的仿真环境,为N个受控设备各自对应的仿真环境分别分配处理器上的计算资源,可以包括:HIL测试设备可以根据处理器的计算能力和N个受控设备各自对应的仿真环境,为N个受控设备各自对应的仿真环境分别分配处理器上的计算资源。再进一步地,在一种可选的设计中,仿真环境对应一个或多个仿真模型,或者仿真环境是基于其所对应的一个或多个仿真模型所实现的。仿真模型包含以下一种或多种:微控制单元模型、电池管理系统模型、车载充电器模型、电子控制制动系统模型、电控转向助力系统模型,等等。因为受控设备可以是不同品牌或者不同类型的,所以受控设备所对应的仿真模型也是不同的。而仿真模型是采用建模方式对受控设备的某一域控制器或者某一功能域进行建模后获取到的,所以当受控设备不同时,建模得到的仿真模型的复杂度也是不同的。也即,不同的受控设备的微控制单元模型的复杂度可能是不同的。可以理解的是,仿真模型的复杂度可以理解为建模该仿真模型时所使用的数学方程,所使用的数学方程较复杂,可以认为该仿真模型的复杂度较高;所使用的数学方程较简单,可以认为该仿真模型的复杂度较低。而仿真模型搭载在HIL测试设备的处理器中,进一步地,在一种可选的设计中,HIL测试设备可以根据处理器的计算能力和N个受控设备各自对应的仿真模型的复杂度,为N个受控设备各自 对应的仿真模型分别分配处理器上的计算资源,以获取N个受控设备对应的仿真测试运行结果。其中,复杂度可以包含时间复杂度和空间复杂度中的一项或多项。时间复杂度包括运行当前模型所消耗的时间,空间复杂度包括运行当前模型需要占用的内存空间。
在一种可能的实现方式中,因为仿真模型是用户根据实际需求建模得到的,所以每一个仿真模型的复杂度在该仿真模型被建模出来的时候就可以确定。因此,HIL测试设备可以根据N个受控设备各自对应的仿真模型的复杂度,确定N个受控设备各自对应的仿真模型在处理器上的运行时间或者需要占用的内存空间。从而HIL测试设备可以根据每一个仿真模型在处理器上的运行是将或者需要占用的内存空间,确定上述N个受控设备各自对应的仿真模型或上述N个是受控设备各自对应的仿真环境所对应的目标单元。目标单元属于上述处理器,目标单元至少配置用于为所对应的仿真模型提供计算资源,使得仿真模型在各自对应的目标单元上进行仿真测试。示例性地,目标单元可以是处理器上的处理器核。
进一步地,在一种可能的实现方式中,可以通过损失函数来确定N个受控设备各自对应的仿真模型所对应的目标单元。在本申请实施例中,损失函数是将仿真模型的运行时间或其有关的其他变量(比如说占用的内存空间)的取值映射为非负实数以表示该仿真模型的“风险”或“损失”的函数,即通过最小化损失函数求解和评估模型。因此,HIL测试设备可以根据每一个仿真模型在处理器上的运行时间或者需要占用的内存空间来构建N个受控设备的第一损失函数,进而可以根据第一损失函数来确定N个受控设备各自对应的仿真环境所对应的目标单元。进一步地,HIL测试设备可以根据第一损失确定N个受控设备各自对应的仿真环境中包含的仿真模型所对应的目标单元。
在一种可能的实现方式中,当受控设备用于实现汽车的相关功能时,以图1所示的中央计算架构的汽车为例来说,中央计算架构的汽车可以包括分布式网关(比如说一个或多个I/O网关)和数据中心(xData Center,xDC),xDC可以包括智能座舱CDC、整车控制VDC和智能驾驶MDC。实现智能驾驶功能的车辆零部件,实现智能座舱的车辆零部件,以及实现整车控制的车辆零部件的数量可以是一个或多个。由于仿真模型具体可以是上述域控制器或功能域或零部件所对应的仿真模型,因此任意一个受控设备对应的仿真模型的数量可以是一个或多个。可选地,在HIL测试设备根据控制信号确定N个受控设备各自对应的仿真模型后,可以将仿真模型划分为对应的功能域,从而可以确定至少一个功能域。功能域可以包含车身域、动力域、底盘域,等等。进一步地,每个功能域可以对应于一个数据中心,比如说车身域中的零部件可以对应于智能座舱中的零部件,动力域中的零部件可以对应于智能驾驶中的零部件,底盘域中的零部件可以对应于整车控制中的零部件。也即任意一个受控设备对应的任意一个仿真模型属于一个或多个功能域中的一个功能域,或者一个或多个数据中心中的一个数据中心。可以理解的是,由于N个受控设备各自对应的仿真模型也许是属于不同的功能域,所以需要将N个受控设备各自对应的仿真模型划分到对应的功能域中,这样就可以确定多个功能域。然后,HIL测试设备可以根据第一功能域中的仿真模型在处理器上的运行时间构建第一功能域的第二损失函数,第一功能域为多个功能域中的任意一个。其中,第一功能域中的仿真模型是指对应该第一功能域的仿真模型,或者归纳到该第一功能域的仿真模型,第一功能域的仿真模型可以包括一个或多个仿真模型。进一步地,HIL测试设备可以将N个受控设备的第一功能域中的仿真模型在处理器上的运行时间累加起来,从而可以得到第一功能域(可以理解为至少一个功能域中包含的任意一个功能域)的第二损失函数。通过上述实现方式,当得到至少一个功能域各自的第二损失函数之后,HIL测试设备可以根据至少一个功能域各自的第二损失函数确定N个受控设备的第一损失函数。在本申请实施例中,至少一 个功能域各自的第二损失函数,可以理解为,至少一个功能域中的每个功能域各自对应的第二损失函数。
在一种可能的实现方式中,由于进行资源分配的时候,按照实际需求来说,不同功能域的优先级可能是不同的,比如说动力域和底盘域的优先级可能高于车身域。也即,在对N个受控设备各自对应的仿真环境或者仿真环境所包含的仿真模型分配资源的时候,需要考虑每个仿真环境或者每个仿真环境中包含的仿真模型所属于的功能域。因此,HIL测试设备需要确定至少一个功能域中的每个功能域的第一权重,然后根据至少一个功能域的每个功能域的第一权重和至少一个功能域各自的第二损失函数,来确定N个受控设备对应的第一损失函数。比如说,假设受控设备的功能域有三个,分别是动力域、底盘域和车身域,若这三个功能域的优先级排序分动力域优于底盘域优于车身域,则动力域的第一权重可以为0.5,底盘域的第一权重可以为0.3,车身域的第一权重可以为0.2。然后将每个功能域的第一权重乘以每个功能域对应的第二损失函数,并将其相加,即可得到N个受控设备对应的第一损失函数。这样,HIL测试设备在通过第一损失函数确定N个受控设备各自对应的仿真环境或者仿真环境所包含的仿真模型所对应的目标单元时可以考虑到功能域的优先级。
需要说明的是,本申请实施例中提及的第二损失函数以及第一权重可以以静态特征而非动作的方式体现在第一损失函数构造的过程中。比如说,在构造第一函数的过程中,在第一损失函数中可以体现第二损失函数以及第一权重。
在一种可能的实现方式中,在确定N个受控设备的第一损失函数之后,为了提高测试效率,以及缩短测试周期,HIL测试设备可以通过确定第一损失函数求最小值来为N个受控设备各自对应的仿真环境或者仿真环境所包含的仿真模型分配对应的目标单元。也即,HIL测试设备可以先确定第一损失函数的最小值,然后将目标状态下的N个受控设备各自对应的仿真环境或者仿真环境所包含的仿真模型所对应的处理器核,作为N个受控设备各自对应的仿真环境或者仿真环境所包含的仿真模型所对应的目标单元。其中,目标状态为第一损失函数的最小值的状态。这样,HIL测试设备可以根据每一个仿真模型的复杂度为仿真环境或者仿真环境所包含的仿真模型分配合适的处理器核,从而提高测试效率。其中,仿真模型用于仿真测试,仿真测试基于处理器核的计算资源实现。可以理解的是,处理器核可以认为是处理器中间的核心芯片,用于完成计算、接收/存储命令、处理数据,等等。
需要说明的是,不同的受控设备可以对应相同的功能域,也可以对应不同的功能域,其中不同的受控对应不同的功能域,可以包括不同的受控设备各自包括的功能域中至少有一个功能域是不同的。另外,对于仿真模型,仿真模型对应的功能域和/或仿真模型中的仿真参数不同,可以认为该仿真模型是不同的。
需要说明的是,本申请实施例所提及的优先级不限于功能域,也可以是受控设备的优先级,或者受控设备包含的域控制器或功能域的优先级,等等。
请参见图6A,图6A是本申请实施例提供的一种为仿真模型分配计算资源的示意图。从图6A可以看出,HIL测试设备中搭载的仿真模型包含每一个受控设备的域控制器(或功能域)所对应的仿真模型。而每一个受控设备中的域控制器可以包含车身域控制器、动力域控制器和底盘域控制器中的一项或多项。图6A是以受控设备3为例,但是其他受控设备(比如说受控设备1、受控设备2,等等)中的域控制器也可以包含车身域控制器、动力域控制器和底盘域控制器中的一个或多个。基于图6A,也可以理解,每个受控设备的功能域包含车身域、动力域、和底盘域中的一项或多项。可以理解的是,受控设备也可以包含除上述功能域之外 的其他功能域,或者包含除上述域控制器之外的其他域控制器,本申请实施例对此不做限定。
因此,在为N个受控设备各自对应的仿真环境或者仿真环境所包含的仿真模型分别分配处理器上的计算资源的时候,可以将每一个受控设备看着一个大的计算任务,比如说受控设备1、受控设备2、受控设备3,…,受控设备N。也即,将每一个受控设备所对应的所有仿真环境或者仿真环境所包含的仿真模型作为一个大的计算任务。而每一个受控设备对应的计算任务可以根据功能域的划分,又可再细分为车身域、动力域和底盘域的计算任务。并且,根据受控设备的不同,域的数量分别为k i,1≤i≤N。其中,i表示受控设备。然后,每个功能域的计算任务可继续被拆分,例如,被测功能域对应的仿真环境中包括一个或多个零部件,每个功能域的计算任务可以根据这一个或多个零部件拆分计算任务,或者,又例如根据受控于功能域的不同对象,每个功能域的计算任务可以继续拆分。比如说动力域的计算任务可以被拆分为微控制单元(Microcontroller Unit,MCU)对应的计算任务、电池管理系统(battery management system,BMS)对应的计算任务、车载充电器(On board charger,OBC)对应的计算任务,等等。因此,根据受控设备的不同,每个功能域继续被拆分的计算任务的数量分别h j,1≤j≤k i。在进行仿真测试的时候,可以将上述每个功能域继续被拆分的计算任务在HIL测试设备中所对应的仿真模型作为最小的计算单元,这样可以将计算任务表示为τ i,j,l,1≤l≤h j
用P表示计算单位集{p 1,p 2,p 3,…,p m},用E表示计算任务τ i,j,l在某个处理器核上的处理时间的集合,则为仿真模型分配资源的数学问题可以表述为min{∑E},比如说e i,j,l,f表示计算任务τ i,j,l在处理器核p f上的执行时间。
对于所有的受控设备,所有的受控设备的j域对应的第l个计算任务所对应的仿真环境或者仿真环境所包含的仿真模型的计算任务可以是
Figure PCTCN2021130442-appb-000001
N个受控设备的j域的计算任务可以是
Figure PCTCN2021130442-appb-000002
从而可以确定j域的第二损失函数为:
Figure PCTCN2021130442-appb-000003
可以理解的是,j域表示至少一个功能域中的任意一个功能域。
但是,在进行资源分配的时候,以实际需求出发,不同功能域的优先级是不同的,比如说动力域和底盘域的优先级大于车身域。所以,接下来为j域的计算任务分配第一权重w j,且至少一个功能域中的所有功能域对应的第一权重满足下述关系:
Figure PCTCN2021130442-appb-000004
其中,K表示待分配权重的功能域的个数或至少一个功能域中的所有功能域的个数。示例性地,例如每个受控设备对应的功能域彼此不同,则
Figure PCTCN2021130442-appb-000005
又例如每个受控设备对应的功能域均有彼此包含的关系,则K=max(k i),比如说,当受控设备为3个时,第一受控设备的功能域的数量k 1为3个,第二受控设备的功能域的数量k 2有1个,第三受控设备的功能域的数量k 3有2个,且第二受控设备的功能域、第三受控设备的功能域包含于第一受控设备的功能域,则max(k i)=3;再例如,K可以为N个受控设备所对应的所有功能域中不同的功能域的个数。因此,N个受控设备的第一损失函数为:
L average=ΣL j_averagew j
对第一损失函数求最小值可以得到N个受控设备各自对应的仿真环境或者仿真环境所包 含的仿真模型的最优分配结果,也即处理器上目标单元的计算资源。其中,仿真模型用于仿真测试,仿真测试基于计算资源实现。
请参见图6B,图6B是本申请实施例提供的一种资源分配的流程示意图。从图6B可以看出,当HIL测试设备根据控制信号确定N个受控设备各自对应的仿真环境或者仿真环境所包含的仿真模型之后,HIL测试设备可以初始化各个仿真环境或者仿真环境所包含的仿真模型的相关参数,计算HIL测试设备中每个处理节点的可用性能,比如说处理器的每个处理器核中可用的计算资源。根据图5或图6B所示的方法为N个受控设备各自对应的仿真环境或者仿真环境所包含的仿真模型分配目标单元,其中上述目标单元可以是根据处理器的计算能力和N个受控设备各自对应的仿真环境或者仿真环境所包含的仿真模型所确定的。然后,若上述目标单元上已经存在已分配的计算任务,则删除上述目标单元上已分配的且处理完成的仿真环境或者仿真环境所包含的仿真模型的计算任务,将新确定的仿真环境或者仿真环境所包含的仿真模型的计算任务分配给对应的目标单元。当每一个受控设备的仿真模型都分配到对应的目标单元上后,可以认为计算任务分配完毕。当计算任务没有分配完成的情况下,需要再次确认计算单元的可用性能,至到N个受控设备各自对应的仿真模型的计算任务全部分配给对应的目标单元,在目标单元上进行仿真测试。其中,仿真模型用于仿真测试,仿真测试基于目标单元提供的计算资源实现。
上述详细阐述了本申请实施例的方法,下面提供本申请实施例的装置。可以理解的是,本申请实施例提供的装置,为了实现上述方法实施例中的功能,其包含了执行各个功能相应的硬件结构、软件模块、或硬件结构和软件结构的组合等。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,本申请实施例能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以在不同的使用场景中,使用不同的装置实现方式来实现前述的方法实施例,对于装置的不同实现方式不应认为超出本申请实施例的范围。
本申请实施例可以对装置进行功能模块的划分。例如,可对应各个功能划分各个功能模块,也可将两个或两个以上的功能集成在一个功能模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。需要说明的是,本申请实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。
请参见图7,图7是本申请实施例提供的一种硬件在环测试设备700的结构示意图。该硬件在环测试设备700可以为计算设备,或者计算设备中的一个器件,例如芯片、软件模块、集成电路等。该硬件在环测试设备700用于实现前述的资源配置方法,例如图5所示的方法。
一种可能的实施方式中,硬件在环测试设备700可以包括通信单元701和处理单元702。
在一种可能的实施方式中,通信单元701接收来自N个受控设备的控制信号,其中,N为大于1的正整数,N个受控设备中的任意一个受控设备包含一个或多个域控制器,或者一个或多个功能域,或者一个或多个零部件;
处理单元702根据控制信号确定N个受控设备各自对应的仿真环境;
处理单元702于根据N个受控设备各自对应的仿真环境,为N个受控设备各自对应的仿真婚假分别分配处理器上的计算资源;其中,所述处理器被配置至少用于运行所述仿真环境,所述仿真环境用于根据所述计算资源进行仿真测试。
在一种可能的实施方式中,处理单元702,具体用于:根据所述处理器的计算能力和所述N个受控设备各自对应的仿真环境,为所述N个受控设备各自对应的仿真环境分别分配处理器上的计算资源。
示例性地,所述域控制器至少被配置用于控制受控于该域控制器的对象执行相应的操作,所述功能域至少被配置用于控制受控于该功能域的对象执行相应的操作。
示例性地,N个受控设备中的任意一个受控设备为被测车辆。
示例性地,所述N个受控设备各自对应的仿真环境包括所述N个受控设备各自对应的仿真模型。所述仿真环境对应一个或多个仿真模型,或者所述仿真环境是基于其所对应的一个或多个仿真模型实现的。所述处理器被配置至少用于运行所述仿真环境,包括所述处理器被配置至少用于运行所述仿真环境包括的仿真模型,所述仿真环境用于根据被分配的所述计算资源进行仿真测试。在本申请实施例中,所述仿真模型用于根据所述计算资源进行仿真测试,可以理解为:所述仿真模型用于仿真测试,所述仿真测试基于所述计算资源实现。
在一种可能的实施方式中,处理单元702,具体用于:
确定N个受控设备各自对应的仿真模型在处理器上的运行时间;
根据每一个仿真模型在处理器上的运行时间,确定N个受控设备各自对应的仿真模型所对应的目标单元,目标单元属于处理器,目标单元配置用于为所对应的仿真模型提供计算资源。
在一种可能的实施方式中,处理单元702,具体用于:
根据每一个所述仿真模型在所述处理器上的运行时间构建所述N个受控设备的第一损失函数;根据所述第一损失函数确定所述N个受控设备各自对应的仿真模型所对应的目标单元。
在一种可能的实施方式中,N个受控设备中的任意一个受控设备对应的仿真模型的数量为一个或多个;处理单元702,具体用于:
根据第一功能域中的仿真模型在处理器上的运行时间构建第一功能域的第二损失函数,第一功能域为至少一个功能域中的任意一个,任意一个受控设备对应的任意一个仿真模型属于至少一个功能域中的一个功能域;
根据至少一个功能域各自的第二损失函数确定N个受控设备的第一损失函数。
在一种可能的实施方式中,处理单元702,还可以用于:确定所述至少一个功能域。
在一种可能的实施方式中,处理单元702,具体用于:
将N个受控设备的第一功能域中的仿真模型在处理器上的运行时间累加起来,构成第一功能域的第二损失函数。
在一种可能的实施方式中,处理单元702,还可以用于:
确定所述N个受控设备的所述第一功能域中的仿真模型。
在一种可能的实施方式中,处理单元702,具体用于:
确定至少一个功能域中的每个功能域的第一权重;
根据至少一个功能域的每个功能域的第一权重和至少一个功能域各自的第二损失函数,确定N个受控设备的第一损失函数。
在一种可能的实施方式中,处理单元702,具体用于:
确定第一损失函数的最小值;
将目标状态下的N个受控设备各自对应的仿真模型所对应的处理器核,作为N个受控设备各自对应的仿真模型对应的目标单元,目标状态为第一损失函数的最小值的状态。
在一种可能的实施方式中,处理器部署在本地设备或者云端设备。
应理解,相关描述还可以参见图5所示实施例中的描述,此处不再赘述。
请参见图8,图8是本申请实施例提供的一种计算设备800的结构示意图,该计算设备800可以为独立设备(例如服务器、或终端设备等等中的一个或者多个),也可以为独立设备内部的部件(例如芯片、软件模块或者硬件模块等)。该计算设备800可以包括至少一个处理器801。可选的还可以包括至少一个存储器803。进一步可选的,计算设备800还可以包括通信接口802。更进一步可选的,还可以包含总线804,其中,处理器801、通信接口802和存储器803通过总线804相连。
其中,处理器801是进行算术运算和/或逻辑运算的模块,具体可以是中央处理器(central processing unit,CPU)、图片处理器(graphics processing unit,GPU)、微处理器(microprocessor unit,MPU)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程逻辑门阵列(Field Programmable Gate Array,FPGA)、复杂可编程逻辑器件(Complex programmable logic device,CPLD)、协处理器(协助中央处理器完成相应处理和应用)、微控制单元(Microcontroller Unit,MCU)等处理模块中的一种或者多种的组合。
通信接口802可以用于为至少一个处理器提供信息输入或者输出。和/或,通信接口802可以用于接收外部发送的数据和/或向外部发送数据,可以为包括诸如以太网电缆等的有线链路接口,也可以是无线链路(Wi-Fi、蓝牙、通用无线传输、车载短距通信技术以及其他短距无线通信技术等)接口。可选的,通信接口802还可以包括与接口耦合的发射器(如射频发射器、天线等),或者接收器等。
存储器803用于提供存储空间,存储空间中可以存储操作系统和计算机程序等数据。存储器803可以是随机存储记忆体(random access memory,RAM)、只读存储器(read-only memory,ROM)、可擦除可编程只读存储器(erasable programmable read only memory,EPROM)、或便携式只读存储器(compact disc read-only memory,CD-ROM)等等中的一种或者多种的组合。
该计算设备800中的至少一个处理器801用于执行前述的资源分配方法,例如图5所示实施例所描述的资源分配方法。
可选的,处理器801,可以是专门用于执行这些方法的处理器(便于区别称为专用处理器),也可以是通过调用计算机程序来执行这些方法的处理器,例如通用处理器。可选的,至少一个处理器还可以既包括专用处理器也包括通用处理器。可选的,在计算设备包括至少一个处理器801的情况下,上述计算机程序可以存在存储器803中。
在一种可能的实施方式中,该计算设备800中的至少一个处理器801用于执行调用计算机指令,以执行以下操作:
通过通信接口802接收来自N个受控设备的控制信号,其中,N为大于1的正整数,N个受控设备中的任意一个受控设备包含一个或多个域控制器,或者一个或多个功能域,或者一个或多个零部件;
根据控制信号确定N个受控设备各自对应的仿真环境;
根据N个受控设备各自对应的仿真环境,为N个受控设备各自对应的仿真环境分别分配处理器上的计算资源;其中,所述处理器被配置至少用于运行所述仿真环境,所述仿真环境用于根据所述计算资源进行仿真测试。
在一种可能的实施方式中,处理器801,具体用于:根据所述处理器的计算能力和所述N个受控设备各自对应的仿真环境,为所述N个受控设备各自对应的仿真环境分别分配处理器 上的计算资源。
示例性地,域控制器至少被配置用于控制受控于该域控制器的对象执行相应的操作,所述功能域至少被配置用于控制受控于该功能域的对象执行相应的操作。
示例性地,N个受控设备中的任意一个受控设备为被测车辆。
示例性地,所述N个受控设备各自对应的仿真环境包括所述N个受控设备各自对应的仿真模型。所述仿真环境对应一个或多个仿真模型,或者所述仿真环境是基于其所对应的一个或多个仿真模型实现的。所述处理器被配置至少用于运行所述仿真环境,包括所述处理器被配置至少用于运行所述仿真环境包括的仿真模型,所述仿真环境用于根据被分配的所述计算资源进行仿真测试。在本申请实施例中,所述仿真模型用于根据所述计算资源进行仿真测试,可以理解为:所述仿真模型用于仿真测试,所述仿真测试基于所述计算资源实现。
在一种可能的实施方式中,处理器801,具体用于:
确定N个受控设备各自对应的仿真模型在处理器上的运行时间;根据每一个仿真模型在处理器上的运行时间,确定N个受控设备各组对应的仿真模型所对应的目标单元,目标单元属于处理器,目标单元配置用于为所对应的仿真模型提供计算资源。
在一种可能的实施方式中,处理器801,具体用于:根据每一个所述仿真模型在所述处理器上的运行时间构建所述N个受控设备的第一损失函数;根据所述第一损失函数确定所述N个受控设备各自对应的仿真模型所对应的目标单元。在一种可能的实施方式中,N个受控设备中的任意一个受控设备对应的仿真模型的数量为一个或多个;处理器801,具体用于:
根据第一功能域中的仿真模型在处理器上的运行时间构建第一功能域的第二损失函数,第一功能域为至少一个功能域中的任意一个,任意一个受控设备对应的任意一个仿真模型属于至少一个功能域中的一个功能域;根据至少一个功能域各自的第二损失函数确定N个受控设备的第一损失函数。
在一种可能的实施方式中,处理器801,还可以用于:确定所述至少一个功能域。
在一种可能的实施方式中,处理器801,具体用于:
将N个受控设备的第一功能域中的仿真模型在处理器上的运行时间累加起来,构成第一功能域的第二损失函数。
在一种可能的实施方式中,处理器801,还可以用于:确定所述N个受控设备的所述第一功能域中的仿真模型。
在一种可能的实施方式中,处理器801,具体用于:
确定至少一个功能域中的每个功能域的第一权重;
根据至少一个功能域的每个功能域的第一权重和至少一个功能域各自的第二损失函数,确定N个受控设备的第一损失函数。
在一种可能的实施方式中,处理器801,具体用于:
确定第一损失函数的最小值;
将目标状态下的N个受控设备各自对应的仿真模型所对应的处理器核,作为N个受控设备各自对应的仿真模型对应的目标单元,目标状态为第一损失函数的最小值的状态。
在一种可能的实施方式中,处理器部署在本地设备或者云端设备。
应理解,相关描述还可以参见图5所示实施例中的描述,此处不再赘述。
本申请还提供了一种算机可读存储介质,所述计算机可读存储介质中存储有指令,当所述指令在至少一个处理器上运行时,实现前述的资源分配方法,例如图5所示的资源分配方 法。
本申请还提供了一种计算机程序产品,该计算机程序产品包括计算机指令,在被计算设备执行时,实现前述的资源分配方法,例如图5所示的资源分配方法。
本申请实施例中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本申请中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其他实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念。
本申请中实施例提到的“至少一个”是指一个或者多个,“多个”是指两个或两个以上。“以下至少一项(个)”或其类似表达,是指的这些项中的任意组合,包括单项(个)或复数项(个)的任意组合。例如,a、b、或c中的至少一项(个),可以表示:a、b、c、(a和b)、(a和c)、(b和c)、或(a和b和c),其中a、b、c可以是单个,也可以是多个。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A、同时存在A和B、单独存在B这三种情况,其中A、B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。
以及,除非有相反的说明,本申请实施例使用“第一”、“第二”等序数词是用于对多个对象进行区分,不用于限定多个对象的顺序、时序、优先级或者重要程度。例如,第一用户设备和第二用户设备,只是为了便于描述,而并不是表示这第一用户设备和第二用户设备的结构、重要程度等的不同,在某些实施例中,第一用户设备和第二用户设备还可以是同样的设备。
上述实施例中所用,根据上下文,术语“当……时”可以被解释为意思是“如果……”或“在……后”或“响应于确定……”或“响应于检测到……”。以上所述仅为本申请的可选实施例,并不用以限制本申请,凡在本申请的构思和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。

Claims (19)

  1. 一种资源分配方法,其特征在于,所述方法包括:
    接收来自N个受控设备的控制信号,其中,N为大于1的正整数,所述N个受控设备中的任意一个受控设备包含一个或多个域控制器;
    根据所述控制信号确定所述N个受控设备各自对应的仿真模型;
    根据处理器的计算能力和所述N个受控设备各自对应的仿真模型,为所述N个受控设备各自对应的仿真模型分别分配所述处理器上的计算资源;其中,所述仿真模型用于根据所述计算资源进行仿真测试。
  2. 根据权利要求1所述的方法,其特征在于,所述根据处理器的计算能力和所述N个受控设备各自对应的仿真模型,为所述N个受控设备各自对应的仿真模型分别分配所述处理器上的计算资源,包括:
    确定所述N个受控设备各自对应的仿真模型在所述处理器上的运行时间;
    根据每一个所述仿真模型在所述处理器上的运行时间构建所述N个受控设备的第一损失函数;
    根据所述第一损失函数确定所述N个受控设备各自对应的仿真模型所对应的目标单元,所述目标单元属于所述处理器,所述目标单元配置用于为所对应的仿真模型提供计算资源。
  3. 根据权利要求2所述的方法,其特征在于,所述N个受控设备中的任意一个受控设备对应的仿真模型的数量为一个或多个;所述根据每一个所述仿真模型在所述处理器上的运行时间构建所述N个受控设备的第一损失函数,包括:
    确定至少一个功能域,其中,所述任意一个受控设备对应的任意一个仿真模型属于所述至少一个功能域中的一个功能域;
    根据第一功能域中的仿真模型在所述处理器上的运行时间构建所述第一功能域的第二损失函数,所述第一功能域为所述至少一个功能域中的任意一个;
    根据所述至少一个功能域各自的第二损失函数确定所述N个受控设备的第一损失函数。
  4. 根据权利要求3所述的方法,其特征在于,所述根据第一功能域中的仿真模型在所述处理器上的运行时间构建所述第一功能域的第二损失函数,包括:
    确定所述N个受控设备的所述第一功能域中的仿真模型;
    将所述N个受控设备的所述第一功能域中的仿真模型在所述处理器上的运行时间累加起来,构成所述第一功能域的第二损失函数。
  5. 根据权利要求3或4所述的方法,其特征在于,所述根据所述多个功能域各自的第二损失函数确定所述N个受控设备的第一损失函数,包括:
    确定所述至少一个功能域中的每个功能域的第一权重;
    根据所述至少一个功能域的每个功能域的第一权重和所述至少一个功能域各自的第二损失函数,确定所述N个受控设备的第一损失函数。
  6. 根据权利要求2至5任一项所述的方法,其特征在于,所述根据所述第一损失函数确定所述N个受控设备各自对应的仿真模型所对应的目标单元,包括:
    确定所述第一损失函数的最小值;
    将目标状态下的所述N个受控设备各自对应的仿真模型所对应的处理器核,作为所述N个受控设备各自对应的仿真模型对应的目标单元,所述目标状态为所述第一损失函数的最小值的状态。
  7. 根据权利要求1至6任一项所述的方法,其特征在于,所述处理器部署在本地设备或者云端设备。
  8. 一种硬件在环测试设备,其特征在于,包括:
    通信单元,用于接收来自N个受控设备的控制信号,其中,N为大于1的正整数,所述N个受控设备中的任意一个受控设备包含一个或多个域控制器;
    处理单元,用于根据所述控制信号确定所述N个受控设备各自对应的仿真模型;
    所述处理单元,还用于根据处理器的计算能力和所述N个受控设备各自对应的仿真模型,为所述N个受控设备各自对应的仿真模型分别分配所述处理器上的计算资源;其中,所述仿真模型用于根据所述计算资源进行仿真测试。
  9. 根据权利要求8所述的设备,其特征在于,所述处理单元,具体用于:
    确定所述N个受控设备各自对应的仿真模型在所述处理器上的运行时间;
    根据每一个所述仿真模型在所述处理器上的运行时间构建所述N个受控设备的第一损失函数;
    根据所述第一损失函数确定所述N个受控设备各自对应的仿真模型所对应的目标单元,所述目标单元属于所述处理器,所述目标单元配置用于为所对应的仿真模型提供计算资源。
  10. 根据权利要求9所述的设备,其特征在于,所述N个受控设备中的任意一个受控设备对应的仿真模型的数量为一个或多个;所述处理单元,具体用于:
    确定至少一个功能域,其中,所述任意一个受控设备对应的任意一个仿真模型属于所述至少一个功能域中的一个功能域;
    根据第一功能域中的仿真模型在所述处理器上的运行时间构建所述第一功能域的第二损失函数,所述第一功能域为所述至少一个功能域中的任意一个;
    根据所述至少一个功能域各自的第二损失函数确定所述N个受控设备的第一损失函数。
  11. 根据权利要求10所述的设备,其特征在于,所述处理单元,具体用于:
    确定所述N个受控设备的所述第一功能域中的仿真模型;
    将所述N个受控设备的所述第一功能域中的仿真模型在所述处理器上的运行时间累加起来,构成所述第一功能域的第二损失函数。
  12. 根据权利要求10或11所述的设备,其特征在于,所述处理单元,具体用于:
    确定所述至少一个功能域中的每个功能域的第一权重;
    根据所述至少一个功能域的每个功能域的第一权重和所述至少功能域各自的第二损失函数,确定所述N个受控设备的第一损失函数。
  13. 根据权利要求9至12任一项所述的设备,其特征在于,所述处理单元,具体用于:
    确定所述第一损失函数的最小值;
    将目标状态下的所述N个受控设备各自对应的仿真模型所对应的处理器核,作为所述N个受控设备各自对应的仿真模型对应的目标单元,所述目标状态为所述第一损失函数的最小值的状态。
  14. 根据权利要求8至13任一项所述的设备,其特征在于,所述处理器部署在本地设备或者云端设备。
  15. 一种测试系统,其特征在于,所述系统包括:
    如权利要求8至14任一项所述的硬件在环测试设备;
    N个受控设备,通过接口板与所述硬件在环测试装置连接,其中,N为大于1的正整数,所述N个受控设备中的任意一个受控设备包含一个或多个域控制器。
  16. 一种计算设备,其特征在于,所述计算设备包括第二处理器和存储器;
    所述存储器中存储有计算机程序;
    所述第二处理器执行所述计算机程序时,所述计算设备执行如权利要求1至7中任一项所述的方法。
  17. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有指令,当所述指令在至少一个处理器上运行时,实现如权利要求1至7中任一项所述的方法。
  18. 一种芯片系统,其特征在于,所述芯片系统包括处理器和通信接口;
    所述通信接口用于接收和/或发送数据,和/或,所述通信接口用于为所述处理器提供输入和/或输出;
    所述处理器用于实现如权利要求1至7中任一项所述的方法。
  19. 一种计算机程序产品,其特征在于,所述计算机程序产品在至少一个处理器上运行时,实现如权利要求1至7中任一项所述的方法。
PCT/CN2021/130442 2021-11-12 2021-11-12 资源分配方法、hil测试设备及相关装置 WO2023082199A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202180102111.1A CN117940925A (zh) 2021-11-12 2021-11-12 资源分配方法、hil测试设备及相关装置
PCT/CN2021/130442 WO2023082199A1 (zh) 2021-11-12 2021-11-12 资源分配方法、hil测试设备及相关装置

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2021/130442 WO2023082199A1 (zh) 2021-11-12 2021-11-12 资源分配方法、hil测试设备及相关装置

Publications (1)

Publication Number Publication Date
WO2023082199A1 true WO2023082199A1 (zh) 2023-05-19

Family

ID=86334844

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/130442 WO2023082199A1 (zh) 2021-11-12 2021-11-12 资源分配方法、hil测试设备及相关装置

Country Status (2)

Country Link
CN (1) CN117940925A (zh)
WO (1) WO2023082199A1 (zh)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002342297A (ja) * 2001-05-16 2002-11-29 Nec Corp 分散シミュレーション制御装置
CN206224231U (zh) * 2016-11-01 2017-06-06 宝沃汽车(中国)有限公司 一种整车控制器vcu的hil测试系统
CN110502430A (zh) * 2019-07-12 2019-11-26 北京祥远通达科技有限公司 一种车用电控单元柔性hil测试中心及测试方法
CN110716536A (zh) * 2019-11-08 2020-01-21 重庆电子工程职业学院 一种基于5g低时延网络的纯电动汽车电机控制hil测试方法
CN111737153A (zh) * 2020-08-03 2020-10-02 宁波均联智行科技有限公司 车机的自动化测试方法及系统
CN112789619A (zh) * 2020-12-31 2021-05-11 华为技术有限公司 一种仿真场景的构建方法、仿真方法以及设备
CN113168370A (zh) * 2021-03-25 2021-07-23 华为技术有限公司 测试系统、车辆模拟装置、测试装置及测试方法

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002342297A (ja) * 2001-05-16 2002-11-29 Nec Corp 分散シミュレーション制御装置
CN206224231U (zh) * 2016-11-01 2017-06-06 宝沃汽车(中国)有限公司 一种整车控制器vcu的hil测试系统
CN110502430A (zh) * 2019-07-12 2019-11-26 北京祥远通达科技有限公司 一种车用电控单元柔性hil测试中心及测试方法
CN110716536A (zh) * 2019-11-08 2020-01-21 重庆电子工程职业学院 一种基于5g低时延网络的纯电动汽车电机控制hil测试方法
CN111737153A (zh) * 2020-08-03 2020-10-02 宁波均联智行科技有限公司 车机的自动化测试方法及系统
CN112789619A (zh) * 2020-12-31 2021-05-11 华为技术有限公司 一种仿真场景的构建方法、仿真方法以及设备
CN113168370A (zh) * 2021-03-25 2021-07-23 华为技术有限公司 测试系统、车辆模拟装置、测试装置及测试方法

Also Published As

Publication number Publication date
CN117940925A (zh) 2024-04-26

Similar Documents

Publication Publication Date Title
US20210334420A1 (en) Driving simulation method and apparatus, electronic device, and computer storage medium
CN112477781B (zh) 实现汽车中电子控制功能的系统、方法以及汽车
CN105922872B (zh) 车辆控制系统和车辆
KR20210139307A (ko) 차량 내 컴퓨팅 시스템을 위한 탄력적 컴퓨팅
CN213715751U (zh) 一种域控制器
CN110971453A (zh) 网络拓扑确定方法、装置、车辆网络拓扑结构及车辆
CN114021330A (zh) 一种仿真交通场景搭建方法及系统、智能体车辆控制方法
WO2022078067A1 (zh) 面向智能车辆的区域协同驾驶意图调度方法、系统和介质
JP2024510518A (ja) 端末アップグレード方法および装置
CN116409264A (zh) 车辆开发平台、域控制器、整车控制系统及车辆
WO2023082199A1 (zh) 资源分配方法、hil测试设备及相关装置
WO2023039804A1 (zh) 信号连接方法、信号连接装置及测试系统
CN112477782A (zh) 实现汽车中电子控制功能的系统、方法以及汽车
WO2021243602A1 (zh) 一种车辆控制系统和子控制单元
Senthilkumar et al. Designing multicore ECU architecture in vehicle networks using AUTOSAR
CN117076216A (zh) 通道分配方法及设备
CN111176121A (zh) 一种基于云平台的整车控制器优化系统及方法
CN115092068A (zh) 一种整车控制系统及车辆
CN115150787A (zh) 基于深度强化学习的能量管理策略包的部署系统及方法
Velusamy et al. Automotive sensor infrastructure-challenges and opportunities
US20220144290A1 (en) Information processing device, information processing method, non-transitory storage medium, and vehicle
CN115604322A (zh) 一种智能座舱域控制器及其控制方法、一种车辆
CN114253200A (zh) 基于车载与云端复合运算的车辆控制方法、电子设备和汽车
Perez et al. Benchmarking computational time of dynamic programming for autonomous vehicle powertrain control
CN112455364A (zh) 一种基于dds的整车电子电气系统

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21963647

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 202180102111.1

Country of ref document: CN