Resource scheduling method, device and system of virtual machine, vehicle and storage medium

By allocating resource parameters to multiple virtual machines and uniformly allocating resources according to the information and resource priorities of virtual machine events, the problem of unreasonable resource configuration in the multimedia smart cockpit is solved, and resource utilization and system performance are improved.

CN120104248APending Publication Date: 2025-06-06BYD CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510102005.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-21
Publication Date
2025-06-06

Smart Images

  • Figure CN120104248A_ABST
    Figure CN120104248A_ABST
Patent Text Reader

Abstract

The invention discloses a resource scheduling method, device and system of a virtual machine, a vehicle and a storage medium, and relates to the technical field of virtual machines. According to the method, the resource parameters are allocated to the virtual machines based on the virtual machine events of the multiple virtual machines, and the multiple virtual machines are uniformly configured and managed, so that the virtual machines are controlled to process the virtual machine events according to the allocated resource parameters. Therefore, scheduling and configuration of the resource parameters can be carried out for the virtual machine events of different virtual machines, so that the virtual machines obtain the resource parameters matched with the virtual machine events, and the situation of unreasonable resource allocation such as insufficient resources or idle resources caused by resource configuration and management of each virtual machine is reduced; therefore, the stability of resource scheduling of the plurality of virtual machines and the utilization rate of resources are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of virtual machine technology, and in particular to a resource scheduling method, device, system, vehicle and storage medium for a virtual machine. Background Art

[0002] With the rapid development of electronic technology and the new energy vehicle industry, multimedia smart cockpits are gradually being used in vehicles. As the functions of smart cockpits become more and more complex, multiple multimedia screens can be set up in the cockpit of the vehicle. For example, the required multimedia screens can be set up for the driver's seat, the co-driver's seat, and the rear passenger position of the vehicle. Generally speaking, different screens are set up with an independent chip for control. Setting up independent control chips on multiple multimedia screens will result in a higher multimedia cost for the entire vehicle. Based on the strong performance of the chip, and as the performance of a single chip becomes more and more powerful, setting up an independent control chip for each multimedia screen will also lead to a waste of chip computing power. In related technologies, resources are usually configured and managed for each virtual machine separately, but when some virtual machines have personalized task requirements, there may not be enough resources to support the execution of the task, and other virtual machines may be idle because there is no task requirement or they are in an idle state, which leads to idle resources, which in turn leads to the system resources not being reasonably allocated and used, thereby affecting the overall system performance of the vehicle. Summary of the invention

[0003] Embodiments of the present application provide a method, device, system, vehicle, and storage medium for resource scheduling of a virtual machine, which improve the stability of resource scheduling for multiple virtual machines, so as to at least partially solve the above-mentioned technical problems.

[0004] In order to achieve the above object, according to a first aspect of the present application, a resource scheduling method for a virtual machine is provided, comprising:

[0005] Resource parameters are allocated to each of the virtual machines for virtual machine events of the plurality of virtual machines, so as to control each of the virtual machines to process the virtual machine events based on the allocated resource parameters.

[0006] Optionally, the virtual machine event for the multiple virtual machines allocates resource parameters to each of the virtual machines, including:

[0007] Determining resource parameters allocated to each of the virtual machines according to event information corresponding to the virtual machine event of each of the virtual machines;

[0008] According to the resource parameters, each of the virtual machines is controlled to process the virtual machine event.

[0009] Optionally, determining the resource parameters allocated to each of the virtual machines according to the event information corresponding to the virtual machine event of each of the virtual machines includes:

[0010] Determining a resource priority corresponding to each of the virtual machines according to event information corresponding to the virtual machine events of the virtual machines;

[0011] Based on the resource priority, resource parameters allocated to each of the virtual machines are determined.

[0012] Optionally, determining the resource priority corresponding to each virtual machine according to the event information corresponding to the virtual machine event of each virtual machine includes:

[0013] Acquire virtual machine operation information of each of the virtual machines within a first time period;

[0014] The resource priority corresponding to each of the virtual machines is determined according to the virtual machine operation information.

[0015] Optionally, the virtual machine operation information includes an event log, and determining the resource priority corresponding to each virtual machine according to the virtual machine operation information includes:

[0016] Determine, according to the event log of each of the virtual machines in the first time period, the frequency of occurrence of a set alarm event of each of the virtual machines;

[0017] Based on the occurrence frequency of the set alarm event, a resource priority corresponding to each of the virtual machines is determined.

[0018] Optionally, determining the resource priority corresponding to each of the virtual machines based on the occurrence frequency of the set alarm event includes:

[0019] Sorting the occurrence frequencies of the alarm events corresponding to the virtual machines to obtain a sorting result;

[0020] According to the sorting result, the resource priority of each virtual machine is determined.

[0021] Optionally, the virtual machine operation information includes performance parameters, and determining the resource priority corresponding to each virtual machine according to the virtual machine operation information includes:

[0022] The resource priority corresponding to each of the virtual machines is determined according to a deviation value between the performance parameter of each of the virtual machines and a preset performance parameter in the first time period.

[0023] Optionally, determining the resource priority corresponding to each virtual machine according to a deviation value between the performance parameter of each virtual machine and a preset performance parameter in the first time period includes:

[0024] Sorting the deviation values ​​corresponding to the virtual machines to obtain a sorting result;

[0025] According to the sorting result, the resource priority of each virtual machine is determined.

