WO2022138218A1 - 車載コンピュータ、コンピュータ実行方法及びコンピュータプログラム - Google Patents

車載コンピュータ、コンピュータ実行方法及びコンピュータプログラム Download PDF

Info

Publication number
WO2022138218A1
WO2022138218A1 PCT/JP2021/045436 JP2021045436W WO2022138218A1 WO 2022138218 A1 WO2022138218 A1 WO 2022138218A1 JP 2021045436 W JP2021045436 W JP 2021045436W WO 2022138218 A1 WO2022138218 A1 WO 2022138218A1
Authority
WO
WIPO (PCT)
Prior art keywords
virtual
core
physical
operated
virtual device
Prior art date
Application number
PCT/JP2021/045436
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 US18/259,050 priority Critical patent/US20240054002A1/en
Priority to CN202180081774.XA priority patent/CN116569139A/zh
Publication of WO2022138218A1 publication Critical patent/WO2022138218A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • GPHYSICS
    • G07CHECKING-DEVICES
    • G07CTIME OR ATTENDANCE REGISTERS; REGISTERING OR INDICATING THE WORKING OF MACHINES; GENERATING RANDOM NUMBERS; VOTING OR LOTTERY APPARATUS; ARRANGEMENTS, SYSTEMS OR APPARATUS FOR CHECKING NOT PROVIDED FOR ELSEWHERE
    • G07C5/00Registering or indicating the working of vehicles
    • G07C5/008Registering or indicating the working of vehicles communicating information to a remotely located station
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/4557Distribution of virtual machine instances; Migration and load balancing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4411Configuring for operating with peripheral devices; Loading of device drivers
    • GPHYSICS
    • G07CHECKING-DEVICES
    • G07CTIME OR ATTENDANCE REGISTERS; REGISTERING OR INDICATING THE WORKING OF MACHINES; GENERATING RANDOM NUMBERS; VOTING OR LOTTERY APPARATUS; ARRANGEMENTS, SYSTEMS OR APPARATUS FOR CHECKING NOT PROVIDED FOR ELSEWHERE
    • G07C5/00Registering or indicating the working of vehicles
    • G07C5/08Registering or indicating performance data other than driving, working, idle, or waiting time, with or without registering driving, working, idle or waiting time
    • G07C5/0808Diagnosing performance data