[0026] Optionally, the resource parameter includes resource capacity, and determining the resource parameter allocated to each virtual machine based on the resource priority includes:

[0027] The resource capacities of the multiple virtual machines are determined according to the resource priorities respectively corresponding to the virtual machines.

[0028] Optionally, the resource scheduling method is applied to a resource scheduling device, the resource scheduling device communicates with a plurality of the virtual machines, and the resource scheduling device includes a target chip;

[0029] The determining of resource parameters allocated to each of the virtual machines based on the resource priority includes:

[0030] Based on the resource priority, resource parameters allocated by the target chip to each of the virtual machines are determined.

[0031] Optionally, the target chip includes multiple cores, and determining the resource parameters allocated by the target chip to each of the virtual machines based on the resource priority includes:

[0032] Based on the resource priority of each virtual machine, a core of a corresponding type is allocated to each virtual machine according to the type of the multiple cores.

[0033] Optionally, the target chip includes multiple cores, and determining the resource parameters allocated by the target chip to each of the virtual machines based on the resource priority includes:

[0034] Based on the resource priority corresponding to each of the virtual machines, setting a resource weight for each of the virtual machines;

[0035] A core of a corresponding type is allocated to each virtual machine according to a resource weight set for each virtual machine.

[0036] Optionally, the target chip includes multiple cores, and determining the resource parameters allocated by the target chip to each of the virtual machines based on the resource priority includes:

[0037] Based on the resource priority corresponding to each of the virtual machines, setting a resource weight for each of the virtual machines and setting the type of the core;

[0038] According to the resource weight set for each virtual machine and the type of the core, a core of a corresponding type is allocated to each virtual machine.

[0039] Optionally, the resource scheduling device includes a target interface, and the target interface communicates with the plurality of virtual machines;

[0040] The determining, according to the event information corresponding to the virtual machine event of each virtual machine, the resource parameters allocated to each virtual machine further includes:

[0041] When an interface command of the target interface is received, currently remaining resources in the target chip are allocated to the virtual machine that sends the interface command.

[0042] Optionally, the resource scheduling method further includes:

[0043] The same resource parameters are allocated to a plurality of virtual machines including the same virtual machine event.

[0044] Optionally, allocating the same resource parameters to the multiple virtual machines containing the same virtual machine event includes:

[0045] In response to a command of a shared resource parameter sent by the first target virtual machine, determining, from each of the virtual machines, a second target virtual machine having the same virtual machine event as the first target virtual machine;

[0046] Allocate the same resource parameters as the first target virtual machine to the second target virtual machine.

[0047] Optionally, the resource scheduling method further includes:

[0048] In response to the operation signals of the plurality of virtual machines, event information of a virtual machine event of each of the virtual machines is determined.

[0049] Optionally, the resource scheduling method further includes:

[0050] Performing status monitoring on a third target virtual machine that is currently executing the virtual machine event;

[0051] If it is detected that the state of the third target virtual machine is in an abnormal state, the resource parameter is adjusted to restore the state of the third target virtual machine to a normal state.

[0052] Optionally, the performing status monitoring on the third target virtual machine that is currently executing the virtual machine event includes:

[0053] The frame rate of the virtual machine is monitored, and when a change value of the frame rate exceeds a set change value range, the state of the virtual machine is determined to be an abnormal state.

[0054] Optionally, the adjusting the resource parameter to restore the state of the third target virtual machine to a normal state includes:

[0055] The resource parameters of the third target virtual machine are adjusted so that the change value of the frame rate of the third target virtual machine is within the set change value range.

[0056] According to a second aspect of the present application, a resource scheduling device is provided, including:

[0057] a memory configured to store instructions; and

[0058] The processor is configured to call the instruction from the memory and implement the resource scheduling method of the virtual machine when executing the instruction.

[0059] According to a third aspect of the present application, a resource scheduling system is provided, including:

[0060] The resource scheduling device mentioned above;

[0061] A plurality of virtual machines communicate with the resource scheduling device.

[0062] Optionally, the resource scheduling device further includes a target chip, and the target chip includes multiple cores.

[0063] Optionally, the resource scheduling device further includes a target interface for communicating with the plurality of virtual machines.

[0064] According to a fourth aspect of the present application, a vehicle is provided, comprising the above-mentioned resource scheduling system.

[0065] According to a fifth aspect of the present application, a computer-readable storage medium is provided, on which instructions are stored, and when the instructions are executed by a processor, the processor is configured to execute the above-mentioned resource scheduling method for a virtual machine.

[0066] In summary, the present application allocates resource parameters to each virtual machine based on virtual machine events of multiple virtual machines, and uniformly configures and manages multiple virtual machines to control each virtual machine to process virtual machine events according to the allocated resource parameters. In this way, resource parameters can be scheduled and configured for virtual machine events of different virtual machines so that the virtual machine obtains resource parameters that match each virtual machine event, reducing the situation of unreasonable resource allocation such as insufficient resources or idle resources caused by configuring and managing resources for each virtual machine separately, thereby improving the stability of resource scheduling for multiple virtual machines and the utilization of resources.

[0067] Other features and advantages of the present application will be described in detail in the subsequent specific implementation section. BRIEF DESCRIPTION OF THE DRAWINGS

[0068] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application, and those skilled in the art can obtain other drawings based on these drawings without creative work.

[0069] In order to more completely understand the present application and its beneficial effects, the following description will be given in conjunction with the accompanying drawings, wherein the same figure numbers represent the same parts in the following description.

[0070] Figure 1 A schematic diagram of the structure of a resource scheduling system provided in an embodiment of the present application;

[0071] Figure 2 A schematic diagram of a flow chart of a resource scheduling method for a virtual machine provided in an embodiment of the present application;

[0072] Figure 3 A schematic diagram of a flow chart of a performance control processing event of a virtual machine provided in a specific embodiment of the present application;

[0073] Figure 4 A schematic diagram of a flow chart of a processing resource parameter flow of a virtual machine provided in a specific embodiment of the present application;

[0074] Figure 5 A schematic diagram of a process of providing a target interface for a performance central control provided in a specific embodiment of the present application;

[0075] Figure 6 This is a structural block diagram of a resource scheduling device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0076] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.

[0077] In the description of the present application, it should be understood that the terms "first" and "second" are used only for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present application, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined. In the present application, the word "exemplary" is used to mean "used as an example, illustration or description". Any embodiment described as "exemplary" in the present application is not necessarily interpreted as being more preferred or more advantageous than other embodiments. In order to enable any technician in the field to implement and use the present application, the following description is given. In the following description, details are listed for the purpose of explanation. It should be understood that a person of ordinary skill in the art can recognize that the present application can also be implemented without using these specific details. In other examples, well-known structures and processes will not be elaborated in detail to avoid unnecessary details that make the description of the present application obscure. Therefore, the present application is not intended to be limited to the embodiments shown, but is consistent with the widest range of principles and features disclosed in the present application.

[0078] A virtual machine (VM) is a computer system that simulates the hardware operating environment of a physical computer through software, allowing multiple operating systems to run simultaneously on the same hardware platform. In vehicles that use multimedia smart cockpits, virtual machine technology is usually used to enable multiple display screens in the vehicle to share a host through a single chip, such as a system on a chip (SoC), and run multiple virtual machines for driving. Therefore, multiple display screens in the vehicle can be controlled by one host. As an example, each virtual machine can independently manage a display screen and provide different user interfaces and functions. For example, one virtual machine can be responsible for the display of the dashboard, and another virtual machine can be responsible for the entertainment system of the center console, etc. Different display screens run in their own virtual machines without affecting the functions of other display screens.

[0079] Based on this, it is very important to customize the system resource configuration according to different scenarios, different display terminals, different users, and different businesses. In one example, a SoC can run multiple virtual machines. The virtual machine can be based on the Linux system, Android system, etc. Virtualization technology can be implemented based on ACRH Hypervisor. Each virtual machine is isolated from each other, enabling a single SoC to run different system businesses and share system resources such as the central processing unit (CPU), graphics processing unit (GPU), and random access memory (RAM).

[0080] In the related art, each virtual machine is usually configured and managed separately, which easily leads to unreasonable resource allocation. Based on this, the embodiment of the present application uniformly allocates each virtual machine to process the virtual machine events of each virtual machine. The optimal resource parameters allocated to multiple virtual machines are determined according to the business scenarios of different virtual machines, and the resource parameters are sent to each virtual machine to execute the virtual machine events corresponding to each virtual machine. Among them, resource parameters refer to the computing resources required for defining and managing the virtual machine runtime, and these parameters directly affect the performance and efficiency of the virtual machine. In this way, the hardware resource capabilities can be fully utilized, resource utilization can be improved, and the performance of the entire resource scheduling system for virtual machines can be improved, the stability of resource scheduling is increased, and the user experience is improved.

[0081] In order to more clearly understand the resource scheduling method for a virtual machine in the embodiment of the present application, an application scenario of the resource scheduling method is first described. The application scenario provides a resource scheduling system, which is described in detail below.

[0082] Figure 1 Schematic diagram of a resource scheduling system provided in an embodiment of the present application. Figure 1 As shown, the resource scheduling system may include a resource scheduling device 1 and multiple virtual machines 2. The multiple virtual machines 2 communicate with the resource scheduling device 1 respectively. The resource scheduling device 1 is a device for executing the resource scheduling method for multiple virtual machines in the embodiment of the present application. For example, the virtual machine events input by each virtual machine can be superimposed, optimized, and decided, and resource parameters can be allocated to each virtual machine 2. As an example, the virtual machine 2 may include a service virtual machine (Services VM, SVM), VM1, VM2, ..., VMn, etc., which are virtual machines for running specific services or applications.

[0083] Each virtual machine can obtain a virtual machine event based on the user's operation signal on the virtual machine. The operation signal refers to the signal of the user operating the display screen corresponding to each virtual machine. For example, the operation signal may include but is not limited to the launch of an application, the exit of an application, returning to the home screen, and sliding operations. The virtual machine event refers to the task that the virtual machine needs to perform based on the operation signal. For example, if the operation signal is the launch of an application, the virtual machine needs to perform the task of launching the application.

[0084] In an embodiment of the present application, the virtual machine events received by each virtual machine cannot be decided independently, and need to be sent to the resource scheduling device 1 for unified configuration and management, so that the resource priority, foreground and background status, user perception and other information of each virtual machine event can be determined according to the overall available resources of the resource scheduling system, so as to select the optimal resource parameters for each virtual machine, improve resource utilization, and enable each virtual machine to maintain a better execution state, thereby improving the stability of resource scheduling for multiple virtual machines.