Definitions

  • the present disclosure relates to an in-vehicle computer, a computer execution method, and a computer program.
  • This application claims priority based on Japanese Application No. 2020-213996 filed on December 23, 2020, and incorporates all the contents described in the Japanese application.
  • the vehicle is equipped with a plurality of electronic control units (ECUs: Electronic Control Units, hereinafter referred to as ECUs) connected to an in-vehicle network.
  • ECUs Electronic Control Units
  • ADAS advanced driver-assistance systems
  • the number of ECUs installed in vehicles has been increasing.
  • close cooperation between ECUs prepared for each function such as power train system, body system, chassis system, etc. is required. Therefore, it is considered to integrate and consolidate the functions of a plurality of ECUs mounted for each function into a specific in-vehicle computer.
  • the in-vehicle computer integrates the functions of various ECUs by generating each ECU as a virtual device using virtualization technology and executing a program for realizing the functions of each ECU on the virtual device (for example,).
  • Patent Document 1 The processor of the in-vehicle computer schedules a virtual device that reproduces a plurality of ECUs and a task related to a program on the virtual device, and switches and executes a task related to each virtual device.
  • the vehicle-mounted computer includes physical resources including a processor having a plurality of cores and a physical device having a register, and the vehicle-mounted computer that generates a plurality of virtual devices by allocating the physical resources in a time-divided manner.
  • the processor operates some of the virtual devices among the plurality of virtual devices periodically in each of the plurality of cores, and operates the other virtual devices irregularly. At least when the core that operates the other virtual device is stored and then the other virtual device is operated, the presence or absence of the change of the core that operates the other virtual device and the physical device.
  • the core on which the other virtual device is operated is determined based on the amount of change in the register value.
  • the computer execution method includes physical resources including a processor having a plurality of cores and a physical device having a register, and the physical resources are allocated in a time-divided manner to generate a plurality of virtual devices.
  • the in-vehicle computer periodically operates some of the virtual devices among the plurality of virtual devices in each of the plurality of cores at a predetermined cycle, and operates the other virtual devices irregularly, at least the other.
  • the core in which the virtual device is operated is stored and then the other virtual device is operated, whether or not the core in which the other virtual device is operated is changed and the amount of change in the register value of the physical device is changed. Based on the above, the core for operating the other virtual device is determined.
  • the computer program includes a physical resource including a processor having a plurality of cores and a physical device having a register, and the vehicle-mounted device that generates a plurality of virtual devices by allocating the physical resources in a time-divided manner.
  • the computer is made to operate a part of the virtual devices among the plurality of virtual devices periodically in each of the plurality of cores at a predetermined cycle, and operate the other virtual devices irregularly, at least the other virtual devices.
  • the core in which the virtual device is operated is stored and then the other virtual device is operated, the presence or absence of the change in the core in which the other virtual device is operated and the change amount of the register value of the physical device are determined. Based on the above, a process of determining the core for operating the other virtual device is executed.
  • the present application can not only be realized as an in-vehicle computer equipped with such a characteristic processor, but also can be realized as a computer execution method in which such characteristic processing is a step as described above, or such a step can be realized by a computer. It can be realized as a computer program to be executed by. Further, it can be realized as a semiconductor integrated circuit that realizes a part or all of an in-vehicle computer, or can be realized as another system including an in-vehicle computer.
  • the technique of selecting the core for operating the virtual device is not disclosed in consideration of the migration of the virtual device and the processing load of changing the register value of the physical device.
  • An object of the present disclosure is an in-vehicle computer capable of selecting a core for operating a virtual device, a computer execution method, and a computer execution method in consideration of the processing load related to the migration of the virtual device and the processing load for changing the register value of the physical device.
  • an in-vehicle computer a computer execution method, and a computer that can select a core for operating a virtual device in consideration of the processing load related to the migration of the virtual device and the processing load for changing the register value of the physical device.
  • a program can be provided.
  • the in-vehicle computer includes physical resources including a processor having a plurality of cores and a physical device having a register, and by allocating the physical resources in a time-divided manner, a plurality of virtual devices can be allocated.
  • the processor periodically operates some of the virtual devices among the plurality of virtual devices in each of the plurality of cores at a predetermined cycle, and irregularly operates the other virtual devices.
  • the core that has operated at least the other virtual device is stored and then the other virtual device is operated, the presence or absence of the change of the core that operates the other virtual device and the said.
  • the core that operates the other virtual device is determined based on the amount of change in the register value of the physical device.
  • the virtual device when the context switch of a virtual device that operates irregularly is executed, the virtual device is based on the presence or absence of a change in the core that operates the virtual device and the amount of change in the register value of the physical device.
  • the core on which the device operates can be determined. Therefore, it is possible to perform a context switch of the virtual device in consideration of the presence / absence of migration of the virtual device from one core to the other core, the amount of change in the register value of the physical device, that is, each process.
  • the in-vehicle computer preferably has a configuration in which the processor operates the partial virtual device in the predetermined cycle and then operates the other virtual device.
  • the virtual device that should be operated periodically at a predetermined cycle is operated first. Then, the processor determines the context switch destination of the virtual device that can be operated irregularly in consideration of the presence / absence of migration and the amount of change in the register value of the physical device in the state of the virtual device that was last operated. Can be done.
  • the in-vehicle computer includes a register value set in the physical device used by each of the plurality of virtual devices and information indicating the core in which the plurality of virtual devices are operated.
  • the processor includes a device configuration table, and the processor refers to the device configuration table and sums up the processing cost required for changing the register value of the physical device and the processing cost required for changing the core for operating the virtual device. It is preferable that the core having the minimum value is determined as the core for operating the other virtual device.
  • the switch destination can be determined.
  • the in-vehicle computer includes a storage unit that stores the processing time required for changing the register value of the physical device and the processing time required for changing the core for operating the virtual device.
  • the processor uses the other virtual device as the core in which the sum of the processing time required for changing the register value of the physical device and the processing time required for changing the core for operating the virtual device is minimized.
  • the configuration determined as the core to be operated is preferable.
  • the in-vehicle computer is a device that handles functions or data corresponding to ASIL (Automotive Safety Integrity Level), and the virtual device that is periodically operated is the virtual device that is operated irregularly. It is preferable that the device is a device that handles functions or data corresponding to the QM (Quality Management) level.
  • ASIL Automotive Safety Integrity Level
  • QM Quality Management
  • the processor periodically operates a virtual device that handles a function or data corresponding to ASIL, and operates a virtual device that handles a function or data corresponding to QM irregularly.
  • the processor executes the context switch of the virtual device that handles the function or data corresponding to the QM, the virtual device is based on the presence or absence of the change of the core that operates the virtual device and the change amount of the register value of the physical device. Determine the core that operates.
  • the computer execution method includes physical resources including a processor having a plurality of cores and a physical device having a register, and by allocating the physical resources in a time-divided manner, a plurality of virtual devices.
  • the in-vehicle computer that generates the above-mentioned virtual device operates a part of the virtual devices periodically in each of the plurality of cores at a predetermined cycle, and operates the other virtual devices irregularly.
  • the core in which the other virtual device is operated is stored and then the other virtual device is operated, the presence / absence of a change in the core in which the other virtual device is operated and the register value of the physical device are obtained. Based on the amount of change in, the core that operates the other virtual device is determined.
  • the computer program includes physical resources including a processor having a plurality of cores and a physical device having a register, and by allocating the physical resources in a time-divided manner, a plurality of virtual devices can be allocated.
  • some of the virtual devices among the plurality of virtual devices are periodically operated in each of the plurality of cores at a predetermined cycle, and the other virtual devices are operated irregularly at least.
  • the core in which the other virtual device is operated is stored and then the other virtual device is operated, the presence or absence of the change of the core in which the other virtual device is operated and the register value of the physical device are determined. Based on the amount of change, the process of determining the core that operates the other virtual device is executed.
  • FIG. 1 is a block diagram showing a network configuration of an in-vehicle communication system
  • FIG. 2 is a block diagram showing a configuration example of the in-vehicle communication system.
  • the in-vehicle communication system includes an in-vehicle computer 1, a plurality of individual ECUs 2, a device 3 connected to the individual ECU 2, an out-of-vehicle communication device 4, and a display device 5.
  • Each of the plurality of individual ECUs 2 is connected to the vehicle-mounted computer 1 by the vehicle-mounted communication line 121.
  • the in-vehicle computer 1 includes a multi-core processor 10, a storage unit 11, a communication unit 12, and an input / output I / F 13.
  • the in-vehicle computer 1 is also referred to as an integrated ECU.
  • the storage unit 11 is a non-volatile memory element such as a flash memory or an EEPROM (Electrically Erasable Programmable Read Only Memory).
  • the storage unit 11 includes a virtualized operating system (virtualized OS) 11a, a guest OS 11b, a control program 11c, a computer program (computer PG) 11d according to the present embodiment, a device configuration table 11e, a processing time information table 11f, and other processors 10. Stores various data required for operation.
  • the virtualization operating system 11a is, for example, a Hypervisor.
  • the virtualization operating system 11a has a function of constructing a plurality of virtual environments operating as a virtual device VM (see FIG. 4) on the virtualization operating system 11a.
  • the virtual environment that is, the virtual device VM includes a virtual processor, a virtual storage unit, a virtual communication unit, etc., in which physical resources including a processor 10, a storage unit 11, a communication unit 12, etc. are allocated in a time-division manner, and is a virtual ECU.
  • the plurality of virtual machine VMs have a priority regarding the execution of processing related to the device.
  • the storage unit 11 stores the priority of each virtual device VM.
  • the virtual machine VM which is responsible for processing that requires responsiveness, such as processing related to safety and processing related to events, has a high priority.
  • the virtual machine VM having a high priority operates periodically at a predetermined cycle. In other words, the high priority virtual machine VM operates in real time.
  • the virtual machine VM which is responsible for processing that does not require responsiveness, such as a function related to diagnostics, has a low priority.
  • the low priority virtual machine VM operates irregularly. In other words, the low priority virtual machine VM operates in non-real time.
  • the guest OS 11b is an OS for operating the virtual device VM generated by the virtualization operating system 11a.
  • the guest OS 11b is installed in a virtual device VM having virtual hardware and functions as a basic OS of the virtual device VM.
  • the guest OS 11b is, for example, AUTOSAR OS, Linux (registered trademark), Android (registered trademark), QNX (registered trademark), Ubuntu (registered trademark) and the like.
  • the control program 11c is a program that operates on the guest OS 11b of each virtual device VM, and is for reproducing the function of the ECU (not shown) integrated in the in-vehicle computer 1.
  • the virtual device VM reproduces the function of the actual physical ECU by operating the guest OS 11b and the control program 11c on these virtual hardware. That is, the virtual device VM operates like an ECU connected to the vehicle-mounted communication line 121.
  • the computer program 11d is a program for implementing the computer processing method according to the present embodiment.
  • the computer program 11d may be incorporated into the virtualization OS 11a. Details of the device configuration table 11e and the processing time information table 11f will be described later.
  • the various programs may be written in the storage unit 11 at the manufacturing stage of the in-vehicle computer 1, or the in-vehicle computer 1 acquires the various programs distributed from the external server device (not shown) and the storage unit 11. It may be a mode of writing in. Further, the vehicle-mounted computer 1 may read out the various programs recorded on a computer-readable recording medium such as a memory card or an optical disk and write them in the storage unit 11. As described above, the methods for providing the various programs may be provided in the form of distribution via the network, or may be provided in the form of being recorded on the recording medium.
  • the processor 10 reads and executes the virtualized operating system 11a, guest OS 11b, control program 11c, computer program 11d, device configuration table 11e, processing time information table 11f, etc. stored in the storage unit 11 to perform various calculations. Processing is performed, and the computer execution method according to the present embodiment is implemented.
  • the communication unit 12 is an Ethernet (registered trademark) PHY unit that communicates in accordance with a communication protocol such as 100BASE-T1 or 1000BASE-T1.
  • Ethernet registered trademark
  • the communication unit 12 includes CAN (Controller Area Network), CAN-FD, FlexRay (registered trademark), CXPI (Clock Extension Peripheral Interface), LIN (Local Interconnect Network), and the like. It may be a communication circuit that communicates with a communication protocol.
  • a plurality of individual ECUs 2 are connected to the communication unit 12 via an in-vehicle communication line 121 compliant with the above communication protocol. As shown in FIG.
  • the individual ECU 2 is an electronic control unit that controls the operation of the device 3 provided in a specific area such as the front right, the front left, the rear right, and the rear left of the vehicle C.
  • the device 3 is various sensors such as an in-vehicle camera that captures an image of the outside of the vehicle, a LIDAR (Light Detection And Ranging), and an in-vehicle camera.
  • the device 3 is an actuator that operates a door locking / unlocking device, a door mirror, a seat, and the like.
  • the device 3 may be an audio device that outputs entertainment-type images and sounds.
  • the device 3 may be an electronic control unit.
  • the control of the device 3 and various arithmetic processes by the individual ECU 2 can be configured to be executed on the in-vehicle computer 1. That is, the in-vehicle computer 1 can reproduce the ECU that controls the operation of the device 3 as a virtual device VM.
  • the input / output I / F 13 is an interface for communicating with the external communication device 4, the display device 5, and the like.
  • the out-of-vehicle communication device 4 and the display device 5 are connected to the input / output I / F 13 via a wire harness such as a serial cable.
  • the out-of-vehicle communication device 4 includes an antenna 40 for wireless communication, and communicates wirelessly through an internet communication network such as WiFi (registered trademark) and a mobile communication network such as 3G, LTE (registered trademark), 4G, and 5G. It is a device.
  • the out-of-vehicle communication device 4 is, for example, a telematics control unit (TCU).
  • TCU telematics control unit
  • the display device 5 is an HMI (Human Machine Interface) device such as a car navigation display.
  • the display device 5 displays data or information output from the processor 10 of the vehicle-mounted computer 1 via the input / output I / F 13.
  • FIG. 3 is a block diagram showing a configuration example of the processor 10.
  • the processor 10 includes a CPU (Central Processing Unit) 111, a RAM (Random Access Memory) 112, a first physical device 113a, a second physical device 113b, a third physical device 113c, and a timing unit 115, which are arithmetic units.
  • CPU Central Processing Unit
  • RAM Random Access Memory
  • the CPU 111 includes, for example, a first core 110a and a second core 110b.
  • the number of cores included in the CPU 111 is not particularly limited.
  • the first to third physical devices 113a, 113b, 113c are, for example, SCB (System Control Block), MPU (Memory Protection Unit), MMU (Memory Management Unit), MPC (Memory Protection Controller), other peripherals, and the like. ..
  • the first to third physical devices 113a, 113b, 113c have at least registers 114a, 114b, 114c for controlling the state of each device.
  • FIG. 4 illustrates a set of first to third physical devices 113a, 113b, 113c used by one core, for example, the first core 110a, but the processor 10 further includes a second core 110b. Includes another set of first to third physical devices 113a, 113b, 113c used by. That is, the processor 10 includes a plurality of physical devices used by each of the plurality of cores. Further, the number of physical devices included in the processor 10 is not particularly limited.
  • RAM 112 is an example of a volatile memory element.
  • the RAM 112 of the processor 10 that generated the virtual device VM stores the TCB (Task Control Block) and the device configuration table 11e.
  • the TCB includes context information related to the virtual machine VM.
  • the context information includes the state of the CPU 111 when a virtual device VM is operating and the control program 11c is being executed, that is, the value of the register of the CPU 111 (hereinafter, appropriately referred to as the register value of the CPU 111).
  • the RAM 112 stores context information of two virtual machines VM before and after the context switch is performed. That is, the RAM 112 stores the context information saved from the register of the CPU 111 at the time of the context switch and the context information restored to the register of the CPU 111. More specifically, the RAM 112 stores the context information of each of the first core 110a and the second core 110b. When operating the three virtual machine VMs, the RAM 112 stores the context information of the CPU 111 when controlling each virtual machine VM.
  • the device configuration table 11e will be described.
  • the values set in the registers 114a, 114b, 114c of the first to third physical devices 113a, 113b, 113c when each virtual device VM operates (hereinafter, the first to third physical devices 113a as appropriate). , 113b, and 113c are called register values.) Will be described.
  • the RAM 112 of FIG. 3 shows a state in which the device configuration table 11e stored by the storage unit 11 is read and stored.
  • FIG. 4 is a conceptual diagram of a virtual device VM generated by the in-vehicle computer 1
  • FIG. 5 is a conceptual diagram showing an example of a device configuration table 11e.
  • the virtualization operating system 11a creates three virtual machine VMs, for example, as shown in FIG.
  • the virtual device VM uses all or a part of the first to third physical devices 113a, 113b, 113c.
  • the values set in the registers 114a, 114b, 114c of the first to third physical devices 113a, 113b, 113c differ depending on the virtual device VM.
  • the three blocks shown below the blocks showing the first to third physical devices 113a, 113b, 113c are the register 114a of the first physical device 113a, the register 114b of the second physical device 113b, and the third physical in order from the lower side.
  • the value set in the register 114c of the device 113c is shown.
  • “VD: A_0” indicates a value “A_0” set in the register 114a of the first physical device 113a.
  • “VD: B_0” and “VD: B_1” indicate the values “B_0” and “B_1” set in the register 114b of the second physical device 113b.
  • VD: C_0 indicates the value “C_0” set in the register 114c of the third physical device 113c.
  • the blank block shown by the broken line indicates that the third physical device 113c is not used.
  • FIG. 4 shows three virtual machine VMs, the number of virtual machine VMs operating in the virtualized operating system 11a is not limited to three.
  • the device configuration table 11e shown in FIG. 5 has a “virtual device” column, a “first physical device” column, a “second physical device” column, a “third physical device” column, and a “core used in the previous execution” column. Is a table containing.
  • the "Virtual Device” column stores identification data VM [0], VM [1], VM [2] ... For identifying a plurality of virtual device VMs.
  • the virtual device VM indicated by the identification data VM [0] is referred to as a virtual device VM0
  • the virtual device VM indicated by the identification data VM [1] is referred to as a virtual device VM1
  • the virtual device VM indicated by the identification data VM [2] is referred to as a virtual device VM2. write.
  • the "first physical device” column stores whether or not the corresponding virtual machine VM uses the first physical device 113a, and if so, the value set in the register 114a. In the example shown in FIG. 5, all the virtual devices VM use the first physical device 113a, and the value set in the register 114a is the same “A_0”.
  • the "second physical device” column stores whether or not the corresponding virtual machine VM uses the second physical device 113b, and if so, the value set in the register 114b.
  • all the virtual devices VM use the second physical device 113b
  • the values set in the registers 114a and 114b of the virtual devices VM0 and VM1 are "B_0”
  • the value set in is "B_1”.
  • the "third physical device” column stores whether or not the corresponding virtual machine VM uses the third physical device 113c, and if so, the value set in the register 114c.
  • one virtual device VM2 uses the third physical device 113c
  • the value set in the register 114b of the virtual device VM2 is “C_0”. "Not applicable” indicates that the third physical device 113c is not used.
  • the "Core used in the previous execution" column stores information indicating the core in which the corresponding virtual machine VM last operated. For example, in the example shown in FIG. 5, information indicating that the virtual devices VM0 and VM1 operated in the first core 110a last time and the virtual device VM2 operated in the second core 110b last time is stored. At the time of the first execution, since the core executed last time does not exist, dummy data indicating that the core has been executed may be stored.
  • FIG. 6A and 6B are conceptual diagrams showing an example of the set values of the second physical device 113b.
  • FIG. 6A shows the value “B_1” set in the register 114b of the second physical device 113b
  • FIG. 6B shows the value “B_1” set in the register 114b of the second physical device 113b.
  • the "identifier (address)" indicates the address of the register 114b
  • the "set value” is a numerical value set in the register 114b specified by each address.
  • the processing time information table 11f shows the processing time required for migrating the virtual device VM operating in the first core 110a to the second core 110b, and the virtual device VM operating in the second core 110b in the first core 110a. Memorize the processing time required to migrate to. Further, the processing time information table 11f changes the register values of the first to third physical devices 113a, 113b, 113c when the virtual devices VM operating in the first core 110a or the second core 110b are switched to each other. Memorize the processing time required for.
  • FIG. 7 is a functional block diagram related to the processing of the context switch and the like of the embodiment.
  • the in-vehicle computer 1 includes a device setting storage unit 111a, a scheduler 111b, a device setting management unit 111c, an execution determination unit 111d, and a scheduling order determination unit 111e as functional units.
  • the device setting storage unit 111a is a functional unit that stores TCB or context information.
  • the device setting storage unit 111a stores the register values of the CPU 111 related to the virtual device VM, specifically, the register values of the first and second cores 110a and 110b related to the plurality of virtual devices VM as context information. More specifically, when the device setting storage unit 111a switches the virtual device VM operated by the CPU 111, the device setting storage unit 111a saves the value of the register of the first core 110a that controls the operating virtual device VM and uses it as context information.
  • the value of the register of the second core 110b that controlled the virtual device VM in operation is saved and stored as context information.
  • the device setting storage unit 111a stores the context information stored in the device setting storage unit 111a, that is, the value of the register of the CPU 111 related to the virtual device VM that is operated next by the context switch, in detail. Returns the register values of the first and second cores 110a and 110b.
  • the main hardware constituting the device setting storage unit 111a is the RAM 112.
  • the scheduler 111b is a functional unit that manages the allocation and switching of hardware resources of the CPU 111 to the virtual machine VM.
  • the scheduler 111b is a functional unit that manages the order in which a plurality of virtual devices VMs are assigned to the first core 110a or the second core 110b and context-switched to execute them.
  • the first and second cores 110a and 110b execute the processing related to each assigned virtual machine VM.
  • the process related to the virtual device VM includes a process of emulating a virtual processor, a virtual storage unit, a virtual communication unit, and the like constituting the virtual device VM, a process of operating a guest OS 11b, a control program 11c, and the like.
  • the scheduler 111b switches the virtual machine VM so that the processing related to the virtual machine VM that requires responsiveness is periodically executed at a predetermined cycle.
  • the virtual device VM that requires responsiveness is, for example, a device that handles functions or data corresponding to ASIL (Automotive Safety Integrity Level) based on the functional safety standard for automobiles (ISO26262).
  • ASIL Automotive Safety Integrity Level
  • the scheduler 111b sets the virtual machine VM so that the processing related to the virtual machine VM that does not require responsiveness is executed irregularly on the first and second cores 110a and 110b having sufficient processing capacity. Switch. That is, if the first and second cores 110a and 110b can afford to operate another virtual device VM after operating the virtual device VM that requires responsiveness within a predetermined cycle, the virtual machine that does not require responsiveness is virtual. Operate the device VM.
  • the virtual device VM that does not require responsiveness is, for example, a device that handles functions or data corresponding to the QM (Quality Management) level based on the functional safety standard for automobiles.
  • the scheduler 111b gives the first virtual device information and the second virtual device information related to the first and second cores 110a and 110b to the execution determination unit 111d. Further, the scheduler 111b uses the second virtual device information related to the first and second cores 110a and 110b to inquire of the device setting storage unit 111a for the context information of the virtual device VM indicated by the second virtual device information, and the device. Acquires the context information output from the setting storage unit 111a. The scheduler 111b gives the acquired context information to the device setting management unit 111c.
  • the main hardware constituting the scheduler 111b is the CPU 111 and the timing unit 115.
  • the execution determination unit 111d acquires the first virtual device information and the second virtual device information given from the scheduler 111b, refers to the device configuration table 11e based on the acquired first and second virtual device information, and first. And the set values of the registers 114a, 114b, 114c of the first to third physical devices 113a, 113b, 113c associated with the virtual device VM before the context switch and after the context switch related to the second core 110a, 110b are read out.
  • the execution determination unit 111d switches the virtual device VMs of the first and second cores 110a and 110b
  • the execution determination unit 111d changes the set values of the registers 114a, 114b and 114c of the first to third physical devices 113a, 113b and 113c. It is determined whether or not it is necessary, and device information based on the determination result is given to the device setting tube.
  • the device information includes information indicating that the setting change is unnecessary.
  • the device information is the first to third physical devices for which the set values need to be changed. Includes identifiers and set values for registers 114a, 114b, 114c of devices 113a, 113b, 113c.
  • the main hardware constituting the execution determination unit 111d is the CPU 111.
  • the device setting management unit 111c acquires the context information given from the scheduler 111b, saves the register values of the CPU 111, that is, the first and second cores 110a and 110b, and restores the acquired context information. That is, the device setting management unit 111c sets the device by using the register values of the first and second cores 110a and 110b before the context switch as context information of the first and second cores 110a and 110b related to the operating virtual device VM.
  • the context information acquired from the scheduler 111b after being stored in the storage unit 111a, that is, the register values of the first and second cores 110a and 110b related to the virtual device VM after the context switch are stored in the first and second cores 110a and 110b.
  • the device setting management unit 111c acquires the device information given from the execution determination unit 111d, and when the acquired device information indicates that the setting change is unnecessary, the first to third physical devices 113a, 113b, 113c The processing related to the context switch is terminated without changing the settings of the registers 114a, 114b, and 114c of.
  • the CPU 111 immediately starts executing the process related to the virtual device VM after the context switch without rewriting the registers 114a, 114b, 114c of the first to third physical devices 113a, 113b, 113c.
  • the acquired device information indicates the identifier and the setting value of the registers 114a, 114b, 114c of the specific first to third physical devices 113a, 113b, 113c whose setting needs to be changed.
  • the set values of the registers 114a, 114b, 114c of the first to third physical devices 113a, 113b, 113c are changed by using the identifier and the set value.
  • the CPU 111 rewrites the registers of the CPU 111 and the registers 114a, 114b, 114c of the specific first to third physical devices 113a, 113b, 113c that require setting changes, and executes the processing related to the virtual device VM after the context switch.
  • the device setting management unit 111c executes the process related to the change of the register value of the first to third physical devices 113a, 113b, 113c for each of the first and second cores 110a, 110b. Further, the device setting management unit 111c provides identification data indicating the virtual device VM operating in the first core 110a and the second core 110b before the context switch, and information indicating the core in which each virtual device VM is operating. Write to the device configuration table 11e in association with each other.
  • the main hardware constituting the device setting management unit 111c is the CPU 111.
  • the scheduling order determination unit 111e refers to the device configuration table 11e and the processing time information table 11f, and determines the switching order of the virtual device VM to be allocated the hardware resources of the CPU 111 in a time-division manner. Specifically, the scheduling order determination unit 111e determines whether or not there is migration between the first and second cores 110a and 110b for all candidates of the switching order of the virtual device VM, and the first virtual machine VM before and after the context switch uses. It is determined whether or not the settings of the first to third physical devices 113a, 113b, 113c need to be changed.
  • the scheduling order determination unit 111e refers to the processing time information table 11f, and the sum of the processing time related to the change of the register values of the first to third physical devices 113a, 113b, 113c and the processing time related to migration is the minimum.
  • the switching order of the virtual device VM is specified.
  • the scheduling order determination unit 111e gives the scheduler 111b schedule information indicating the switching order of the determined virtual machine VM.
  • the scheduler 111b acquires the schedule information output from the scheduling order determination unit 111e, and executes a process of switching the virtual device VM according to the switching order of the virtual machine VM indicated by the acquired schedule information.
  • the first is Considering the processing load related to the change of the register values of the 1st to 3rd physical devices 113a, 113b, 113c and the processing load related to migration, the virtual machine VM is scheduled so that the processing load becomes small, and efficiently. You can switch.
  • FIG. 8 is a flowchart showing a scheduling processing procedure
  • FIG. 9 is an explanatory diagram showing a state during scheduling
  • FIG. 10 is a chart showing a relationship between processing loads
  • FIG. 11 is an explanatory diagram showing a scheduling method.
  • a virtual device VM (hereinafter, referred to as a virtual device VMa) that operates irregularly, the processor 10 executes the following processing.
  • horizontal arrows indicate the flow of time.
  • VM0, VM1, VM2, and VM3 indicate virtual devices VM that are assigned to the first and second cores 110a and 110b and require responsiveness, and the processing related to each device is periodically executed at predetermined intervals. It shows that it is made to do.
  • the first core 110a executes the processing related to the two virtual devices VM represented by VM0 and VM2 at predetermined intervals.
  • the second core 110b executes the processing related to the two virtual devices VM represented by VM1 and VM3 at predetermined intervals.
  • the hatched portion indicates the process related to the setting change of the register value of the context switch of the virtual device VM and the first to third physical devices 113a, 113b, 113c.
  • the virtual device VMa is a virtual machine VM that is assigned irregularly to the first and second cores 110a and 110b that have the capacity to execute processing and is not required to have responsiveness.
  • the first and second cores 110a and 110b both have spare capacity, it is necessary to determine and schedule which core the virtual device VMa should be executed.
  • the processor 10 substitutes 1 for the core number N, which is a variable (step S111).
  • the processor 10 determines whether or not the variable N is equal to or less than the number of cores of the processor 10 (step S112).
  • the processor 10 considers the processing load related to the migration of the virtual device VM and the setting change of the first to third physical devices 113a, 113b, 113c.
  • the processing time of the context switch and the like is calculated (step S113).
  • the processor 10 needs to change the presence / absence of migration and the register values of the first to third physical devices 113a, 113b, 113c by referring to the device configuration table 10e. It is possible to specify whether or not. Then, the processor 10 specifies the processing time required for migration and change of the register value setting by referring to the processing time information table 11f, and is the total processing time required for the context switch to the first core 110a or the second core 110b. Can be calculated as the processing time of a context switch or the like.
  • the processor 10 determines whether or not the context processing time calculated in step S113 is the shortest (step S114).
  • the processor 10 executes the processes of steps S112 to S116 for each of a plurality of cores to calculate the context processing time, and in step S114, the context processing time calculated this time is repeatedly processed so far. It is determined whether or not the context processing time is the shortest of the calculated context processing times.
  • step S114 When it is determined that the context processing time is the shortest (step S114: YES), the processor 10 selects the first core 110a or the second core 110b indicated by the variable N, and then the core of the context switch destination for executing the virtual device VM. (Step S115).
  • step S115 When the processing of step S115 is completed, or when it is determined in step S114 that the processing time of the context switch or the like is not the shortest (step S114: NO), the processor 10 increments the variable N by 1 and returns the processing to step S112. ..
  • step S112 When it is determined in step S112 that the variable N is not less than or equal to the number of cores (step S112: NO), the processor 10 determines the core having the shortest processing time such as the context switch as the core of the context switch destination (step S117). ). Then, the processor 10 schedule-registers the first core 110a or the second core 110b of the context switch destination of the virtual device VM (step S118), and ends the process.
  • the processing time of the context switch or the like to the first core 110a is T1
  • the processing time of the context switch or the like to the second core 110b is T2.
  • T1 is larger than T2.
  • the units and expression methods of T1 and T2 are not particularly limited as long as they are data indicating the length of the processing time, and if the processing times can be compared, it is necessary to store the absolute value of the processing time. do not have.
  • the processor 10 selects the second core 110b, which has the shortest context switch processing time, as the core of the context switch destination, and registers the schedule. Executing the virtual device VMa on the second core 110b has a smaller processing load and enables efficient context switching.
  • the total processing time for changing the register values of the first to third physical devices 113a, 113b, and 113c and migrating is the sum.
  • the context switch destination of the virtual device VM can be efficiently determined so as to be the shortest.
  • the size of the processing cost may be evaluated and the core of the context switch destination may be determined. For example, when both migration and device setting change are required, the processing load is evaluated as the maximum. If both migration and device setting change are unnecessary, the processing load is evaluated as the minimum. If either migration or device setting change is required, evaluate that the processing load is medium. However, the processing load when device setting change is not required and migration is required is evaluated to be smaller than the processing load when migration is not required and device setting change is required.
  • the processor 10 can evaluate the magnitude of the processing load and determine the core of the context switch destination based on a predetermined rule.
  • the processor 10 periodically operates the high-priority virtual device VM at a predetermined cycle, and for the low-priority virtual device VM, whether or not there is migration, and the first to third physical devices 113a, 113b, 113c.
  • the context switch destination of the virtual machine VM can be determined in consideration of the amount of change in the register value.
  • the processor 10 refers to the device configuration table 11e to change the processing cost required for changing the register values of the first to third physical devices 113a, 113b, 113c and the change of the core for operating the virtual device VM. It is possible to determine the context switch destination that minimizes the sum of the required processing costs.
  • the processor 10 minimizes the sum of the processing time required for changing the register values of the first to third physical devices 113a, 113b, 113c and the processing time required for changing the core for operating the virtual device VM. You can determine the context switch destination.
  • Hypervisor-type virtualization operating system 11a an example of constructing a virtual environment using a Hypervisor-type virtualization operating system 11a has been described, but host OS-type virtualization software, that is, virtualization software that operates on a basic OS is used. You may build a virtual environment.
  • the register values of the first to third physical devices 113a, 113b, 113c used by the plurality of virtual devices VM are dynamically set. It may be something to change.
  • the processor 10 saves the register values of the first to third physical devices 113a, 113b, 113c when performing the context switch, and sets the previously saved setting values in the registers 114a, 114b, 114c. It is good to restore by doing.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Memory System Of A Hierarchy Structure (AREA)
  • Stored Programmes (AREA)
  • Hardware Redundancy (AREA)