[0085] Based on Figure 1 The resource scheduling system shown in Figure 2 A flowchart of a virtual machine resource scheduling method is provided. Figure 2 As shown, the resource scheduling method may include step 201, which is described in detail below.

[0086] Step 201: Allocate resource parameters to each virtual machine for virtual machine events of multiple virtual machines.

[0087] Step 202: Control each virtual machine to process virtual machine events based on the allocated resource parameters.

[0088] In an embodiment of the present application, a resource scheduling device can receive virtual machine events sent by multiple virtual machines, and make decisions based on the virtual machine events of multiple virtual machines so that each virtual machine can be allocated with better resource parameters. Then, each virtual machine receives the resource parameters sent by the resource scheduling device, and processes the corresponding virtual machine events based on the resource parameters. In this way, the configuration of resource parameters can be unified on the resource scheduling device, and the allocation of resource parameters between virtual machines is not independent of each other, but will take into account the needs of other virtual machines communicating with the resource scheduling device at the same time. In this way, the stability of the resource scheduling device for resource scheduling of multiple virtual machines can be improved.

[0089] Specifically, in step 201, resource parameters allocated to each virtual machine may be determined based on event information corresponding to a virtual machine event of each virtual machine, and then each virtual machine may be controlled to process the virtual machine event based on the resource parameters.

[0090] In the embodiments of the present application, resource parameters are usually allocated based on the amount of resource parameters required by the virtual machine events. Therefore, the event information in the embodiments of the present application refers to information used to determine the resource parameters required for each virtual machine to process the corresponding virtual machine events. The resource scheduling device can determine the amount of resource parameters allocated to each virtual machine based on the event information contained in the virtual machine events of each virtual machine. Virtual machines with more required resource parameters are allocated more resource parameters, and virtual machines with fewer required resource parameters are allocated fewer resource parameters. In this way, full utilization of resource parameters can be achieved, and resource parameters can be reasonably allocated based on the needs of each virtual machine, so that the virtual machine obtains resource parameters that match the virtual machine events.

[0091] As an example, in an embodiment of the present application, event information of virtual machine events of each virtual machine can be determined in response to operation signals of multiple virtual machines. The operation signal refers to a signal of a user operating a virtual machine. For example, it can be an operation signal such as opening an application, closing an application, sliding, etc. Based on the operation signal of the virtual machine, the virtual machine event corresponding to the virtual machine can be determined. Furthermore, the event information of the virtual machine event can be obtained so as to allocate unified resource parameters.

[0092] To summarize, the embodiments of the present application can schedule and configure resource parameters for virtual machine events of different virtual machines so that the virtual machines obtain resource parameters that match the virtual machine events, reducing unreasonable resource allocation such as insufficient resources or idle resources caused by configuring and managing resources for each virtual machine separately, thereby improving the stability of resource scheduling for multiple virtual machines and resource utilization.

[0093] In the embodiment of the present application, the amount of resource parameters required by each virtual machine can be determined based on the resource priority corresponding to each virtual machine. The resource priority refers to the order of arrangement of the amount of resource parameters required by the virtual machine. For example, if the amount of resource parameters required by a virtual machine is greater, the resource priority of the virtual machine is higher, and the virtual machine with a higher resource priority can be allocated more resource parameters.

[0094] Specifically, the resource priority corresponding to each virtual machine can be determined according to the event information corresponding to the virtual machine event of each virtual machine. Then, based on the resource priority, the resource parameters allocated to each virtual machine are determined. As an example, the resource priority corresponding to each virtual machine can be determined according to the virtual machine operation information of the virtual machine. Among them, the virtual machine operation information refers to the state information of the virtual machine during operation. For example, the virtual machine has more failures under high load, indicating that the virtual machine requires more resource parameters. Therefore, the virtual machine operation information may include the event log and / or performance parameters of the virtual machine. Among them, the event log refers to information containing resource usage, errors, warnings and other important events during the runtime of the virtual machine. Performance parameters refer to parameter information that can reflect the demand of the virtual machine for resource parameters. For example, it may include but is not limited to the CPU usage, memory usage, disk read and write speed and input / output (I / O) waiting time and network traffic of the virtual machine.

[0095] Therefore, in one example, the virtual machine operation information of each virtual machine in the first time period can be obtained. Then, the resource priority corresponding to each virtual machine is determined according to the virtual machine operation information. The first time period refers to a time period used to analyze the resource priority of the virtual machine. For example, the first time period can be a historical time period, that is, a period from a certain time point in the past to the present. In addition, the operation information of the virtual machine can be collected at an appropriate frequency, such as every minute or every five minutes, so as to capture short-term performance fluctuations.

[0096] In the embodiments of the present application, event logs and performance parameters are used as examples to illustrate how to determine the resource priority corresponding to a virtual machine.

[0097] Taking the virtual machine operation information including event logs as an example, the frequency of occurrence of set alarm events of each virtual machine can be determined based on the event logs of each virtual machine in the first time period. The set alarm event refers to an event in which the virtual machine generates alarm information due to insufficient allocation of resource parameters. For example, the virtual machine generates errors and alarms during a high frequency or critical time period. Then, based on the frequency of occurrence of the set alarm event, the resource priority corresponding to each of the virtual machines is determined.