Abstract

複数のコアを有するプロセッサ及びレジスタを有する物理デバイスを含む物理リソースを備え、物理リソースを時分割して割り当てることにより、複数の仮想装置を生成する車載コンピュータは、プロセッサは、複数の仮想装置のうち一部の仮想装置を複数のコアそれぞれに所定周期で定期的に動作させると共に、他の仮想装置を非定期的に動作させ、他の仮想装置を動作させたコアを記憶し、他の仮想装置を動作させるコアの変更の有無と、物理デバイスのレジスタ値の変更量とに基づいて、他の仮想装置を動作させるコアを決定する。

Description

車載コンピュータ、コンピュータ実行方法及びコンピュータプログラム
 本開示は、車載コンピュータ、コンピュータ実行方法及びコンピュータプログラムに関する。
 本出願は、2020年12月23日出願の日本出願第2020-213796号に基づく優先権を主張し、前記日本出願に記載された全ての記載内容を援用するものである。
 車両には、車載ネットワークに接続された複数の電子制御ユニット(ECU:Electronic Control Unit、以下、ECUと呼ぶ。)が搭載されている。近年、先進運転支援システム(ADAS: Advanced Driver-Assistance Systems)、自動運転技術、人工知能技術の導入等、車両の高機能化に伴い、車両に搭載されるECUは増加傾向にある。また、パワー・トレーン系、ボディ系、シャシー系等の機能別に用意されたECU間の密接な連携が必要になってきている。
 そこで、機能別に搭載されていた複数のECUの機能を特定の車載コンピュータに統合及び集約することが考えられている。車載コンピュータは、例えば仮想化技術を用いて各ECUを仮想装置として生成し、各ECUの機能を実現するためのプログラムを仮想装置上で実行することにより、各種ECUの機能を統合する(例えば、特許文献1)。
 車載コンピュータのプロセッサは、複数のECUを再現する仮想装置、当該仮想装置上のプログラムに係るタスクをスケジューリングし、各仮想装置に係るタスクを切り替えて実行している。
特開2019-139453号公報
 本開示の一態様に係る車載コンピュータは、複数のコアを有するプロセッサ及びレジスタを有する物理デバイスを含む物理リソースを備え、該物理リソースを時分割して割り当てることにより、複数の仮想装置を生成する車載コンピュータであって、前記プロセッサは、前記複数の仮想装置のうち一部の前記仮想装置を前記複数のコアそれぞれに所定周期で定期的に動作させると共に、他の前記仮想装置を非定期的に動作させ、少なくとも前記他の仮想装置を動作させた前記コアを記憶し、次に前記他の仮想装置を動作させる場合、前記他の仮想装置を動作させる前記コアの変更の有無と、前記物理デバイスのレジスタ値の変更量とに基づいて、前記他の仮想装置を動作させる前記コアを決定する。
 本開示の一態様に係るコンピュータ実行方法は、複数のコアを有するプロセッサ及びレジスタを有する物理デバイスを含む物理リソースを備え、該物理リソースを時分割して割り当てることにより、複数の仮想装置を生成する車載コンピュータは、前記複数の仮想装置のうち一部の前記仮想装置を前記複数のコアそれぞれに所定周期で定期的に動作させると共に、他の前記仮想装置を非定期的に動作させ、少なくとも前記他の仮想装置を動作させた前記コアを記憶し、次に前記他の仮想装置を動作させる場合、前記他の仮想装置を動作させる前記コアの変更の有無と、前記物理デバイスのレジスタ値の変更量とに基づいて、前記他の仮想装置を動作させる前記コアを決定する。
 本開示の一態様に係るコンピュータプログラムは、複数のコアを有するプロセッサ及びレジスタを有する物理デバイスを含む物理リソースを備え、該物理リソースを時分割して割り当てることにより、複数の仮想装置を生成する車載コンピュータに、前記複数の仮想装置のうち一部の前記仮想装置を前記複数のコアそれぞれに所定周期で定期的に動作させると共に、他の前記仮想装置を非定期的に動作させ、少なくとも前記他の仮想装置を動作させた前記コアを記憶し、次に前記他の仮想装置を動作させる場合、前記他の仮想装置を動作させる前記コアの変更の有無と、前記物理デバイスのレジスタ値の変更量とに基づいて、前記他の仮想装置を動作させる前記コアを決定する処理を実行させる。
 なお、本願は、このような特徴的なプロセッサを備える車載コンピュータとして実現することができるだけでなく、上記の通り、かかる特徴的な処理をステップとするコンピュータ実行方法として実現したり、かかるステップをコンピュータに実行させるためのコンピュータプログラムとして実現したりすることができる。また、車載コンピュータの一部又は全部を実現する半導体集積回路として実現したり、車載コンピュータを含むその他のシステムとして実現したりすることができる。
車載通信システムのネットワーク構成を示すブロック図である。 車載通信システムの構成例を示すブロック図である。 プロセッサの構成例を示すブロック図である。 車載コンピュータによって生成される仮想装置の概念図である。 デバイス構成テーブルの一例を示す概念図である。 第2物理デバイスの設定値の一例を示す概念図である。 第2物理デバイスの設定値の一例を示す概念図である。 コンテキストスイッチ等処理に係る機能ブロック図である。 スケジューリング処理手順を示すフローチャートである。 スケジューリング途中の状態を示す説明図である。 処理負荷の関係を示す図表である。 スケジューリング方法を示す説明図である。
[本開示が解決しようとする課題]
 ECUが複数コアのプロセッサを搭載している場合、特に非定期的に動作する仮想装置をいずれのコアで動作させるべきかを選択する必要がある。一般的に仮想装置を前回動作させた一のコアから他のコアへマイグレーションする場合、処理負荷が発生する。また、ECUに搭載されるような組み込みプロセッサにおいては、動作する仮想装置を切り替える場合、SCB(System Control Block)、MPU(Memory Protection Unit)、MMU(Memory Management Unit)、又はMPC(Memory Protection Controller)、その他ペリフェラル等の複数の物理デバイスの状態、つまり物理デバイスのレジスタ値も変更する必要があり、処理負荷が発生する。
 しかしながら、従来技術においては、仮想装置のマイグレーション及び物理デバイスのレジスタ値を設定変更する処理負荷を考慮して、仮想装置を動作させるコアを選択する技術は開示されていない。
 本開示の目的は、仮想装置のマイグレーションに係る処理負荷、物理デバイスのレジスタ値を設定変更する処理負荷を考慮して、仮想装置を動作させるコアを選択することができる車載コンピュータ、コンピュータ実行方法及びコンピュータプログラムを提供することにある。
[本開示の効果]
 上記によれば、仮想装置のマイグレーションに係る処理負荷、物理デバイスのレジスタ値を設定変更する処理負荷を考慮して、仮想装置を動作させるコアを選択することができる車載コンピュータ、コンピュータ実行方法及びコンピュータプログラムを提供することができる。
[本開示の実施形態の説明]
 最初に本開示の実施態様を列記して説明する。また、以下に記載する実施形態の少なくとも一部を任意に組み合わせてもよい。
(1)本開示の一態様に係る車載コンピュータは、複数のコアを有するプロセッサ及びレジスタを有する物理デバイスを含む物理リソースを備え、該物理リソースを時分割して割り当てることにより、複数の仮想装置を生成する車載コンピュータであって、前記プロセッサは、前記複数の仮想装置のうち一部の前記仮想装置を前記複数のコアそれぞれに所定周期で定期的に動作させると共に、他の前記仮想装置を非定期的に動作させ、少なくとも前記他の仮想装置を動作させた前記コアを記憶し、次に前記他の仮想装置を動作させる場合、前記他の仮想装置を動作させる前記コアの変更の有無と、前記物理デバイスのレジスタ値の変更量とに基づいて、前記他の仮想装置を動作させる前記コアを決定する。
 本態様にあっては、非定期的に動作する仮想装置のコンテキストスイッチを実行する際、仮想装置を動作させるコアの変更の有無と、物理デバイスのレジスタ値の変更量とに基づいて、当該仮想装置を動作させるコアを決定することができる。
 従って、一のコアから他のコアへの仮想装置のマイグレーションの有無、物理デバイスのレジスタ値の変更量、つまりそれぞれの処理を考慮した仮想装置のコンテキストスイッチが可能である。
(2)本開示の一態様に係る車載コンピュータは、前記プロセッサは、前記所定周期において前記一部の仮想装置を動作させた後、前記他の仮想装置を動作させるようにしてある構成が好ましい。
 本態様にあっては、所定周期で定期的に動作させるべき仮想装置を先に動作させる。そして、プロセッサは、最後に動作した仮想装置の状態において、マイグレーションの有無、物理デバイスのレジスタ値の変更量を考慮し、非定期的に動作させることができる仮想装置のコンテキストスイッチ先を決定することができる。