[0098] Specifically, the occurrence frequencies of the alarm events corresponding to each virtual machine can be sorted to obtain a sorting result. Then, the resource priority of each virtual machine can be determined according to the sorting result. For example, the occurrence frequencies of the alarm events corresponding to the virtual machines can be sorted from large to small. The priority of the virtual machine with a higher frequency of alarm events is higher, indicating that the amount of resource parameters required by the virtual machine is greater. Conversely, the priority of the virtual machine with a lower frequency of alarm events is lower, indicating that the amount of resource parameters required by the virtual machine is less.

[0099] Taking the example that the virtual machine operation information includes performance parameters, the resource priority corresponding to each virtual machine can be determined based on the deviation value between the performance parameters of each virtual machine and the preset performance parameters in the first time period. Among them, the preset performance parameters refer to the reasonable range of the performance parameters of the virtual machine during operation. If the performance parameters of the virtual machine have a deviation value from the preset performance parameters, it means that the virtual machine needs more resource parameters. The resource priority of multiple virtual machines can be determined based on the demand for resource parameters. For example, under high load, if the resource parameters allocated to a virtual machine are insufficient, the virtual machine is prone to freeze. At this time, the deviation value between the performance parameters of the virtual machine and the reasonable performance parameters is large, indicating that more resource parameters need to be allocated.

[0100] Specifically, the deviation values ​​corresponding to each virtual machine may be sorted to obtain a sorting result. Then, the resource priority of each virtual machine may be determined according to the sorting result. For example, the deviation values ​​corresponding to each virtual machine may be sorted from large to small. A virtual machine with a larger deviation value has a higher priority, indicating that the amount of resource parameters required by the virtual machine is greater. Conversely, a virtual machine with a smaller deviation value has a lower priority, indicating that the amount of resource parameters required by the virtual machine is less.

[0101] In an embodiment of the present application, resource parameters may include resource capacity. The resource capacity represents the allocated amount of resource parameters allocated to each virtual machine. For example, resource capacity may include but is not limited to CPU resources, memory capacity, disk space, and network bandwidth. Increasing the resource capacity allocated to a virtual machine means that more computing power is allocated to the virtual machine. Therefore, the resource capacity of multiple virtual machines can be determined according to the resource priority corresponding to each virtual machine. A virtual machine with a higher resource priority can be allocated more resource capacity, so that the virtual machine has a higher computing power. Conversely, a virtual machine with a lower resource priority is allocated less resource capacity, indicating that the virtual machine does not need a higher computing power to process the corresponding virtual machine event.

[0102] As can be seen from the above, the resource scheduling method of the embodiment of the present application is applied to a resource scheduling device, and the resource scheduling device may include a target chip. The target chip refers to a chip used to process the resource scheduling method of multiple virtual machines. In the embodiment of the present application, the resource parameters allocated to each virtual machine by the target chip can be determined based on the resource priority.

[0103] Specifically, the target chip in the embodiment of the present application may include multiple cores. The core of the chip refers to an independent computing unit in the processor, and each core can execute an instruction set to process different tasks. Therefore, the resource parameters allocated by the target chip to each virtual machine are to allocate multiple cores to each virtual machine to process virtual machine events. As an example, the allocation can be based on the type of core in the target chip and the resource weights set by each core for different virtual machines.

[0104] First, taking the core type classification as an example, the corresponding type of core can be allocated to each virtual machine according to the type of multiple cores based on the resource priority of each virtual machine. As an example, assume that the core types of the target chip include large cores, medium cores, and small cores. The large core can handle virtual machine events that require higher performance, the medium core can handle virtual machine events with medium performance requirements, and the small core can handle virtual machine events with smaller performance requirements. Therefore, the large core can be allocated to a virtual machine with a higher priority, the medium core can be allocated to a virtual machine with a medium priority, and the small core can be allocated to a virtual machine with a lower priority.

[0105] Taking the example of setting resource weights for different virtual machines for each core, the set resource weights of the virtual machines can be determined based on the resource priorities corresponding to each virtual machine. The set resource weight refers to the weight of the resources to be allocated to each virtual machine. Then, the corresponding type of core is allocated to each virtual machine according to the resource weight set for each virtual machine. As an example, the resource weights given by each core to different virtual machines can be allocated in the form of percentages. For example, suppose that tasks A, B, and C are included. Task A has the highest priority and the percentage required to be allocated is 50%. Task B has a medium priority and the percentage required to be allocated is 37.5%. Task C has the lowest priority and the percentage required to be allocated is 12.5%. Then the set resource weight allocated to task A by each core is 50%, the set resource weight allocated to task B is 37.5%, and the set resource weight allocated to task C is 12.5%.

[0106] In addition, the above two methods can also be combined, that is, the core type and each core setting resource weight for different virtual machines are combined as an example, and the resource weight and the type of the core can be set for each virtual machine based on the resource priority corresponding to each virtual machine. Among them, the type of core can include but is not limited to: computing chips represented by CPU and GPU of computer equipment; storage chips represented by read-only memory (ROM) and dynamic random access memory (DRAM) of memory chips; perception chips represented by complementary metal-oxide-semiconductor memory (CMOS) of the core of image acquisition equipment; and energy chips represented by power management chips of alternating current (AC) / direct current (DC) and communication chips represented by fifth generation mobile networks (5G). Among them, CPU and GPU mainly handle more complex task calculations; ROM and RAM are usually used to store data; CMOS is usually used to capture optical signals and convert them into electrical signals; 5G chips are usually used for wireless communication. As an example, a chip with corresponding functions may be called based on a virtual machine event to execute the task corresponding to the virtual machine event. As another example, at least one type of core may be called to process a virtual machine event based on the size of computing power. This is not limited here.