(3)本開示の一態様に係る車載コンピュータは、前記複数の仮想装置それぞれが使用する前記物理デバイスに設定するレジスタ値と、前記複数の仮想装置を動作させた前記コアを示す情報とを含むデバイス構成テーブルを備え、前記プロセッサは、前記デバイス構成テーブルを参照して、前記物理デバイスのレジスタ値の変更に要する処理コストと、前記仮想装置を動作させる前記コアの変更に要する処理コストとの総和が最小となる前記コアを、前記他の仮想装置を動作させる前記コアとして決定する構成が好ましい。
 本態様にあっては、デバイス構成テーブルを参照することによって、物理デバイスのレジスタ値の変更に要する処理コストと、仮想装置を動作させる前記コアの変更に要する処理コストとの総和が最小となるコンテキストスイッチ先を決定することができる。
(4)本開示の一態様に係る車載コンピュータは、前記物理デバイスのレジスタ値の変更に要する処理時間と、前記仮想装置を動作させる前記コアの変更に要する処理時間とを記憶する記憶部を備え、前記プロセッサは、前記物理デバイスのレジスタ値の変更に要する処理時間と、前記仮想装置を動作させる前記コアの変更に要する処理時間との総和が最小となる前記コアを、前記他の仮想装置を動作させる前記コアとして決定する構成が好ましい。
 本態様にあっては、物理デバイスのレジスタ値の変更に要する処理時間と、仮想装置を動作させるコアの変更に要する処理時間との総和が最小となるコンテキストスイッチ先を決定することができる。
(5)本開示の一態様に係る車載コンピュータは、定期的に動作させる前記仮想装置はASIL(Automotive Safety Integrity Level)に該当する機能又はデータを扱う装置であり、非定期的に動作させる前記仮想装置はQM(Quality Management)レベルに該当する機能又はデータを扱う装置である構成が好ましい。
 本態様にあっては、プロセッサは、ASILに該当する機能又はデータを扱う仮想装置を定期的に動作させると共に、QMに該当する機能又はデータを扱う仮想装置を非定期的に動作させる。プロセッサは、QMに該当する機能又はデータを扱う仮想装置のコンテキストスイッチを実行する際、仮想装置を動作させるコアの変更の有無と、物理デバイスのレジスタ値の変更量とに基づいて、当該仮想装置を動作させるコアを決定する。
(6)本開示の一態様に係るコンピュータ実行方法は、複数のコアを有するプロセッサ及びレジスタを有する物理デバイスを含む物理リソースを備え、該物理リソースを時分割して割り当てることにより、複数の仮想装置を生成する車載コンピュータは、前記複数の仮想装置のうち一部の前記仮想装置を前記複数のコアそれぞれに所定周期で定期的に動作させると共に、他の前記仮想装置を非定期的に動作させ、少なくとも前記他の仮想装置を動作させた前記コアを記憶し、次に前記他の仮想装置を動作させる場合、前記他の仮想装置を動作させる前記コアの変更の有無と、前記物理デバイスのレジスタ値の変更量とに基づいて、前記他の仮想装置を動作させる前記コアを決定する。
 本態様によれば、態様(1)同様、一のコアから他のコアへの仮想装置のマイグレーションの有無、物理デバイスのレジスタ値の変更量を考慮した仮想装置のコンテキストスイッチが可能である。
(7)本開示の一態様に係るコンピュータプログラムは、複数のコアを有するプロセッサ及びレジスタを有する物理デバイスを含む物理リソースを備え、該物理リソースを時分割して割り当てることにより、複数の仮想装置を生成する車載コンピュータに、前記複数の仮想装置のうち一部の前記仮想装置を前記複数のコアそれぞれに所定周期で定期的に動作させると共に、他の前記仮想装置を非定期的に動作させ、少なくとも前記他の仮想装置を動作させた前記コアを記憶し、次に前記他の仮想装置を動作させる場合、前記他の仮想装置を動作させる前記コアの変更の有無と、前記物理デバイスのレジスタ値の変更量とに基づいて、前記他の仮想装置を動作させる前記コアを決定する処理を実行させる。
 本態様によれば、態様(1)同様、一のコアから他のコアへの仮想装置のマイグレーションの有無、物理デバイスのレジスタ値の変更量を考慮した仮想装置のコンテキストスイッチが可能である。
[本開示の実施形態の詳細]
 本開示の実施形態に係る車載システムを構成する車載コンピュータ、コンピュータ実行方法及びコンピュータプログラム、以下に図面を参照しつつ説明する。なお、本発明はこれらの例示に限定されるものではなく、請求の範囲によって示され、請求の範囲と均等の意味及び範囲内でのすべての変更が含まれることが意図される。また、以下に記載する実施形態の少なくとも一部を任意に組み合わせてもよい。
 以下、本開示をその実施形態を示す図面に基づいて具体的に説明する。図1は車載通信システムのネットワーク構成を示すブロック図、図2は車載通信システムの構成例を示すブロック図である。
 本実施形態に係る車載通信システムは、車載コンピュータ1と、複数の個別ECU2と、当該個別ECU2に接続された機器3と、車外通信装置4と、表示装置5とを備える。複数の個別ECU2はそれぞれ車載通信線121にて車載コンピュータ1に接続されている。
 車載コンピュータ1は、マルチコアのプロセッサ10、記憶部11、通信部12、及び入出力I/F13を備える。車載コンピュータ1は、統合ECUとも称される。
 記憶部11は、フラッシュメモリ又はEEPROM(Electrically Erasable Programmable Read Only Memory)等の不揮発性のメモリ素子である。記憶部11は、仮想化オペレーティングシステム(仮想化OS)11a、ゲストOS11b、制御プログラム11c、本実施形態に係るコンピュータプログラム(コンピュータPG)11d、デバイス構成テーブル11e、処理時間情報テーブル11fその他プロセッサ10の動作に必要な各種データを記憶する。
 仮想化オペレーティングシステム11aは、例えばHypervisorである。仮想化オペレーティングシステム11aは、当該仮想化オペレーティングシステム11a上に、仮想装置VM(図4参照)として動作する複数の仮想環境を構築する機能を有する。仮想環境、即ち仮想装置VMは、プロセッサ10、記憶部11、通信部12等を含む物理リソースを時分割して割り当ててなる仮想プロセッサ、仮想記憶部、仮想通信部等を含み、仮想的なECUのハードウェアとして動作する。
 複数の仮想装置VMは、当該装置に係る処理の実行に関する優先度を有する。記憶部11は各仮想装置VMの優先度を記憶している。安全性に関する処理、イベントに係る処理等、応答性が要求される処理を担う仮想装置VMは高い優先度を有する。優先度が高い仮想装置VMは、所定周期で定期的に動作する。言い換えると、優先度が高い仮想装置VMは、リアルタイムで動作する。
 ダイアグに関する機能等、応答性が要求されない処理を担う仮想装置VMは低い優先度を有する。優先度が低い仮想装置VMは、非定期的に動作する。言い換えると、優先度が低い仮想装置VMは、非リアルタイムで動作する。
 ゲストOS11bは、仮想化オペレーティングシステム11aによって生成された仮想装置VMを動作させるためのOSである。ゲストOS11bは、仮想的ハードウェアを有する仮想装置VMにインストールされ、仮想装置VMの基本OSとして機能する。ゲストOS11bは、例えば、AUTOSAR OS、Linux(登録商標)、Android(登録商標)、QNX(登録商標)、Ubuntu(登録商標)等である。
 制御プログラム11cは、各仮想装置VMのゲストOS11b上で動作するプログラムであり、車載コンピュータ1に統合されたECU(不図示)の機能を再現するためのものである。
 仮想装置VMはこれらの仮想ハードウェア上でゲストOS11b及び制御プログラム11cを動作させることによって、実物の物理的なECUの機能を再現する。つまり、仮想装置VMは、車載通信線121に接続されたECUのように動作する。
 コンピュータプログラム11dは、本実施形態に係るコンピュータ処理方法を実施するためのプログラムである。なお、コンピュータプログラム11dは、仮想化OS11aに組み込んでもよい。デバイス構成テーブル11e及び処理時間情報テーブル11fの詳細は後述する。
 なお、上記各種プログラムは、車載コンピュータ1の製造段階において記憶部11に書き込まれる態様でもよいし、外部サーバ装置(不図示)から配信された上記各種プログラムを車載コンピュータ1が取得して記憶部11に書き込む態様であってもよい。また、メモリカード又は光ディスク等のコンピュータ読み取り可能な記録媒体に記録された上記各種プログラムを車載コンピュータ1が読み出して記憶部11に書き込む態様であってもよい。
 上記各種プログラムの提供方法は、上記の通り、ネットワークを介した配信の態様で提供されてもよいし、記録媒体に記録された態様で提供されてもよい。
 プロセッサ10は、記憶部11に記憶された仮想化オペレーティングシステム11a、ゲストOS11b、制御プログラム11c、コンピュータプログラム11d、デバイス構成テーブル11e、処理時間情報テーブル11f等を読み出して実行することにより、種々の演算処理を行い、本実施形態に係るコンピュータ実行方法を実施する。
 通信部12は、例えば、100BASE-T1又は1000BASE-T1等の通信プロトコルに準拠して通信を行うイーサネット(登録商標)PHY部である。なお、イーサネット(登録商標)は一例であり、通信部12は、CAN(Controller Area Network)、CAN-FD、FlexRay(登録商標)、CXPI(Clock Extension Peripheral Interface)、LIN(Local Interconnect Network)等の通信プロトコルで通信を行う通信回路であってもよい。
 通信部12には、上記通信プロトコルに準拠した車載通信線121を介して複数の個別ECU2が接続されている。個別ECU2は、例えば図1に示すように、車両Cの右前、左前、右後、左後等、特定のエリアに設けられた機器3の動作を制御する電子制御ユニットである。機器3は、車外を撮像する車載カメラ、LIDAR(Light Detection And Ranging)、車内カメラ等の各種センサである。また機器3は、ドアの施解錠装置、ドアミラー、シート等を動作させるアクチュエータである。機器3は、エンターテイメント系の画像、音声を出力するオーディオ装置であっても良い。機器3は、電子制御ユニットであっても良い。
 個別ECU2による機器3の制御及び各種演算処理は車載コンピュータ1側で実行されるように構成することができる。つまり、車載コンピュータ1は、機器3の動作を制御するECUを、仮想装置VMとして再現させることができる。
 入出力I/F13は、車外通信装置4及び表示装置5等と通信するためのインタフェースである。車外通信装置4及び表示装置5は、シリアルケーブル等のワイヤーハーネスを介して入出力I/F13に接続されている。
 車外通信装置4は、無線通信を行うためのアンテナ40を備え、WiFi(登録商標)等のインターネット通信ネットワーク、3G、LTE(登録商標)、4G、5G等のモバイル通信ネットワークを通じて無線通信を行う通信装置である。車外通信装置4は、例えばテレマティクス制御ユニット(TCU)である。なお、本実施形態は車外通信装置4と車載コンピュータ1が別体であるものとして説明するが、車載コンピュータ1が車外通信装置4の構成ないし機能を有するように構成しても良い。
 表示装置5は、例えばカーナビゲーションのディスプレイ等のHMI(Human Machine Interface)装置である。表示装置5は、車載コンピュータ1のプロセッサ10から入出力I/F13を介して出力されたデータ又は情報を表示する。
 図3は、プロセッサ10の構成例を示すブロック図である。プロセッサ10は、演算装置であるCPU(Central Processing Unit)111、RAM(Random Access Memory)112、第1物理デバイス113a、第2物理デバイス113b、第3物理デバイス113c、及び計時部115を備える。
 CPU111は、例えば第1コア110a及び第2コア110bを備える。なお、CPU111が備えるコアの数は特に限定されるものでは無い。
 第1~第3物理デバイス113a,113b,113cは、例えば、SCB(System Control Block)、MPU(Memory Protection Unit)、MMU(Memory Management Unit)、又はMPC(Memory Protection Controller)、その他ペリフェラル等である。第1~第3物理デバイス113a,113b,113cは、少なくとも各デバイスの状態を制御するためのレジスタ114a,114b,114cを有する。
 作図の便宜上、図4では一つのコア、例えば第1コア110aが使用する一組の第1~第3物理デバイス113a,113b,113cを図示しているが、プロセッサ10は、更に第2コア110bが使用する他の一組の第1~第3物理デバイス113a,113b,113cを備える。つまり、プロセッサ10は、複数のコアそれぞれが使用する複数の物理デバイスを備える。
 また、プロセッサ10が備える物理デバイスの数は特に限定されるものでは無い。
 RAM112は揮発性のメモリ素子の一例である。仮想装置VMを生成したプロセッサ10のRAM112は、TCB(Task Control Block)及びデバイス構成テーブル11eを記憶する。
 TCBは、仮想装置VMに係るコンテキスト情報を含む。コンテキスト情報は、ある仮想装置VMが動作し、制御プログラム11cを実行しているときのCPU111の状態、即ちCPU111のレジスタの値(以下、適宜CPU111のレジスタ値と呼ぶ。)を含む。例えば、RAM112は、コンテキストスイッチが行われる前後の2つの仮想装置VMのコンテキスト情報を記憶する。つまり、RAM112は、コンテキストスイッチの際にCPU111のレジスタから退避されたコンテキスト情報と、CPU111のレジスタに復元するコンテキスト情報とを記憶する。より詳細には、RAM112は、第1コア110a及び第2コア110bそれぞれのコンテキスト情報を記憶する。なお、3つの仮想装置VMを動作させる際、RAM112は、各仮想装置VMを制御していたときのCPU111のコンテキスト情報を記憶する。
 デバイス構成テーブル11eについて説明する。本実施形態では、各仮想装置VMが動作するときの第1~第3物理デバイス113a,113b,113cのレジスタ114a,114b,114cに設定される値(以下、適宜第1~第3物理デバイス113a,113b,113cのレジスタ値と呼ぶ。)が固定的である場合を説明する。図3のRAM112は、記憶部11が記憶するデバイス構成テーブル11eを読み出して記憶した状態を示している。
 図4は、車載コンピュータ1によって生成される仮想装置VMの概念図、図5はデバイス構成テーブル11eの一例を示す概念図である。仮想化オペレーティングシステム11aは、例えば図4に示すように、3つの仮想装置VMを生成する。仮想装置VMは、第1~第3物理デバイス113a,113b,113cの全部又は一部を使用する。第1~第3物理デバイス113a,113b,113cのレジスタ114a,114b,114cに設定される値は、仮想装置VMによって異なる。第1~第3物理デバイス113a,113b,113cを示すブロックの下側に示す3つのブロックは、下側から順に第1物理デバイス113aのレジスタ114a、第2物理デバイス113bのレジスタ114b、第3物理デバイス113cのレジスタ114cに設定される値を示している。
 図4中、「VD:A_0」は、第1物理デバイス113aのレジスタ114aに設定される値「A_0」を示している。「VD:B_0」及び「VD:B_1」は、第2物理デバイス113bのレジスタ114bに設定される値「B_0」及び「B_1」を示している。「VD:C_0」は、第3物理デバイス113cのレジスタ114cに設定される値「C_0」を示している。破線で示された空白のブロックは、第3物理デバイス113cが使用されないことを示している。
 なお、図4には3つの仮想装置VMを図示しているが、仮想化オペレーティングシステム11aで動作する仮想装置VMの数は3つに限定されるものではない。
 図5に示すデバイス構成テーブル11eは、「仮想装置」列、「第1物理デバイス」列、「第2物理デバイス」列、「第3物理デバイス」列、「前回の実行で使用したコア」列を含むテーブルである。「仮想装置」列は、複数の仮想装置VMを識別するための識別データVM[0]、VM[1]、VM[2]…を格納している。以下、識別データVM[0]が示す仮想装置VMを仮想装置VM0、識別データVM[1]が示す仮想装置VMを仮想装置VM1、識別データVM[2]が示す仮想装置VMを仮想装置VM2と表記する。
 「第1物理デバイス」列は、該当する仮想装置VMが第1物理デバイス113aを使用するか否か、使用する場合、レジスタ114aに設定される値を格納する。図5に示す例では、全ての仮想装置VMが第1物理デバイス113aを使用し、レジスタ114aに設定される値は同じ「A_0」である。
 「第2物理デバイス」列は、該当する仮想装置VMが第2物理デバイス113bを使用するか否か、使用する場合、レジスタ114bに設定される値を格納する。図5に示す例では、全ての仮想装置VMが第2物理デバイス113bを使用しており、仮想装置VM0,VM1のレジスタ114a,114bに設定される値は「B_0」、仮想装置VM2のレジスタ114cに設定される値は「B_1」である。
 「第3物理デバイス」列は、該当する仮想装置VMが第3物理デバイス113cを使用するか否か、使用する場合、レジスタ114cに設定される値を格納する。図5に示す例では、一つの仮想装置VM2が第3物理デバイス113cを使用しており、仮想装置VM2のレジスタ114bに設定される値は「C_0」である。「該当無し」は、第3物理デバイス113cが使用されないことを示している。
 「前回の実行で使用したコア」列は、該当する仮想装置VMが前回動作したコアを示す情報を格納する。例えば、図5に示す例では、仮想装置VM0,VM1は前回、第1コア110aで動作し、仮想装置VM2は前回、第2コア110bで動作したことを示す情報が格納されている。
 なお、初回実行時においては、前回実行したコアが存在しないため、所定のコアで実行されたことを示すダミーデータを格納すればよい。
 図6A及び図6Bは、第2物理デバイス113bの設定値の一例を示す概念図である。図6Aは、第2物理デバイス113bのレジスタ114bに設定される値「B_0」を示し、図6Bは、第2物理デバイス113bのレジスタ114bに設定される値「B_1」を示している。「識別子(アドレス)」は、レジスタ114bのアドレスを示し、「設定値」は、各アドレスで指定されたレジスタ114bに設定される数値である。
 次に処理時間情報テーブル11fについて説明する。処理時間情報テーブル11fは、第1コア110aで動作していた仮想装置VMを第2コア110bへマイグレーションするために要する処理時間、第2コア110bで動作していた仮想装置VMを第1コア110aへマイグレーションするために要する処理時間を記憶する。
 また、処理時間情報テーブル11fは、第1コア110a又は第2コア110bで動作する仮想装置VMを相互に切り替える際に、第1~第3物理デバイス113a,113b,113cのレジスタ値を変更するために要する処理時間を記憶する。
 図7は実施形態のコンテキストスイッチ等処理に係る機能ブロック図である。車載コンピュータ1は、機能部としてのデバイス設定記憶部111a、スケジューラ111b、デバイス設定管理部111c、実行判定部111d、スケジューリング順序決定部111eを備える。
 デバイス設定記憶部111aは、TCB又はコンテキスト情報を記憶する機能部である。デバイス設定記憶部111aは、仮想装置VMに係るCPU111のレジスタ値、詳細には複数の仮想装置VMに係る第1及び第2コア110a,110bのレジスタ値をコンテキスト情報として記憶する。より具体的には、デバイス設定記憶部111aは、CPU111で動作させる仮想装置VMを切り替える際、動作中の仮想装置VMを制御していた第1コア110aのレジスタの値を退避し、コンテキスト情報として記憶する。同様に、動作中の仮想装置VMを制御していた第2コア110bのレジスタの値を退避し、コンテキスト情報として記憶する。
 デバイス設定記憶部111aは、スケジューラ111bからの問合せに対して、デバイス設定記憶部111aが記憶するコンテキスト情報、つまり、コンテキストスイッチによって次に動作する仮想装置VMに係るCPU111のレジスタの値、詳細には第1及び第2コア110a,110bのレジスタ値を返す。デバイス設定記憶部111aを構成する主なハードウェアはRAM112である。
 スケジューラ111bは、仮想装置VMに対するCPU111のハードウェア資源の割当及び切り替えを管理する機能部である。言い換えると、スケジューラ111bは、複数の仮想装置VMを第1コア110a又は第2コア110bに割り当てコンテキストスイッチして実行する順序を管理する機能部である。
 第1及び第2コア110a,110bは割り当てられた各仮想装置VMに係る処理を実行する。仮想装置VMに係る処理には、仮想装置VMを構成する仮想プロセッサ、仮想記憶部、仮想通信部等をエミュレートする処理、ゲストOS11b、制御プログラム11cを動作させる処理等が含まれる。
 スケジューラ111bは、応答性が要求される仮想装置VMに係る処理が、所定周期で定期的に実行されるように、仮想装置VMを切り替える。応答性が要求される仮想装置VMは、例えば自動車用機能安全規格(ISO26262)に基づくASIL(Automotive Safety Integrity Level)に該当する機能又はデータを扱う装置である。
 一方、スケジューラ111bは、応答性が要求されない仮想装置VMに係る処理については、処理能力に余裕がある第1及び第2コア110a,110bで非定期的に実行されるように、仮想装置VMを切り替える。つまり、第1及び第2コア110a,110bは応答性が要求される仮想装置VMを所定周期内で動作させた後、他の仮想装置VMを動作させる余裕がある場合、応答性が要求されない仮想装置VMを動作させる。応答性が要求されない仮想装置VMは、例えば自動車用機能安全規格に基づくQM(Quality Management)レベルに該当する機能又はデータを扱う装置である。
 以下、コンテキストスイッチ前の仮想装置VM、つまり動作中の仮想装置VMを示す情報を第1仮想装置情報と呼び、コンテキストスイッチ後の仮想装置VM、つまり次に動作させる仮想装置VMを示す情報を第2仮想装置情報と呼ぶ。
 スケジューラ111bは、第1及び第2コア110a,110bに係る第1仮想装置情報及び第2仮想装置情報を実行判定部111dに与える。また、スケジューラ111bは、第1及び第2コア110a,110bに係る第2仮想装置情報を用いて、当該第2仮想装置情報が示す仮想装置VMのコンテキスト情報をデバイス設定記憶部111aに問い合わせ、デバイス設定記憶部111aから出力されるコンテキスト情報を取得する。スケジューラ111bは、取得したコンテキスト情報をデバイス設定管理部111cに与える。
 なお、スケジューラ111bを構成する主なハードウェアはCPU111及び計時部115である。
 実行判定部111dは、スケジューラ111bから与えられた第1仮想装置情報及び第2仮想装置情報を取得し、取得した第1及び第2仮想装置情報に基づいてデバイス構成テーブル11eを参照し、第1及び第2コア110a,110bに係るコンテキストスイッチ前及びコンテキストスイッチ後の仮想装置VMに対応付けられた第1~第3物理デバイス113a,113b,113cのレジスタ114a,114b,114cの設定値を読み出す。そして、実行判定部111dは、第1及び第2コア110a,110bの仮想装置VMを切り替える際、第1~第3物理デバイス113a,113b,113cのレジスタ114a,114b,114cの設定値を変更する必要があるか否かを判定し、判定結果に基づくデバイス情報をデバイス設定管部に与える。
 第1~第3物理デバイス113a,113b,113cのレジスタ114a,114b,114cの設定値を変更する必要が無いと判定された場合、デバイス情報は、設定変更不要であることを示す情報を含む。第1~第3物理デバイス113a,113b,113cのレジスタ114a,114b,114cの設定値を変更する必要があると判定された場合、デバイス情報は、設定値の変更を要する第1~第3物理デバイス113a,113b,113cのレジスタ114a,114b,114cの識別子及び設定値を含む。なお、実行判定部111dを構成する主なハードウェアはCPU111である。
 デバイス設定管理部111cは、スケジューラ111bから与えられたコンテキスト情報を取得し、CPU111、即ち第1及び第2コア110a,110bのレジスタ値を退避させ、取得したコンテキスト情報を復元する。つまり、デバイス設定管理部111cは、コンテキストスイッチ前の第1及び第2コア110a,110bのレジスタ値を動作中の仮想装置VMに係る第1及び第2コア110a,110bのコンテキスト情報として、デバイス設定記憶部111aに記憶させ、次いで、スケジューラ111bから取得したコンテキスト情報、つまりコンテキストスイッチ後の仮想装置VMに係る第1及び第2コア110a,110bのレジスタ値を、第1及び第2コア110a,110bのレジスタに設定することによって、コンテキスト情報を復元する。
 デバイス設定管理部111cは、実行判定部111dから与えられたデバイス情報を取得し、取得したデバイス情報が設定変更不要であることを示している場合、第1~第3物理デバイス113a,113b,113cのレジスタ114a,114b,114cの設定変更を行わずに、コンテキストスイッチに係る処理を終了する。CPU111は、第1~第3物理デバイス113a,113b,113cのレジスタ114a,114b,114cを書き換えることなく、直ちにコンテキストスイッチ後の仮想装置VMに係る処理の実行を開始する。
 一方、デバイス設定管理部111cは、取得したデバイス情報が、設定変更が必要な特定の第1~第3物理デバイス113a,113b,113cのレジスタ114a,114b,114cの識別子及び設定値を示している場合、当該識別子及び設定値を用いて、第1~第3物理デバイス113a,113b,113cのレジスタ114a,114b,114cの設定値を変更する。CPU111は、当該CPU111のレジスタと、設定変更を要する特定の第1~第3物理デバイス113a,113b,113cのレジスタ114a,114b,114cを書き換え、コンテキストスイッチ後の仮想装置VMに係る処理の実行を開始する。
 デバイス設定管理部111cは第1~第3物理デバイス113a,113b,113cのレジスタ値の変更に係る処理を第1及び第2コア110a,110b毎に実行する。
 また、デバイス設定管理部111cは、コンテキストスイッチ前に第1コア110a及び第2コア110bで動作していた仮想装置VMを示す識別データと、各仮想装置VMを動作させていたコアを示す情報を対応付けてデバイス構成テーブル11eに書き込む。
 なお、デバイス設定管理部111cを構成する主なハードウェアはCPU111である。
 スケジューリング順序決定部111eは、デバイス構成テーブル11e及び処理時間情報テーブル11fを参照し、CPU111のハードウェア資源を時分割して割り当てるべき仮想装置VMの切り替え順序を決定する。
 具体的には、スケジューリング順序決定部111eは、仮想装置VMの切り替え順序の全ての候補について、第1及び第2コア110a,110b間のマイグレーションの有無、コンテキストスイッチ前後の仮想装置VMが使用する第1~第3物理デバイス113a,113b,113cの設定変更の要否を判定する。そして、スケジューリング順序決定部111eは、処理時間情報テーブル11fを参照し、第1~第3物理デバイス113a,113b,113cのレジスタ値の変更に係る処理時間及びマイグレーションに係る処理時間の総和が最小となる仮想装置VMの切り替え順序を特定する。そして、スケジューリング順序決定部111eは、決定した仮想装置VMの切り替え順序を示すスケジュール情報をスケジューラ111bに与える。
 スケジューラ111bは、スケジューリング順序決定部111eから出力されたスケジュール情報を取得し、取得したスケジュール情報が示す仮想装置VMの切り替え順序に従って、仮想装置VMを切り替える処理を実行する。
 以上の通り、デバイス設定記憶部111a、スケジューラ111b、デバイス設定管理部111c、実行判定部111d及びスケジューリング順序決定部111eによれば、仮想装置VMを切り替えて、CPU111のハードウェア資源を割り当てる際、第1~第3物理デバイス113a,113b,113cのレジスタ値の変更に係る処理負荷と、マイグレーションに係る処理負荷とを考慮し、当該処理負荷が小さくなるように仮想装置VMのスケジューリングし、効率的に切り替えることができる。
 図8は、スケジューリング処理手順を示すフローチャート、図9は、スケジューリング途中の状態を示す説明図、図10は、処理負荷の関係を示す図表、図11は、スケジューリング方法を示す説明図である。
 プロセッサ10は、非定期的に動作する仮想装置VM(以下、仮想装置VMaと呼ぶ)を動作させる場合、以下の処理を実行する。図10中、横向き矢印は時間の流れを示している。VM0、VM1、VM2、VM3は、第1及び第2コア110a,110bに割り当てられた応答性が要求される仮想装置VMを示しており、各装置に係る処理が所定周期毎に定期的に実行させることを示している。第1コア110aは、所定周期毎にVM0及びVM2で示された2つの仮想装置VMに係る処理を実行している。第2コア110bは、所定周期毎にVM1及びVM3で示された2つの仮想装置VMに係る処理を実行している。
 ハッチングが付された部分は、仮想装置VMのコンテキストスイッチ、第1~第3物理デバイス113a,113b,113cのレジスタ値の設定変更に係る処理を示している。
 仮想装置VMaは、処理を実行する余力がある第1及び第2コア110a,110bに対して非定期的に割り当てられる応答性が要求されない仮想装置VMである。図9においては、第1及び第2コア110a,110bは、いずれも余力を有するため、仮想装置VMaをいずれのコアで実行すべきかを決定し、スケジューリングする必要がある。
 以下、仮想装置VMaのコンテキストスイッチ先を決定する処理を説明する。まずプロセッサ10は、変数であるコア番号Nに1を代入する(ステップS111)。次いで、プロセッサ10は、変数Nがプロセッサ10のコア数以下であるか否かを判定する(ステップS112)。変数Nがコア数以下であると判定した場合(ステップS112:YES)、プロセッサ10は、仮想装置VMのマイグレーション及び第1~第3物理デバイス113a,113b,113cの設定変更に係る処理負荷を考慮したコンテキストスイッチ等処理時間を算出する(ステップS113)。
 具体的には、プロセッサ10は、デバイス構成テーブル10eを参照することによって、図10に示すように、マイグレーションの有無と、第1~第3物理デバイス113a,113b,113cのレジスタ値の変更の要否を特定することができる。そしてプロセッサ10は、処理時間情報テーブル11fを参照することによって、マイグレーション及びレジスタ値の設定変更に要する処理時間を特定し、第1コア110a又は第2コア110bへのコンテキストスイッチに要する処理時間の総和を、コンテキストスイッチ等処理時間として算出することができる。
 そして、プロセッサ10は、ステップS113で算出したコンテキスト処理時間が、最短であるか否かを判定する(ステップS114)。プロセッサ10は、ステップS112~ステップS116の処理を複数のコア毎に実行してコンテキスト処理時間を算出するようにしてあり、ステップS114では、今回算出されたコンテキスト処理時間が、これまでに繰り返し処理で算出されたコンテキスト処理時間のうち最短のコンテキスト処理時間であるか否かを判定する。
 最短のコンテキスト処理時間であると判定した場合(ステップS114:YES)、プロセッサ10は、変数Nが示す第1コア110a又は第2コア110bを、次に仮想装置VMを実行するコンテキストスイッチ先のコアとして一次記憶する(ステップS115)。
 ステップS115の処理を終えた場合、又はステップS114においてコンテキストスイッチ等処理時間が最短で無いと判定した場合(ステップS114:NO)、プロセッサ10は、変数Nを1インクリメントし、処理をステップS112へ戻す。
 ステップS112において、変数Nがコア数以下で無いと判定した場合(ステップS112:NO)、プロセッサ10は、コンテキストスイッチ等処理時間が最短であるコアを、コンテキストスイッチ先のコアとして決定する(ステップS117)。そして、プロセッサ10は、仮想装置VMのコンテキストスイッチ先の第1コア110a又は第2コア110bをスケジュール登録し(ステップS118)、処理を終える。
 図10に示す例では、第1コア110aへのコンテキストスイッチ等処理時間はT1、第2コア110bへのコンテキストスイッチ等処理時間はT2である。一例として、ここではT1がT2より大きいものとする。なお、T1及びT2は、処理時間の長短を示すデータであれば、その単位及び表現方法は特に限定されるものではなく、処理時間を比較することができれば処理時間の絶対値を格納する必要はない。
 この場合、プロセッサ10は、コンテキストスイッチ処理時間が最短である第2コア110bをコンテキストスイッチ先のコアとして選択し、スケジュール登録する。仮想装置VMaを第2コア110bで実行する方が処理負荷が小さく、効率的にコンテキストスイッチを行うことができる。
 以上の通り、実施形態に係る車載コンピュータ1、コンピュータ実行方法及びコンピュータプログラム11dによれば、第1~第3物理デバイス113a,113b,113cのレジスタ値を設定変更及びマイグレーションに係る処理時間の総和が最短になるように効率的に仮想装置VMのコンテキストスイッチ先を決定することができる。
 なお、本実施形態では、処理時間情報テーブル11fを参照して、第1~第3物理デバイス113a,113b,113cの設定変更及びマイグレーションの処理に要する処理時間を算出する例を説明したが、デバイス構成テーブル11eの情報に基づいて、処理コストの大きさを評価し、コンテキストスイッチ先のコアを決定するように構成してもよい。
 例えば、マイグレーション及びデバイス設定変更の双方が必要な場合、処理負荷が最大と評価する。マイグレーション及びデバイス設定変更の双方が不要な場合、処理負荷が最小と評価する。マイグレーション及びデバイス設定変更の一方が必要な場合、処理負荷が中程度であると評価する。ただし、デバイス設定変更は不要でマイグレーションが必要である場合の処理負荷は、マイグレーションが不要でデバイス設定変更は必要である場合の処理負荷より小さいものと評価する。プロセッサ10は、所定のルールベースで、処理負荷の大きさを評価し、コンテキストスイッチ先のコアを決定することができる。
 また、プロセッサ10は優先度が高い仮想装置VMを所定周期で定期的に動作させた上、優先度が低い仮想装置VMについて、マイグレーションの有無、第1~第3物理デバイス113a,113b,113cのレジスタ値の変更量を考慮し、仮想装置VMのコンテキストスイッチ先を決定することができる。
 更に、プロセッサ10は、デバイス構成テーブル11eを参照することによって、第1~第3物理デバイス113a,113b,113cのレジスタ値の変更に要する処理コストと、仮想装置VMを動作させる前記コアの変更に要する処理コストとの総和が最小となるコンテキストスイッチ先を決定することができる。
 更にまた、プロセッサ10は、第1~第3物理デバイス113a,113b,113cのレジスタ値の変更に要する処理時間と、仮想装置VMを動作させるコアの変更に要する処理時間との総和が最小となるコンテキストスイッチ先を決定することができる。
 なお、本実施形態では、Hypervisor型の仮想化オペレーティングシステム11aを用いて仮想環境を構築する例を説明したが、ホストOS型の仮想化ソフトウェア、即ち基本OS上で動作する仮想化ソフトウェアを用いて仮想環境を構築しても良い。
 また、実施形態では、デバイス構成テーブル11eの内容が固定的である場合を説明したが、複数の仮想装置VMが使用する第1~第3物理デバイス113a,113b,113cのレジスタ値は動的に変更するものであってもよい。この場合、プロセッサ10は、コンテキストスイッチを行う際に、第1~第3物理デバイス113a,113b,113cのレジスタ値を退避し、前回退避しておいた設定値をレジスタ114a,114b,114cに設定することで復元するとよい。
 1 車載コンピュータ
 2 個別ECU
 3 機器
 4 車外通信装置
 5 表示装置
 10 プロセッサ
 110a 第1コア
 110b 第2コア
 11 記憶部
 11a 仮想化オペレーティングシステム
 11b ゲストOS
 11c 制御プログラム
 11d コンピュータプログラム
 11e デバイス構成テーブル
 11f 処理時間情報テーブル
 12 通信部
 13 入出力I/F
 40 アンテナ
 111 CPU
 111a デバイス設定記憶部
 111b スケジューラ
 111c デバイス設定管理部
 111d 実行判定部
 111e スケジューリング順序決定部
 112 RAM
 112a デバイス構成テーブル
 113a 第1物理デバイス
 113b 第2物理デバイス
 113c 第3物理デバイス
 114a,114b,114c レジスタ
 115 計時部
 121 車載通信線
 VM 仮想装置
 C 車両