[0107] Then, according to the resource weight set for each virtual machine and the type of the core, a core of a corresponding type is allocated to each virtual machine. Still taking Task A, Task B and Task C as an example, assume that the target chip includes 8 cores. Task A has the highest priority, and the percentage required to be allocated is 50%. Task B has a medium priority, and the percentage required to be allocated is 37.5%. Task C has the lowest priority, and the percentage required to be allocated is 12.5%. Then Task A requires 4 cores, and 3 large cores and 1 medium core can be allocated. Task B requires 3 cores, and 2 medium cores and 1 large core are allocated. Task C requires 1 core, so 1 small core is allocated.

[0108] It should be noted that the above allocation method is only an example of the embodiment of the present application. In actual applications, resource parameters can be allocated to each virtual machine based on a variety of methods, which are not limited here.

[0109] For some special virtual machine events, a large amount of resource parameters may be required. Based on this, the resource scheduling device of the embodiment of the present application may also include a target interface. Through the target interface, the resource scheduling device can communicate with multiple virtual machines. Therefore, the target interface is an interface for multiple virtual machines to interact with the resource scheduling device across processes.

[0110] Specifically, each virtual machine can send an interface command through the target interface. The interface command refers to a command that requires a large number of resource parameters for the virtual machine. When the resource scheduling device receives the interface command of the target interface, the current remaining resources in the target chip can be allocated to the virtual machine that sent the interface command. In this way, greater performance support can be provided for specific scenarios of virtual machines, thereby improving the stability of virtual machine operation in specific scenarios.

[0111] In the embodiment of the present application, multiple virtual machines may contain the same virtual machine event. In order to improve the efficiency of virtual machine scheduling, a function of sharing resource parameters can be set to assign the same resource parameters to the same virtual machine events on multiple virtual machines. Therefore, the embodiment of the present application can also assign the same resource parameters to multiple virtual machines containing the same virtual machine event.

[0112] Specifically, in response to a command for sharing resource parameters sent by the first target virtual machine, a second target virtual machine having the same virtual machine event as the first target virtual machine is determined from the virtual machines, and then the same resource parameters as the first target virtual machine are allocated to the second target virtual machine.

[0113] The first target virtual machine refers to the virtual machine that initiates the shared resource parameter function for a certain virtual machine event. The second target virtual machine refers to the virtual machine that contains the event information of the same virtual machine event as the first target virtual machine. The command for sharing resource parameters sent by the first virtual machine indicates that the user needs to synchronize the parameters of the same virtual machine event on multiple virtual machines. Therefore, the second target virtual machine that contains the same virtual machine event as the first target virtual machine can be determined first, and then the resource parameters of the first target virtual machine for the same virtual machine event can be synchronized and updated.

[0114] In order to improve the stability during the operation of the virtual machine, the embodiment of the present application can also be provided with a function of real-time status monitoring. In the embodiment of the present application, the virtual machine currently executing the virtual machine event can be called the third target virtual machine. Specifically, the state of the third target virtual machine currently executing the virtual machine event can be monitored. If the state of the third target virtual machine is detected to be an abnormal state, it means that the current resource parameters cannot satisfy the third target virtual machine to execute the virtual machine event, and the resource parameters need to be adjusted to restore the state of the third target virtual machine to a normal state. In this way, the resource parameters of each virtual machine can be adjusted in real time based on the state of each virtual machine when executing the virtual machine event, so that each virtual machine remains stable when executing the virtual machine event.

[0115] As an example, the state of the virtual machine can be determined by monitoring the frame rate of the virtual machine. Normally, the frame rate of a virtual machine in a normal state should be maintained within a certain range. The range of the frame rate change value corresponding to the virtual machine in a normal state is determined as the set change value range. When the change value of the frame rate of the virtual machine exceeds the set change value range, it indicates that the frame rate of the current virtual machine is unstable, and the state of the virtual machine can be determined to be an abnormal state. Then, the resource parameters of the third target virtual machine can be adjusted so that the change value of the frame rate of the third target virtual machine is within the set change value range.

[0116] The following example takes the resource scheduling device as the performance control and the virtual machines include VM1, VM2, VM3 to VMn. Figure 3 As shown, Figure 3 A schematic diagram of a flow chart of a performance control process event of a virtual machine provided in a specific embodiment of the present application.

[0117] In a specific embodiment, the current virtual machine events of each virtual machine collected can be put into an event queue. Then, the virtual machine event is taken out from the event queue. Then, each virtual machine is preferentially configured based on the event information of the virtual machine event, and the resource parameters of each virtual machine are preferentially obtained. For example, based on the event type of each virtual machine event, different event types have different preferential strategies. Assuming that event type 1, event type 2, event type 3 to event type n are included, the optimal performance parameters of different virtual machine events can be finally determined based on different event types. Then, the optimal resource parameters of each type are superimposed. For example, event type 1, event type 2, event type 3 to event type n are superimposed. Then, it is sent to each virtual machine, and finally each virtual machine executes the virtual machine event based on the received resource parameters.

[0118] As an example, suppose that in a specific scenario, VM1 is starting an application, VM2 is watching a video, and VM3 is in the off state. In this case, the performance control center can dynamically set more CPU resources for VM1 or even set the maximum CPU frequency to provide it with sufficient computing power strategy and speed up the APP startup. VM2 only needs to provide appropriate computing power under the premise of ensuring smooth video. VM3 does not need to be considered at this time.