Claims (7)

  1.  複数のコアを有するプロセッサ及びレジスタを有する物理デバイスを含む物理リソースを備え、該物理リソースを時分割して割り当てることにより、複数の仮想装置を生成する車載コンピュータであって、
     前記プロセッサは、
     前記複数の仮想装置のうち一部の前記仮想装置を前記複数のコアそれぞれに所定周期で定期的に動作させると共に、他の前記仮想装置を非定期的に動作させ、
     少なくとも前記他の仮想装置を動作させた前記コアを記憶し、
     次に前記他の仮想装置を動作させる場合、前記他の仮想装置を動作させる前記コアの変更の有無と、前記物理デバイスのレジスタ値の変更量とに基づいて、前記他の仮想装置を動作させる前記コアを決定する
     車載コンピュータ。
  2.  前記プロセッサは、
     前記所定周期において前記一部の仮想装置を動作させた後、前記他の仮想装置を動作させるようにしてある
     請求項1に記載の車載コンピュータ。
  3.  前記複数の仮想装置それぞれが使用する前記物理デバイスに設定するレジスタ値と、前記複数の仮想装置を動作させた前記コアを示す情報とを含むデバイス構成テーブルを備え、
     前記プロセッサは、
     前記デバイス構成テーブルを参照して、前記物理デバイスのレジスタ値の変更に要する処理コストと、前記仮想装置を動作させる前記コアの変更に要する処理コストとの総和が最小となる前記コアを、前記他の仮想装置を動作させる前記コアとして決定する
     請求項1又は請求項2に記載の車載コンピュータ。
  4.  前記物理デバイスのレジスタ値の変更に要する処理時間と、前記仮想装置を動作させる前記コアの変更に要する処理時間とを記憶する記憶部を備え、
     前記プロセッサは、
     前記物理デバイスのレジスタ値の変更に要する処理時間と、前記仮想装置を動作させる前記コアの変更に要する処理時間との総和が最小となる前記コアを、前記他の仮想装置を動作させる前記コアとして決定する
     請求項1から請求項3のいずれか1項に記載の車載コンピュータ。
  5.  定期的に動作させる前記仮想装置はASIL(Automotive Safety Integrity Level)に該当する機能又はデータを扱う装置であり、
     非定期的に動作させる前記仮想装置はQM(Quality Management)レベルに該当する機能又はデータを扱う装置である
     請求項1から請求項4のいずれか1項に記載の車載コンピュータ。
  6.  複数のコアを有するプロセッサ及びレジスタを有する物理デバイスを含む物理リソースを備え、該物理リソースを時分割して割り当てることにより、複数の仮想装置を生成する車載コンピュータは、
     前記複数の仮想装置のうち一部の前記仮想装置を前記複数のコアそれぞれに所定周期で定期的に動作させると共に、他の前記仮想装置を非定期的に動作させ、
     少なくとも前記他の仮想装置を動作させた前記コアを記憶し、
     次に前記他の仮想装置を動作させる場合、前記他の仮想装置を動作させる前記コアの変更の有無と、前記物理デバイスのレジスタ値の変更量とに基づいて、前記他の仮想装置を動作させる前記コアを決定する
     コンピュータ実行方法。
  7.  複数のコアを有するプロセッサ及びレジスタを有する物理デバイスを含む物理リソースを備え、該物理リソースを時分割して割り当てることにより、複数の仮想装置を生成する車載コンピュータに、
     前記複数の仮想装置のうち一部の前記仮想装置を前記複数のコアそれぞれに所定周期で定期的に動作させると共に、他の前記仮想装置を非定期的に動作させ、
     少なくとも前記他の仮想装置を動作させた前記コアを記憶し、
     次に前記他の仮想装置を動作させる場合、前記他の仮想装置を動作させる前記コアの変更の有無と、前記物理デバイスのレジスタ値の変更量とに基づいて、前記他の仮想装置を動作させる前記コアを決定する
     処理を実行させるためのコンピュータプログラム。
PCT/JP2021/045436 2020-12-23 2021-12-10 車載コンピュータ、コンピュータ実行方法及びコンピュータプログラム WO2022138218A1 (ja)

Priority Applications (2)

Application Number Priority Date Filing Date Title
US18/259,050 US20240054002A1 (en) 2020-12-23 2021-12-10 Vehicle-mounted computer, computer execution method, and computer program
CN202180081774.XA CN116569139A (zh) 2020-12-23 2021-12-10 车载计算机、计算机执行方法及计算机程序

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2020-213796 2020-12-23
JP2020213796A JP7447782B2 (ja) 2020-12-23 2020-12-23 車載コンピュータ、コンピュータ実行方法及びコンピュータプログラム

Publications (1)

Publication Number Publication Date
WO2022138218A1 true WO2022138218A1 (ja) 2022-06-30

Family

ID=82159600

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2021/045436 WO2022138218A1 (ja) 2020-12-23 2021-12-10 車載コンピュータ、コンピュータ実行方法及びコンピュータプログラム

Country Status (4)

Country Link
US (1) US20240054002A1 (ja)
JP (1) JP7447782B2 (ja)
CN (1) CN116569139A (ja)
WO (1) WO2022138218A1 (ja)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024048001A1 (ja) * 2022-09-01 2024-03-07 住友電気工業株式会社 車載システムおよび車載システムの制御方法

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008217302A (ja) * 2007-03-02 2008-09-18 Nec Corp 仮想マシンシステム、管理サーバ、仮想マシン移行方法及びプログラム
JP2014203232A (ja) * 2013-04-04 2014-10-27 日本電信電話株式会社 仮想マシンの動的配置方法及び仮想マシンシステム
JP2019212032A (ja) * 2018-06-05 2019-12-12 株式会社デンソー マルチコアマイコンを備える電子制御装置

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008217302A (ja) * 2007-03-02 2008-09-18 Nec Corp 仮想マシンシステム、管理サーバ、仮想マシン移行方法及びプログラム
JP2014203232A (ja) * 2013-04-04 2014-10-27 日本電信電話株式会社 仮想マシンの動的配置方法及び仮想マシンシステム
JP2019212032A (ja) * 2018-06-05 2019-12-12 株式会社デンソー マルチコアマイコンを備える電子制御装置

Also Published As

Publication number Publication date
JP2022099796A (ja) 2022-07-05
CN116569139A (zh) 2023-08-08
US20240054002A1 (en) 2024-02-15
JP7447782B2 (ja) 2024-03-12

Similar Documents

Publication Publication Date Title
US9880927B2 (en) Functionally expandable vehicle control device and method for supplementing the functionality of a vehicle control device
WO2007001014A1 (ja) 情報端末、計算機資源管理方法、および仮想マシンの実行切り替え方法
EP3343366B1 (en) System and method for scheduling a plurality of guest systems and/or threads
WO2009153621A1 (en) A system, method and computer program product for scheduling processor entity tasks in a multiple-processing entity system
CN102915236A (zh) 使用硬件抽象执行软件应用程序的方法和系统
WO2020208954A1 (ja) 車載コンピュータ、車載通信システム、コンピュータ実行方法及びコンピュータプログラム
WO2022138218A1 (ja) 車載コンピュータ、コンピュータ実行方法及びコンピュータプログラム
US7401335B2 (en) Single stack kernel
CN114872645A (zh) 一种车载系统应用管理方法、架构、车辆及介质
JP6975854B2 (ja) 制御コントローラおよび車両制御システム
US11915024B2 (en) Pool management for in-vehicle device application startup
JP7439773B2 (ja) 車載コンピュータ、コンピュータ実行方法及びコンピュータプログラム
WO2022138096A1 (ja) 車載コンピュータ、コンピュータ実行方法及びコンピュータプログラム
JP2021124902A (ja) 車両制御装置、車両制御方法、及び車両制御プログラム
JP2017033159A (ja) 車載電子制御装置
US11947824B2 (en) Electronic control unit, method, and program
WO2024048001A1 (ja) 車載システムおよび車載システムの制御方法
WO2024009656A1 (ja) 車両制御装置
JP7468308B2 (ja) 車載ecu、プログラム、及び情報処理方法
WO2021010124A1 (ja) 車載装置、車両管理システム、リソース管理方法およびリソース管理プログラム
WO2021193145A1 (ja) 車載情報処理装置、制御方法及びコンピュータプログラム
WO2022196322A1 (ja) 車載装置、情報処理方法、及びコンピュータプログラム
US20190303214A1 (en) System comprising a plurality of virtualization systems
CN116880962A (zh) 确定虚拟机管理器延迟信息的方法、装置、设备及车辆
JP2023087414A (ja) 車載制御装置、制御方法及びコンピュータプログラム

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: 21910367

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 202180081774.X

Country of ref document: CN

WWE Wipo information: entry into national phase

Ref document number: 18259050

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21910367

Country of ref document: EP

Kind code of ref document: A1