[0119] Figure 4 FIG. 1 is a flow chart of a processing resource parameter flow of a virtual machine provided in a specific embodiment of the present application. Figure 4 As shown in the figure, the scheduling of virtual machines is applied to the Android system as an example. First, the virtual machine receives the resource parameters after the unified decision of the performance control center, and then passes the resource parameters to the hardware abstraction layer (HAL) layer through the resource application programming interface (Application Programming Interface, API) provided by the Android Framework. The HAL layer converts each resource parameter into a corresponding node. After the HAL layer writes the resource parameters to be adjusted into the node, the Linux kernel will adjust various resources of the system according to the node changes. For example, the CPU aggregation threshold and GPU main frequency and other parameters can be adjusted by adjusting the CPU main frequency, the CPU sched_boot type, sched_downmigrate, sched_upmigrate, sched_downmigrate_prime, sched_upmigrate_prime, etc. Through multi-level writing, the Android system can dynamically adjust hardware resources to meet the application requirements of virtual machines, while optimizing energy efficiency, so that virtual machines in different application scenarios can respond flexibly.

[0120] Figure 5 The following is a flow chart of providing a target interface for a performance control provided in a specific embodiment of the present application. Figure 5As shown, the performance control center can provide a target interface for the application (Application, APP). In this way, the APP can send commands to the performance control center through cross-process, and the performance control center will then improve the resource parameters of the virtual machine where the APP is located according to the specific scenario of the APP, thereby improving the performance of the APP. Among them, BoostFramework is a framework of the Android system, which is used to dynamically adjust the performance of the virtual machine to meet the needs of the application, and is usually used to temporarily improve the performance of the virtual machine in a specific scenario. Perfd is a performance daemon in the Android system, which is responsible for monitoring and managing the performance status of the device. Through the joint action of BoostFramework and perfd, the resource parameters of the APP in a specific scenario can be better adjusted to ensure the stability of the virtual machine in a specific scenario.

[0121] Figure 6 1 is a structural block diagram of a resource scheduling device 1 provided in an embodiment of the present application. Figure 6 As shown, the resource scheduling device 1 may include a memory 601 and a processor 602. The memory 601 is configured to store instructions. The processor 602 is configured to call instructions from the memory and implement the above-mentioned virtual machine resource scheduling method when executing the instructions.

[0122] The embodiment of the present application also provides a vehicle, including the above-mentioned dispatching system. The vehicle in the embodiment of the present application can be a fuel vehicle, a plug-in hybrid vehicle or a new energy vehicle, etc., and the present application does not make specific limitations on this.

[0123] An embodiment of the present application also provides a computer-readable storage medium having instructions stored thereon, which, when executed by a processor, configures the processor to execute the resource scheduling method for the virtual machine described above.

[0124] Since the instructions stored in the resource scheduling device, the vehicle and the computer-readable storage medium can execute the steps in the resource scheduling method for any virtual machine provided in the embodiments of the present application, the beneficial effects that can be achieved by the resource scheduling method for any virtual machine provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0125] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0126] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0127] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0128] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0129] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0130] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0131] Computer readable media include permanent and non-permanent, removable and non-removable media, and can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated communication signals and carrier waves.

[0132] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0133] The above are only preferred embodiments of the present application and do not constitute any form of limitation to the present application. However, any simple modifications, equivalent changes and modifications made to the above embodiments based on the technical essence of the present application without departing from the content of the technical solution of the present application are still within the scope of the technical solution of the present application.

Claims

1. A method for resource scheduling of a virtual machine, characterized in that: include: For virtual machine events of multiple virtual machines, resource parameters are allocated to each of the virtual machines to control each of the virtual machines to process the virtual machine events based on the allocated resource parameters.

2. The resource scheduling method according to claim 1, characterized in that: The virtual machine event for the multiple virtual machines allocates resource parameters to each of the virtual machines, including: Determining resource parameters allocated to each of the virtual machines according to event information corresponding to the virtual machine event of each of the virtual machines; According to the resource parameters, each of the virtual machines is controlled to process the virtual machine event.

3. The resource scheduling method according to claim 2, characterized in that: The determining, according to the event information corresponding to the virtual machine event of each virtual machine, the resource parameters allocated to each virtual machine includes: Determining a resource priority corresponding to each of the virtual machines according to event information corresponding to the virtual machine events of the virtual machines; Based on the resource priority, resource parameters allocated to each of the virtual machines are determined.

4. The resource scheduling method according to claim 3, characterized in that: Determining the resource priority corresponding to each virtual machine according to the event information corresponding to the virtual machine event of each virtual machine includes: Acquire virtual machine operation information of each of the virtual machines within a first time period; The resource priority corresponding to each of the virtual machines is determined according to the virtual machine operation information.

5. The resource scheduling method according to claim 4, characterized in that: The virtual machine operation information includes an event log, and determining the resource priority corresponding to each virtual machine according to the virtual machine operation information includes: Determine, according to the event log of each of the virtual machines in the first time period, the frequency of occurrence of a set alarm event of each of the virtual machines; Based on the occurrence frequency of the set alarm event, a resource priority corresponding to each of the virtual machines is determined.

6. The resource scheduling method according to claim 5, characterized in that: The determining the resource priority corresponding to each of the virtual machines based on the occurrence frequency of the set alarm event includes: Sorting the occurrence frequencies of the alarm events corresponding to the virtual machines to obtain a sorting result; According to the sorting result, the resource priority of each virtual machine is determined.

7. The resource scheduling method according to claim 4, characterized in that: The virtual machine operation information includes performance parameters, and determining the resource priority corresponding to each virtual machine according to the virtual machine operation information includes: The resource priority corresponding to each of the virtual machines is determined according to a deviation value between the performance parameter of each of the virtual machines and a preset performance parameter in the first time period.

8. The resource scheduling method according to claim 7, characterized in that: The determining the resource priority corresponding to each virtual machine according to the deviation value between the performance parameter of each virtual machine and the preset performance parameter in the first time period includes: Sorting the deviation values ​​corresponding to the virtual machines to obtain a sorting result; According to the sorting result, the resource priority of each virtual machine is determined.

9. The resource scheduling method according to claim 3, characterized in that: The resource parameters include resource capacity, and the determining of the resource parameters allocated to each of the virtual machines based on the resource priority includes: The resource capacities of the multiple virtual machines are determined according to the resource priorities respectively corresponding to the virtual machines.

10. The resource scheduling method according to claim 3, characterized in that: The resource scheduling method is applied to a resource scheduling device, the resource scheduling device communicates with a plurality of the virtual machines, and the resource scheduling device includes a target chip; The determining of resource parameters allocated to each of the virtual machines based on the resource priority includes: Based on the resource priority, resource parameters allocated by the target chip to each of the virtual machines are determined.

11. The resource scheduling method according to claim 10, characterized in that: The target chip includes a plurality of cores, and determining the resource parameters allocated by the target chip to each of the virtual machines based on the resource priority includes: Based on the resource priority of each virtual machine, a core of a corresponding type is allocated to each virtual machine according to the type of the multiple cores.

12. The resource scheduling method according to claim 10, characterized in that: The target chip includes a plurality of cores, and determining the resource parameters allocated by the target chip to each of the virtual machines based on the resource priority includes: Based on the resource priority corresponding to each of the virtual machines, setting a resource weight for each of the virtual machines; A core of a corresponding type is allocated to each virtual machine according to a resource weight set for each virtual machine.

13. The resource scheduling method according to claim 10, characterized in that: The target chip includes a plurality of cores, and determining the resource parameters allocated by the target chip to each of the virtual machines based on the resource priority includes: Based on the resource priority corresponding to each of the virtual machines, setting a resource weight for each of the virtual machines and setting the type of the core; According to the resource weight set for each virtual machine and the type of the core, a core of a corresponding type is allocated to each virtual machine.

14. The resource scheduling method according to claim 10, characterized in that: The resource scheduling device includes a target interface, and the target interface communicates with the plurality of virtual machines; The determining, according to the event information corresponding to the virtual machine event of each virtual machine, the resource parameters allocated to each virtual machine further includes: When an interface command of the target interface is received, currently remaining resources in the target chip are allocated to the virtual machine that sends the interface command.

15. The resource scheduling method according to any one of claims 1 to 14, characterized in that: Also includes: The same resource parameters are allocated to a plurality of virtual machines including the same virtual machine event.

16. The resource scheduling method according to claim 15, characterized in that: The allocating the same resource parameters to the multiple virtual machines containing the same virtual machine event includes: In response to a command of a shared resource parameter sent by the first target virtual machine, determining, from each of the virtual machines, a second target virtual machine having the same virtual machine event as the first target virtual machine; Allocate the same resource parameters as the first target virtual machine to the second target virtual machine.

17. The resource scheduling method according to any one of claims 1 to 14, characterized in that: Also includes: In response to the operation signals of the plurality of virtual machines, event information of a virtual machine event of each of the virtual machines is determined.

18. The resource scheduling method according to any one of claims 1 to 14, characterized in that: Also includes: Performing status monitoring on a third target virtual machine that is currently executing the virtual machine event; If it is detected that the state of the third target virtual machine is in an abnormal state, the resource parameter is adjusted to restore the state of the third target virtual machine to a normal state.

19. The resource scheduling method according to claim 18, characterized in that: The monitoring of the status of the third target virtual machine currently executing the virtual machine event includes: The frame rate of the virtual machine is monitored, and when a change value of the frame rate exceeds a set change value range, the state of the virtual machine is determined to be an abnormal state.

20. The resource scheduling method according to claim 19, characterized in that: The adjusting the resource parameters to restore the state of the third target virtual machine to a normal state includes: The resource parameters of the third target virtual machine are adjusted so that the change value of the frame rate of the third target virtual machine is within the set change value range.

21. A resource scheduling device, characterized in that: include: a memory configured to store instructions; as well as A processor is configured to call the instruction from the memory and implement the resource scheduling method for a virtual machine according to any one of claims 1 to 20 when executing the instruction.

22. A resource scheduling system, characterized in that: include: The resource scheduling device according to claim 21; A plurality of virtual machines communicate with the resource scheduling device.

23. The resource scheduling system according to claim 22, characterized in that: The resource scheduling device further includes a target chip, and the target chip includes a plurality of cores.

24. The resource scheduling system according to claim 22, characterized in that: The resource scheduling device also includes a target interface for communicating with the plurality of virtual machines.

25. A vehicle, characterized in that: Comprising a dispatch system according to any one of claims 22 to 24.

26. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, which, when executed by a processor, enable the processor to be configured to execute the resource scheduling method for a virtual machine according to any one of claims 1 to 20.