Resource configuration method and device and starting method and device of virtual machine

Configuring the virtual machine resources of IoT devices through the visual interface of SDC solves the problem that the existing technology cannot meet the resource configuration size, flexibility and functional requirements at the same time, and realizes the flexibility and adaptability of virtual machine resource configuration.

CN119759493APending Publication Date: 2025-04-04KYLAND TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411810937.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-10
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

Existing virtualization solutions cannot meet the size, flexibility and functional requirements of IoT devices in resource configuration at the same time.

Method used

Configure the virtual machine resources of the target machine through the SDC's visual interface, isolate the resources between the virtual machines, generate a new device tree, and allocate resources to the hypervisor to meet the resource size requirements.

Benefits of technology

It realizes that the resource configuration of virtual machines is more flexible and appropriate, with simple operation and clear configuration interface, which meets the diverse needs of IoT devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119759493A_ABST
    Figure CN119759493A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a resource configuration method and device of a virtual machine and a starting method and device.The configuration method configures resources of the virtual machine of a target machine through a visual interface of an SDC, and comprises the steps that an original device tree on a hardware board card of the target machine is obtained, all hardware resources on the target machine have nodes on the original device tree; all nodes in the original device tree are set to be in a non-enabled state, and a new device tree of the target machine is obtained; and configuring hardware resources for each virtual machine of the target machine, and by taking the new equipment tree as a basic equipment tree, obtaining an equipment tree of each virtual machine according to the hardware resources configured for each virtual machine. According to the technical scheme, the virtual machines are visually configured through the SDC, resources between the virtual machines are isolated, the resource size of the virtual machines is met, development of the virtual machines is more flexible, function selection is more appropriate, operation is simpler, and a configuration interface is clear at a glance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of operating system technology, and in particular to a resource configuration method and device, and a startup method and device for a virtual machine. Background Art

[0002] As the scale of the Internet of Things grows exponentially, IoT developers need to support a variety of different hardware resources, operating systems, and software tools / applications. This is a big challenge because many connected IoT devices are subject to various resource constraints, such as running memory space, flash memory size, and the number of CPU cores.

[0003] Virtualization helps meet these broad needs, but existing virtualization solutions fail to provide the right combination of size, flexibility, and functionality for IoT development. Summary of the invention

[0004] In view of this, the embodiments of the present application provide a resource configuration method and device, and a startup method and device for a virtual machine. The technical solution of the embodiments of the present application is used for the configuration and startup of a type 1 virtual machine. The virtual machine is visually configured through SDC, the resources between the virtual machines are isolated, and a new device tree for the virtual machine is generated, so that the hypervisor of the target machine allocates resources to the virtual machine to meet the resource size requirements; the resources and functions of the virtual machine are configured through SDC, so that the development of the virtual machine is more flexible, the function selection is more appropriate, the operation is simpler, and the configuration interface is clear and clear.

[0005] In a first aspect, an embodiment of the present application provides a method for configuring resources of a virtual machine, configuring the resources of the virtual machine of a target machine through a visual interface of an SDC, the configuration method comprising: obtaining an original device tree on a hardware board of the target machine, wherein all hardware resources on the target machine have nodes in the original device tree; setting all nodes in the original device tree to a disabled state to obtain a new device tree for the target machine; configuring hardware resources for each virtual machine of the target machine, and using the new device tree as a basic device tree, obtaining a device tree for each virtual machine according to the hardware resources configured for each virtual machine.

[0006] From the above, the virtual machine is visually configured through SDC, the resources between virtual machines are isolated, and a new device tree for the virtual machine is generated, so that the hypervisor of the target machine can allocate resources to the virtual machine to meet the resource size requirements; the resources and functions of the virtual machine are configured through SDC, making the development of the virtual machine more flexible, the function selection more appropriate, and the operation simpler, and the configuration interface clear and easy to understand.

[0007] In a possible implementation of the first aspect, before configuring hardware resources for each virtual machine of the target machine, the method further includes: obtaining a device tree of an existing virtual machine of the target machine, and displaying the hardware resource configuration of the existing virtual machine on the visualization interface according to the device tree.

[0008] As shown above, the default configuration of the virtual machine is displayed through the SDC visual interface, which can not only guide the user to perform visual configuration, but also reduce the user's configuration items, making the operation easier.

[0009] In a possible implementation of the first aspect, the hardware resources of each virtual machine include at least one of the following: number of CPUs, memory size, transparent physical devices, and virtual devices; when the memory of a virtual machine specifies space for the physical memory of the target machine, a memory address is specified for the virtual machine after obtaining advanced permissions of the visualization interface; when configuring the CPU of the virtual machine, the physical CPU of the virtual machine where the real-time operating system is located is also configured.

[0010] From the above, by configuring the number of CPUs, memory size, transparent physical devices, and virtual devices for each virtual machine, the virtual machine can have complete resources to support the operation of the virtual machine.

[0011] In a possible implementation manner of the first aspect, the method further includes: configuring hardware resources for a hypervisor of a target machine, and using the new device tree as a base device tree, obtaining a device tree of the hypervisor according to the hardware resources configured for the hypervisor, wherein the hardware resources of the hypervisor include at least one of the following: a physical CPU, a memory space, a debugging serial port, a clock frequency, and a shared memory; wherein, after obtaining the advanced permissions of the visualization interface, specifying a physical CPU and a memory space for the hypervisor.

[0012] From the above, by configuring the physical CPU, memory space, debug serial port, clock frequency, and shared memory for each virtual machine, the hypervisor can support the shared resources of the virtual machines.

[0013] In a possible implementation manner of the first aspect, before configuring hardware resources for the hypervisor of the target machine, the method further includes: acquiring a device tree of the hypervisor, and displaying the hardware resource configuration of the hypervisor on the visualization interface according to the device tree.

[0014] As shown above, the default configuration of the hypervisor is displayed through the SDC visual interface, which can not only guide users to perform visual configuration, but also reduce the user's configuration items, making the operation easier.

[0015] In a possible implementation of the first aspect, it also includes: configuring an operating system type for each virtual machine, the operating system including a real-time operating system and a non-real-time operating system; and / or configuring each virtual machine type, the virtual machines including service virtual machines and user virtual machines, and the resources of the service virtual machines provide shared services for each user virtual machine.

[0016] From the above, configure the operating system type and type of each virtual machine to achieve resource configuration of different virtual machines.

[0017] In a possible implementation manner of the first aspect, the method further includes: obtaining the size of the image file of each virtual machine of the target machine and the hypervisor; adding the loading address of the image file device tree of each virtual machine of the target machine in the hypervisor device tree according to the size of the device tree of each virtual machine of the target machine and the hypervisor and the size of the image file, and adding the loading address of the image file device tree of the hypervisor in the startup file of the hypervisor.

[0018] As described above, by adding the loading address of the device tree of the hypervisor's image file to the hypervisor's startup file, the hypervisor is quickly started, and the virtual machines of the target machine and the device tree and loading address of the image file of the hypervisor are added to the hypervisor device tree, so that the virtual machines of the target machine can be quickly run when the hypervisor is running.

[0019] In a possible implementation manner of the first aspect, setting all nodes in the original device tree to a disabled state includes: changing the nodes having status attributes in the original device tree to a disabled state through an FDT standard interface.

[0020] From the above, the nodes with status attributes in the original device tree are changed to a disabled state through the FDT standard interface, which is applicable to various devices and has nothing to do with the device manufacturer.

[0021] In a possible implementation manner of the first aspect, the SDC server runs in the target machine; when obtaining any device tree or any file size of the target machine, it is obtained through the server.

[0022] As described above, the SDC server runs in the target machine, so as to obtain the original device tree of the target machine, the existing virtual machine device tree and the hypervisor device tree through the server, and is also used to obtain the size of each image file.

[0023] In a second aspect, an embodiment of the present application provides a method for starting a virtual machine, comprising: obtaining a device tree for each virtual machine on a target machine according to the method described in any implementation mode of the first aspect; allocating hardware resources to each virtual machine according to the device tree of the virtual machine when the hypervisor of the target machine is running; and running the image of the virtual machine on the hardware resources allocated to each virtual machine to start the virtual machine.

[0024] From the above, the virtual machine is started by using the device tree of the virtual machine obtained by resource configuration using the visual interface of SDC, so that the resource allocation and function selection of the virtual machine are more flexible, the function selection is more appropriate, and the operation is simpler.

[0025] In a possible implementation of the second aspect, the hardware resources allocated to each virtual machine according to the device tree of the virtual machine when the hypervisor of the target machine is running include: when the hypervisor is running, parsing the device tree of each virtual machine and the device tree of the hypervisor through the FDT standard interface to obtain a structure describing the hardware resources of the target machine; and allocating hardware resources to the hypervisor and each virtual machine according to the structure.

[0026] From the above, the resource description structure of the virtual machine is obtained according to the device tree of the virtual machine and the device tree of the hypervisor, so as to allocate resources to the virtual machine, making the resource allocation of the virtual machine more flexible.

[0027] In a possible implementation of the second aspect, when the hypervisor device tree includes the device tree and the loading address of the image file of each virtual machine of the target machine, when the hypervisor runs, the device tree and the image file of each virtual machine of the target machine are obtained from the loading address.

[0028] As described above, the device tree and the image file of each virtual machine of the target machine are obtained from the hypervisor device tree, thereby obtaining the device tree and the image file of each virtual machine of the target machine.

[0029] In the third aspect, an embodiment of the present application provides a resource configuration device for a virtual machine, which is used to configure the resources of the virtual machine of a target machine through a visual interface of an SDC, and the configuration device includes: an original device tree module, which is used to obtain the original device tree on the hardware board of the target machine, wherein all hardware resources on the target machine have nodes in the original device tree; and is also used to set all nodes in the original device tree to an unenabled state to obtain a new device tree for the target machine; a resource configuration module, which is used to configure hardware resources for each virtual machine of the target machine, and use the new device tree as the basic device tree to obtain the device tree of each virtual machine according to the hardware resources configured for each virtual machine.

[0030] From the above, the virtual machine is visually configured through SDC, the resources between virtual machines are isolated, and a new device tree for the virtual machine is generated, so that the hypervisor of the target machine can allocate resources to the virtual machine to meet the resource size requirements; the resources and functions of the virtual machine are configured through SDC, making the development of the virtual machine more flexible, the function selection more appropriate, and the operation simpler, and the configuration interface clear and easy to understand.

[0031] In a possible implementation of the third aspect, before configuring hardware resources for each virtual machine of the target machine, the original device tree module is also used to obtain the device tree of the existing virtual machine of the target machine, and the resource configuration module is also used to display the hardware resource configuration of the existing virtual machine on the visualization interface based on the device tree.

[0032] As shown above, the default configuration of the virtual machine is displayed through the SDC visual interface, which can not only guide the user to perform visual configuration, but also reduce the user's configuration items, making the operation easier.

[0033] In a possible implementation of the third aspect, the hardware resources of each virtual machine include at least one of the following: number of CPUs, memory size, transparent physical devices, and virtual devices; when the memory of a virtual machine specifies space for the physical memory of the target machine, a memory address is specified for the virtual machine after obtaining advanced permissions of the visualization interface; when configuring the CPU of the virtual machine, the physical CPU of the virtual machine where the real-time operating system is located is also configured.

[0034] From the above, by configuring the number of CPUs, memory size, transparent physical devices, and virtual devices for each virtual machine, the virtual machine can have complete resources to support the operation of the virtual machine.

[0035] In a possible implementation manner of the third aspect, the resource configuration module is further used to configure hardware resources for a hypervisor of a target machine, and uses the new device tree as a base device tree, and obtains a device tree of the hypervisor according to the hardware resources configured for the hypervisor, wherein the hardware resources of the hypervisor include at least one of the following: a physical CPU, a memory space, a debugging serial port, a clock frequency, and a shared memory; wherein the physical CPU and memory space are specified for the hypervisor after obtaining advanced permissions of the visualization interface.

[0036] From the above, by configuring the physical CPU, memory space, debug serial port, clock frequency, and shared memory for each virtual machine, the hypervisor can support the shared resources of the virtual machines.

[0037] In a possible implementation of the third aspect, before configuring hardware resources for the hypervisor of the target machine, the original device tree module is further used to obtain a device tree of the hypervisor, and the resource configuration module is further used to display the hardware resource configuration of the hypervisor on the visualization interface according to the device tree.

[0038] As shown above, the default configuration of the hypervisor is displayed through the SDC visual interface, which can not only guide users to perform visual configuration, but also reduce the user's configuration items, making the operation easier.

[0039] In a possible implementation of the third aspect, the resource configuration module is also used to configure the operating system type of each virtual machine, and the operating system includes a real-time operating system and a non-real-time operating system; and / or the resource configuration module is also used to configure each virtual machine type, and the virtual machines include service virtual machines and user virtual machines, and the resources of the service virtual machines provide shared services for each user virtual machine.

[0040] From the above, configure the operating system type and type of each virtual machine to achieve resource configuration of different virtual machines.

[0041] In a possible implementation manner of the third aspect, it also includes: an address adding module, which is used to obtain the image file size of each virtual machine of the target machine and the hypervisor; and is also used to add the loading address of the image file device tree of each virtual machine of the target machine in the hypervisor device tree according to the size of the device tree of each virtual machine of the target machine and the hypervisor and the size of the image file, and add the loading address of the image file device tree of the hypervisor in the startup file of the hypervisor.

[0042] As described above, by adding the loading address of the device tree of the hypervisor's image file to the hypervisor's startup file, the hypervisor is quickly started, and the virtual machines of the target machine and the device tree and loading address of the image file of the hypervisor are added to the hypervisor device tree, so that the virtual machines of the target machine can be quickly run when the hypervisor is running.

[0043] In a possible implementation manner of the third aspect, setting all nodes in the original device tree to a disabled state includes: changing the nodes having status attributes in the original device tree to a disabled state through an FDT standard interface.

[0044] From the above, the nodes with status attributes in the original device tree are changed to a disabled state through the FDT standard interface, which is applicable to various devices and has nothing to do with the device manufacturer.

[0045] In a possible implementation manner of the third aspect, the SDC server runs in the target machine; when obtaining any device tree or any file size of the target machine, it is obtained through the server.

[0046] As described above, the SDC server runs in the target machine, so as to obtain the original device tree of the target machine, the existing virtual machine device tree and the hypervisor device tree through the server, and is also used to obtain the size of each image file.

[0047] In a fourth aspect, an embodiment of the present application provides a device for starting a virtual machine, comprising: an acquisition module, used to obtain a device tree of each virtual machine on a target machine according to the method described in any implementation mode of the first aspect; an allocation module, used to allocate hardware resources to each virtual machine according to the device tree of the virtual machine when the hypervisor of the target machine is running; and a startup module, used to run the image of the virtual machine on the hardware resources allocated to each virtual machine to start the virtual machine.

[0048] From the above, the virtual machine is started by using the device tree of the virtual machine obtained by resource configuration using the visual interface of SDC, so that the resource allocation and function selection of the virtual machine are more flexible, the function selection is more appropriate, and the operation is simpler.

[0049] In a possible implementation of the fourth aspect, the allocation module is specifically used to parse the device tree of each virtual machine and the device tree of the hypervisor through the FDT standard interface when the hypervisor is running, to obtain a structure describing the hardware resources of the target machine; and to allocate hardware resources to the hypervisor and each virtual machine according to the structure.

[0050] From the above, the resource description structure of the virtual machine is obtained according to the device tree of the virtual machine and the device tree of the hypervisor, so as to allocate resources to the virtual machine, making the resource allocation of the virtual machine more flexible.

[0051] In a possible implementation of the fourth aspect, when the hypervisor device tree includes the device tree and the loading address of the image file of each virtual machine of the target machine, the allocation module is also used to obtain the device tree and the image file of each virtual machine of the target machine from the loading address when the hypervisor is running.

[0052] As described above, the device tree and the image file of each virtual machine of the target machine are obtained from the hypervisor device tree, thereby obtaining the device tree and the image file of each virtual machine of the target machine.

[0053] In a fifth aspect, an embodiment of the present application provides a computing device, including:

[0054] bus;

[0055] A communication interface connected to the bus;

[0056] at least one processor connected to the bus; and

[0057] At least one memory is connected to the bus and stores program instructions, and when the program instructions are executed by the at least one processor, the at least one processor executes any one of the implementations of the first aspect or the second aspect of the present application.

[0058] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium having program instructions stored thereon, wherein when the program instructions are executed by a computer, the computer executes any one of the implementations of the first aspect or the second aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] Figure 1 A flowchart of a first embodiment of a method for configuring resources of a virtual machine according to the present application;

[0060] Figure 2 This is a flow chart of a second embodiment of a method for configuring resources of a virtual machine of the present application;

[0061] Figure 3 A schematic diagram of data flow during device tree generation for each virtual machine and hypervisor in Embodiment 2 of a method for configuring resources for a virtual machine of the present application;

[0062] Figure 4 A flowchart of a first embodiment of a method for starting a virtual machine of the present application;

[0063] Figure 5 A flowchart of a second embodiment of a method for starting a virtual machine of the present application;

[0064] Figure 6 This is a structural diagram of a first embodiment of a resource configuration device for a virtual machine of the present application;

[0065] Figure 7 This is a structural diagram of Embodiment 2 of a resource configuration device for a virtual machine of the present application;

[0066] Figure 8This is a structural diagram of a first embodiment of a device for starting a virtual machine of the present application;

[0067] Fig. 9 This is a structural diagram of a second embodiment of a virtual machine startup device of the present application;

[0068] Fig.10 A schematic diagram of the structure of a computing device according to various embodiments of the present application. DETAILED DESCRIPTION

[0069] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0070] In the following description, the terms "first\second\third, etc." or module A, module B, module C, etc. are only used to distinguish similar objects, or to distinguish different embodiments, and do not represent a specific ordering of the objects. It can be understood that the specific order or sequence can be interchanged where permitted, so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here.

[0071] In the following description, the numbers representing the steps, such as S110, S120, etc., do not necessarily mean that the steps must be executed in this manner. If permitted, the order of the previous and next steps can be interchanged, or they can be executed simultaneously.

[0072] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0073] The embodiments of the present application provide a resource configuration method and device, and a startup method and device for a virtual machine. The configuration method configures the resources of the virtual machine of a target machine through a visual interface of an SDC, including: obtaining an original device tree on a hardware board of the target machine, wherein all hardware resources on the target machine have nodes in the original device tree; setting all nodes in the original device tree to a disabled state to obtain a new device tree for the target machine; configuring hardware resources for each virtual machine of the target machine, and using the new device tree as a basic device tree, obtaining a device tree for each virtual machine according to the hardware resources configured for each virtual machine.

[0074] The technical solution of the embodiment of the present application is used for the configuration of type 1 virtual machines. The virtual machines are visually configured through SDC, the resources between the virtual machines are isolated, and a new device tree for the virtual machines is generated, so that the hypervisor of the target machine can allocate resources to the virtual machines to meet the resource size requirements. The resources and functions of the virtual machines are configured through SDC, so that the development of the virtual machines is more flexible, the function selection is more appropriate, the operation is simpler, and the configuration interface is clear and clear.

[0075] The following describes various embodiments of the present application in conjunction with the accompanying drawings. Figure 1 A first embodiment of a resource configuration method for a virtual machine of the present application is introduced.

[0076] A method for configuring resources of a virtual machine Embodiment 1 The resources of the virtual machine of the target machine are configured through a visual interface of an SDC (computation definition controller). Figure 1 The flowchart of a first embodiment of a method for configuring resources of a virtual machine is shown, including steps S110 to S140.

[0077] S110: Obtain the original device tree source.dtb on the hardware board of the target machine.

[0078] The original device tree source.dtb includes information about all hardware resources of the target machine, including CPU cores, memory, and external devices, so as to obtain a complete set of physical resources of the target machine.

[0079] In some embodiments, the original device tree source.dtb is obtained through the SDC server, and the SDC server runs the pre-installed system of the target machine. The pre-installed system of the target machine is essentially a virtual machine. After the pre-installed system and kernel image are burned on the bare board, the disk stores the virtualized files and device tree by default to install the virtual machine corresponding to the pre-installed system. The SDC visual interface runs in the SDC client, and the SDC client can run on the target machine or on another independent computer.

[0080] In some embodiments, the device tree of an existing virtual machine of the target machine is obtained through the SDC server, and the hardware resource configuration of the existing virtual machine is displayed on the SDC visualization interface based on the device tree. This can not only guide the user to perform visual configuration of the virtual machine, but also reduce the user's configuration items, making the operation simpler.

[0081] In some embodiments, the device tree of the hypervisor is obtained through the SDC server, and the hardware resource configuration of the hypervisor of the target machine is displayed on the SDC visualization interface according to the device tree. This can not only guide the user to perform visual configuration of the hypervisor, but also reduce the user's configuration items, making the operation simpler.

[0082] S120: All nodes with status in the original device tree source.dtb are set to a disabled state, and a new device tree new.dtb of the target machine is obtained.

[0083] Among them, the new device tree new.dtb is used as a basic device tree, which is used to select physical resources from it and generate a device tree for a virtual machine and a Hypervisor by modifying the state of the node.

[0084] In some embodiments, the nodes with status attributes in the original device tree are changed to a disabled state ("disabled") through the FDT standard interface, and the selected nodes can be restored to an enabled state ("enabled") when the device tree of the virtual machine and the hypervisor is generated. The FDT standard interface is a field device specification interface, which is applicable to devices of various manufacturers to be described in a unified standard.

[0085] S130: configuring hardware resources for each virtual machine of the target machine.

[0086] Among them, the visual interface configuration of SDC can be very convenient to configure hardware resources for each virtual machine of the target machine through input and / or drop-down menus and / or selection buttons. The user operation is simple, and the function configuration and resource allocation are more flexible and appropriate.

[0087] In some embodiments, when there is an existing virtual machine on the target machine, the hardware resource configuration of the existing virtual machine is displayed on the SDC visual interface, and modifications are made based on this.

[0088] In some embodiments, the hardware resources of each virtual machine include at least one of the following: physical CPU, memory size, transparent physical device, virtual device; the transparent physical device is configured according to needs, and the required transparent physical device can be selected, and unnecessary peripherals are not configured, which can reduce the occupation of virtual machine resources; the virtual device is configured according to needs, and the required virtual device can be selected, which can realize communication between virtual machines and device sharing, thereby reducing the demand for hardware resources and reducing the size of the hardware.

[0089] Through SDC visual configuration, user operation is simple, function configuration and resource allocation are more flexible and appropriate, and the implementation of virtual devices can reduce the demand for hardware resources and meet the size requirements of specific industries.

[0090] In some embodiments, when the memory of a virtual machine specifies space for the physical memory of the target machine, a specific physical address of the memory is specified for the virtual machine after obtaining the advanced authority (also known as advanced user) of the visual interface of the SDC.

[0091] In some embodiments, the visual interface of the SDC also configures the operating system type of each virtual machine, which operating system includes a real-time operating system and a non-real-time operating system. The CPU and memory of the virtual machine of the real-time operating system are exclusive to the virtual machine and have high real-time performance. The resources of the virtual machine of the non-real-time operating system are generally shared and are used for systems with large computing amounts and non-real-time requirements. In some embodiments, when configuring the CPU of the virtual machine, the physical CPU of the virtual machine where the real-time operating system is located or the scheduling time of the physical CPU is also configured to improve its real-time performance.

[0092] In some embodiments, each virtual machine type is also configured in the visual interface of the SDC, and the virtual machines include service virtual machines and user virtual machines. The resources of the service virtual machine provide shared services for each user virtual machine. For example, the file service, network service, etc. of the target machine can be provided in the form of a service virtual machine.

[0093] In some embodiments, the visual interface of the SDC also configures hardware resources for the hypervisor of the target machine, and the hardware resources of the hypervisor of the target machine include at least one of the following: physical CPU, memory space, debug serial port (including level), clock frequency, shared memory; wherein, after obtaining advanced permissions of the visual interface of the SDC, the physical CPU and memory space are specified for the hypervisor of the target machine.

[0094] In some embodiments, the hardware resource configuration of the hypervisor of the target machine is displayed on the SDC visualization interface, and modifications are made based on this.

[0095] S140: Using the new device tree new.dtb as the basic device tree, and according to the hardware resources configured for each virtual machine, obtaining the device tree vmx.dtb of each virtual machine.

[0096] Among them, for each virtual machine, select the corresponding node in the new device tree new.dtb according to the hardware resources configured for the virtual machine, and change the state of the node with status to enabled state ("enabled"), and save it as the device tree vmx.dtb of the virtual machine, where x represents the number of the virtual machine vm.

[0097] In some embodiments, when hardware resources are configured for the hypervisor of the target machine in the visual interface of the SDC, the device tree hypervisor.dtb of the hypervisor of the target machine is obtained based on the hardware resources configured for the hypervisor of the target machine and the new device tree new.dtb is used as the base device tree.

[0098] In some embodiments, the size of the image file of each virtual machine of the target machine and the hypervisor is obtained through the SDC server; according to the size of the device tree of each virtual machine of the target machine and the hypervisor and the size of the image file, the image file of each virtual machine of the target machine and the hypervisor and the loading address of the device tree of each virtual machine are added to the hypervisor device tree.

[0099] In summary, a method for configuring resources of a virtual machine in Example 1 is used for configuring a type 1 virtual machine. The virtual machine is visually configured through SDC, resources between virtual machines are isolated, and a new device tree for the virtual machine is generated, so that the hypervisor of the target machine allocates resources to the virtual machine to meet the resource size requirements. By configuring the resources and functions of the virtual machine through SDC, the development of the virtual machine is more flexible, the function selection is more appropriate, the operation is simpler, and the configuration interface is clear and easy to understand.

[0100] Combine the following Figure 2 A second embodiment of a resource configuration method for a virtual machine of the present application is introduced.

[0101] Embodiment 2 of a method for configuring resources of a virtual machine inherits all methods of embodiment 1 of a method for configuring resources of a virtual machine, specifically all its advantages, and further configures hardware resources for the hypervisor of the target machine, obtains the device tree hypervisor.dtb of the hypervisor of the target machine, and includes the device tree of the virtual machine and the loading address of the virtual machine image file in the hypervisor.dtb, thereby facilitating the startup of the virtual machine.

[0102] Figure 2 A second process of a method for configuring resources of a virtual machine is shown, including steps S210 to S250.

[0103] S210: Obtain the original device tree source.dtb on the hardware board of the target machine and the device tree and hypervisor device tree of the existing virtual machine on the target machine through the SDC server.

[0104] The SDC server runs the pre-installed system of the target machine, which has been started. The pre-installed system corresponds to an existing virtual machine running on the hypervisor of the target machine. The SDC visual interface runs on the SDC client, which runs on another independent computer.

[0105] S220: All nodes with status in the original device tree source.dtb are set to a disabled state through the FDT standard interface, and a new device tree new.dtb of the target machine is obtained.

[0106] The method and advantages of this step refer to step S120 of the first embodiment of a method for configuring virtual machine resources.

[0107] S230: configuring hardware resources for each virtual machine of the target machine, and using the new device tree new.dtb as a basic device tree, and obtaining the device tree vmx.dtb of each virtual machine according to the hardware resources configured for each virtual machine.

[0108] Among them, for the virtual machines already on the target machine, the resource configuration of the existing virtual machines is displayed on the visual interface of SDC, and then the resource configuration of the virtual machine is modified. For the virtual machines that are not currently on the target machine, the virtual machines are added on the visual interface of SDC, and then the resources are configured.

[0109] For each virtual machine vmx, this step includes the following sub-steps.

[0110] 1) Configure the CPU ID occupied by the virtual machine vmx, which is the ID of the physical CPU;

[0111] 2) Configure the virtual machine type, service / user virtual machine;

[0112] 3) Configure the operating system type, real-time / non-real-time;

[0113] 4) Configure transparent transmission physical devices, including serial ports, GPU, EMMC, USB, etc.;

[0114] 5) Configure virtual devices, including VNET, VBLK, and shared memory;

[0115] 6) Generate a new device tree vmx.dtb, using new.dtb as the basic device tree and generating a new vmx.dtb according to the configuration of the virtual machine.

[0116] S240: The Hypervisor of the target machine is obtained by using the new device tree new.dtb as the basic device tree and according to the hardware resources configured for the Hypervisor, obtaining the device tree Hypervisor.dtb of the Hypervisor.

[0117] The resource configuration of the target machine's hypervisor is displayed on the SDC visual interface and then modified.

[0118] Among them, this step includes the following sub-steps.

[0119] 1) Configure the debug serial port and debug level;

[0120] 2) Configure the clock frequency;

[0121] 3) Configure shared memory, etc.

[0122] 4) Advanced users configure the hypervisor's physical CPU ID and dedicated memory (optional sub-step);

[0123] 5) Advanced users specify specific physical addresses of memory for each virtual machine (optional sub-step).

[0124] 6) Generate a new device tree hypervisor.dtb, using new.dtb as the base device tree and according to the hypervisor configuration, generate a new hypervisor.dtb.

[0125] Among them, hypervisor.dtb includes the physical memory addresses specified by advanced users for each virtual machine.

[0126] S250: Calculate the loading address of the image and the device tree, generate the start.sh script file and change the hypervisor device tree of the target machine, and upload the start.sh script file and the hypervisor device tree to the SDC server.

[0127] Among them, this step includes the following sub-steps.

[0128] 1) The SDC client visualization interface accesses the device tree and virtual machine image file on the target machine through the FTP service and calculates the file size.

[0129] Among them, the device tree and virtual machine image files on the target machine have been uploaded to the SDC server, i.e. the target machine, in advance.

[0130] 2) Calculate the loading addresses of all device trees and virtual machine image files and add them to the start.sh script file.

[0131] The start.sh script file is used to start the hypervisor, which includes the hypervisor image file and the loading address of the device tree.

[0132] 3) Change the hypervisor.dtb file and fill the device tree of each virtual machine and the loading address of the virtual machine image file into the hypervisor.dtb file.

[0133] 4) Upload the start.sh script file, the device tree of the virtual machine, and the hypervisor.dtb file to the SDC server, that is, the target machine.

[0134] Figure 3 The data flow diagram of the device tree generation process of each virtual machine and hypervisor in the second embodiment of a virtual machine resource configuration method is shown. SDC first obtains source.dtb including all hardware resources, and then obtains hypervisor.dtb, vm0.dtb and vm1.dtb by allocating resources and changing the device tree. Among them, the three virtual machines vm0 and vm1 in the figure are examples of two virtual machines, and more virtual machines can be included.

[0135] In summary, a second embodiment of a resource configuration method for a virtual machine configures hardware resources for the hypervisor of the target machine and each virtual machine, obtains the device tree hypervisor.dtb of the hypervisor of the target machine, and the hypervisor.dtb includes the device tree of the virtual machine and the loading address of the virtual machine image file, so as to facilitate the startup of the virtual machine.

[0136] Combine the following Figure 4 A first embodiment of a method for starting a virtual machine of the present application is introduced.

[0137] A method for starting a virtual machine in accordance with embodiment 1 starts a virtual machine according to a virtual machine device tree generated in embodiment 1 of a method for configuring resources of a virtual machine, and has all the advantages of embodiment 1 of a method for configuring resources of a virtual machine.

[0138] Figure 4 The flowchart of a first embodiment of a method for starting a virtual machine is shown, which runs in a target machine and includes steps S410 to S430.

[0139] S410: Obtain a device tree for each virtual machine on a target machine generated according to the method described in Embodiment 1 of a method for configuring resources of a virtual machine.

[0140] In some embodiments, when the startup program of the virtual machine includes the loading addresses of the device trees of each virtual machine and the hypervisor of the target machine, the hypervisor obtains the device tree of each virtual machine hypervisor from these loading addresses.

[0141] S420: Allocate hardware resources to each virtual machine according to the device tree of the virtual machine when the hypervisor of the target machine is running.

[0142] In some embodiments, when the hypervisor of the target machine is running, it parses the device tree vmx.dtb of each virtual machine and the device tree hypervisor.dtb of the hypervisor through the FDT standard interface, fills the parsed results into the structure defined by the Hypervisor, and obtains the structure describing the hardware resources of the target machine for use in the initialization interface. The structure includes the resource structure of the hypervisor and each virtual machine; initializes the relevant interface according to each structure, and allocates hardware resources to the hypervisor and each virtual machine.

[0143] In some embodiments, when the hypervisor device tree of the target machine includes the device trees and image file loading addresses of each virtual machine and hypervisor of the target machine, the hypervisor obtains the device tree and image file of each virtual machine from these loading addresses.

[0144] S430: Running the image of each virtual machine on the hardware resources allocated to the virtual machine to start the virtual machine.

[0145] The CPU allocated to each virtual machine runs the image file of the virtual machine, and the operating system of the virtual machine is moved according to the device tree of the virtual machine.

[0146] Combine the following Figure 5 A second embodiment of a method for starting a virtual machine of the present application is introduced.

[0147] A second embodiment of a method for starting a virtual machine starts the virtual machine according to the virtual machine device tree and hypervisor device tree generated by the second embodiment of a method for configuring resources of a virtual machine, and executes the content of the start.sh script file under uboot to start the virtual machine, which has all the advantages of the second embodiment of a method for configuring resources of a virtual machine.

[0148] Figure 5 The flowchart of Embodiment 2 of a method for starting a virtual machine is shown, which runs in a target machine and includes steps S510 to S540.

[0149] S510: Execute the start.sh script under the uboot of the target machine. Start.sh starts the hypervisor.

[0150] The start.sh script includes the device tree of the hypervisor and the loading address of the image file. Start.sh obtains the device tree and the image file of the hypervisor from the loading address and runs the hypervisor image file to start the hypervisor.

[0151] S520: The hypervisor obtains the device tree and image file of each virtual machine.

[0152] After the hypervisor is running, the device tree and the image file of each virtual machine are obtained from the loading address of the device tree and the image file of each virtual machine in the hypervisor device tree.

[0153] S530: When the hypervisor is running, the device trees are parsed using the encapsulated interface and the FDT standard interface to obtain resource structures of the hypervisor and each virtual machine, and hardware resources are allocated to the hypervisor and each virtual machine according to each structure.

[0154] S540: The hypervisor runs the image of each virtual machine on the hardware resources allocated to the virtual machine, and starts the virtual machine according to the device tree of the virtual machine.

[0155] The CPU allocated to each virtual machine runs the image file of the virtual machine, and the operating system of the virtual machine is moved according to the device tree of the virtual machine.

[0156] Combine the following Figure 6 A first embodiment of a resource configuration device for a virtual machine is introduced.

[0157] Embodiment 1 of a resource configuration device for a virtual machine is used to implement the method of embodiment 1 of a resource configuration method for a virtual machine, and has all the advantages thereof.

[0158] Figure 6 The structure of a first embodiment of a resource configuration device for a virtual machine is shown, which is deployed in a client of an SDC and includes: an original device tree module 610 and a resource configuration module 620 .

[0159] The original device tree module 610 is used to obtain the original device tree source.dtb on the hardware board of the target machine; it is also used to set all nodes with status in the original device tree source.dtb to the disabled state, and obtain the new device tree new.dtb of the target machine. For its working principle and advantages, please refer to steps S110 and S120 of the first embodiment of a resource configuration method for a virtual machine.

[0160] The resource configuration module 620 is used to configure hardware resources for each virtual machine of the target machine; it is also used to obtain the device tree vmx.dtb of each virtual machine based on the hardware resources configured for each virtual machine using the new device tree new.dtb as the basic device tree. For its working principle and advantages, please refer to steps S130 and S140 of the first embodiment of a method for configuring resources for a virtual machine.

[0161] Combine the following Figure 7 A second embodiment of a resource configuration device for a virtual machine is introduced.

[0162] Embodiment 2 of a resource configuration device for a virtual machine is used to implement the method of embodiment 2 of a resource configuration method for a virtual machine, and has all its advantages.

[0163] Figure 7 The structure of a second embodiment of a resource configuration device for a virtual machine is shown, which is deployed in a client of an SDC and includes: an original device tree module 710 , a virtual machine configuration module 720 , a Hypervisor configuration module 730 and an address adding module 740 .

[0164] The original device tree module 710 is used to obtain the original device tree source.dtb on the hardware board of the target machine and the device tree and hypervisor device tree of the existing virtual machine on the target machine through the SDC server; it is also used to set all nodes with status in the original device tree source.dtb to the disabled state, and obtain the new device tree new.dtb of the target machine. For its working principle and advantages, please refer to steps S210 and S220 of the second embodiment of a resource configuration method for a virtual machine.

[0165] The virtual machine configuration module 720 is used to configure hardware resources for each virtual machine of the target machine, and uses the new device tree new.dtb as the basic device tree, and obtains the device tree vmx.dtb of each virtual machine according to the hardware resources configured for each virtual machine. For its working principle and advantages, please refer to step S230 of the second embodiment of a method for configuring resources of a virtual machine.

[0166] The Hypervisor configuration module 730 is used to configure the Hypervisor of the target machine, and uses the new device tree new.dtb as the basic device tree, and obtains the Hypervisor device tree Hypervisor.dtb according to the hardware resources configured for the Hypervisor. For its working principle and advantages, please refer to step S240 of the second embodiment of a method for configuring resources of a virtual machine.

[0167] The address adding module 740 is used to calculate the loading address of the image and the device tree, generate the start.sh script file and change the hypervisor device tree of the target machine, and upload the start.sh script file and the hypervisor device tree to the SDC server. For its working principle and advantages, please refer to step S250 of the second embodiment of a method for configuring resources of a virtual machine.

[0168] Combine the following Figure 8 A first embodiment of a device for starting a virtual machine is introduced.

[0169] Embodiment 1 of a virtual machine startup device is used to implement a virtual machine startup method. The method of embodiment 1 has all the advantages thereof.

[0170] Figure 8 The structure of a first embodiment of a virtual machine startup device is shown, which is deployed in a target machine and includes: an acquisition module 810 , an allocation module 820 and a startup module 830 .

[0171] The acquisition module 810 is used to acquire the device tree of each virtual machine on the target machine generated according to the method described in Embodiment 1 of a method for configuring resources of a virtual machine. For its working principle and advantages, please refer to step S410 of Embodiment 1 of a method for configuring the starting point of a virtual machine.

[0172] The allocation module 820 is used to allocate hardware resources to each virtual machine according to the device tree of each virtual machine when the hypervisor of the target machine is running. For its working principle and advantages, please refer to step S420 of the first embodiment of a method for starting a virtual machine.

[0173] The startup module 830 is used to run the image of each virtual machine on the hardware resources allocated to the virtual machine to start the virtual machine. For its working principle and advantages, please refer to step S430 of the first embodiment of a method for starting a virtual machine.

[0174] Combine the following Fig. 9 A second embodiment of a virtual machine startup device is introduced.

[0175] Embodiment 2 of a virtual machine startup device is used to implement the method of embodiment 2 of a virtual machine startup method, and has all its advantages.

[0176] Fig. 9 The structure of a second embodiment of a virtual machine startup device is shown, which is deployed in a target machine and includes: a boot module 910 , an acquisition module 920 , an allocation module 930 and a startup module 940 .

[0177] The boot module 910 is used to execute the start.sh script under the uboot of the target machine, and start.sh starts the hypervisor. For its working principle and advantages, please refer to step S510 of the second embodiment of a method for starting a virtual machine.

[0178] The acquisition module 920 is used for the hypervisor to acquire the device tree and image file of each virtual machine. For its working principle and advantages, please refer to step S530 of the second embodiment of a method for determining the starting point of a virtual machine.

[0179] The allocation module 930 is used to parse each device tree through the encapsulated interface with the FDT standard interface when the hypervisor is running, obtain the resource structure of the hypervisor and each virtual machine, and allocate hardware resources to the hypervisor and each virtual machine according to each structure. For its working principle and advantages, please refer to step S530 of the second embodiment of a method for starting a virtual machine.

[0180] The startup module 940 is used for the hypervisor to run the image of each virtual machine on the hardware resources allocated to the virtual machine, and to start the virtual machine according to the device tree of the virtual machine. For its working principle and advantages, please refer to step S540 of the second embodiment of a method for starting a virtual machine.

[0181] The present application embodiment also provides a computing device, Fig.10 Detailed introduction.

[0182] The computing device 1000 includes a processor 1010 , a memory 1020 , a communication interface 1030 , and a bus 1040 .

[0183] It should be understood that the communication interface 1030 in the computing device 1000 shown in this figure can be used to communicate with other devices.

[0184] The processor 1010 may be connected to a memory 1020. The memory 1020 may be used to store the program code and data. Therefore, the memory 1020 may be a storage unit inside the processor 1010, or an external storage unit independent of the processor 1010, or a component including a storage unit inside the processor 1010 and an external storage unit independent of the processor 1010.

[0185] Optionally, the computing device 1000 may further include a bus 1040. The memory 1020 and the communication interface 1030 may be connected to the processor 1010 via the bus 1040. The bus 1040 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus 1040 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the figure is represented by only one line, but it does not mean that there is only one bus or one type of bus.

[0186] It should be understood that in the embodiment of the present application, the processor 1010 may adopt a central processing unit (CPU). The processor may also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. Alternatively, the processor 1010 may adopt one or more integrated circuits to execute relevant programs to implement the technical solutions provided in the embodiment of the present application.

[0187] The memory 1020 may include a read-only memory and a random access memory, and provides instructions and data to the processor 1010. A portion of the processor 1010 may also include a nonvolatile random access memory. For example, the processor 1010 may also store information on the device type.

[0188] When the computing device 1000 is running, the processor 1010 executes the computer-executable instructions in the memory 1020 to perform the operating steps of each method embodiment.

[0189] It should be understood that the computing device 1000 according to the embodiment of the present application can correspond to the corresponding subject in the method according to each embodiment of the present application, and the above-mentioned and other operations and / or functions of each module in the computing device 1000 are respectively for realizing the corresponding process of each method of the present embodiment, which will not be repeated here for the sake of brevity.

[0190] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0191] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0192] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0193] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0194] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0195] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0196] The embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, it is used to execute the operating steps of each method embodiment.

[0197] The computer storage medium of the embodiment of the present application can adopt any combination of one or more computer-readable media.Computer-readable media can be computer-readable signal media or computer-readable storage media.Computer-readable storage media can be, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any combination of the above.More specific examples (non-exhaustive lists) of computer-readable storage media include, electrical connections with one or more wires, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above.In this document, computer-readable storage media can be any tangible medium containing or storing programs, which can be used by instruction execution systems, devices or devices or used in combination with them.

[0198] Computer-readable signal media may include data signals transmitted in baseband or as part of a carrier wave, which carry computer-readable program code. Such transmitted data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, transmit, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0199] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0200] Computer program code for performing the operation of the present application can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (e.g., using an Internet service provider to connect through the Internet).

[0201] Note that the above are only preferred embodiments of the present application and the technical principles used. Those skilled in the art will understand that the present application is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present application. Therefore, although the present application is described in more detail through the above embodiments, the present application is not limited to the above embodiments, and may also include more other equivalent embodiments without departing from the concept of the present application, all of which belong to the scope of protection of the present application.

Claims

1. A method for configuring resources of a virtual machine, characterized in that: The resources of the virtual machine of the target machine are configured through the visual interface of the SDC. The configuration method includes: Obtaining a raw device tree on a hardware board of a target machine, wherein all hardware resources on the target machine have nodes in the raw device tree; Setting all nodes in the original device tree to a disabled state to obtain a new device tree for the target machine; Hardware resources are configured for each virtual machine of the target machine, and the device tree of each virtual machine is obtained based on the hardware resources configured for each virtual machine using the new device tree as a base device tree.

2. The configuration method according to claim 1, characterized in that: The hardware resources of each virtual machine include at least one of the following: number of CPUs, memory size, transparent physical devices, and virtual devices; When the memory of a virtual machine specifies space for the physical memory of the target machine, a memory address is specified for the virtual machine after obtaining the advanced permission of the visualization interface; When configuring the CPU of a virtual machine, the physical CPU of the virtual machine where the real-time operating system is located is also configured.

3. The configuration method according to claim 1, characterized in that: Also includes: Configuring hardware resources for a hypervisor of a target machine, and using the new device tree as a base device tree, obtaining a device tree for the hypervisor based on the hardware resources configured for the hypervisor, wherein the hardware resources of the hypervisor include at least one of the following: a physical CPU, memory space, a debug serial port, a clock frequency, and a shared memory; After obtaining the advanced authority of the visualization interface, a physical CPU and memory space are specified for the hypervisor.

4. The configuration method according to claim 1, characterized in that: Also includes: Configuring an operating system type for each virtual machine, wherein the operating system includes a real-time operating system and a non-real-time operating system; and / or Configure each virtual machine type. Virtual machines include service virtual machines and user virtual machines. The resources of the service virtual machine provide shared services for each user virtual machine.

5. The configuration method according to claim 4, characterized in that: Also includes: Obtain the image file size of each virtual machine and the hypervisor of the target machine; According to the size of the device tree of each virtual machine of the target machine and the hypervisor and the size of the image file, the loading address of the image file device tree of each virtual machine of the target machine is added to the hypervisor device tree, and the loading address of the image file device tree of the hypervisor is added to the startup file of the hypervisor.

6. A method for starting a virtual machine, characterized in that: include: Obtain a device tree for each virtual machine on the target machine according to any one of the methods described in claims 1 to 5; The hardware resources allocated to each virtual machine according to the device tree of each virtual machine when the hypervisor of the target machine is running; The image of each virtual machine is run on the hardware resources allocated to the virtual machine to start the virtual machine.

7. The startup method according to claim 6, characterized in that: The hardware resources allocated to each virtual machine according to the device tree of each virtual machine when the hypervisor of the target machine is running include: When the hypervisor is running, it parses the device tree of each virtual machine and the device tree of the hypervisor through the FDT standard interface to obtain a structure describing the hardware resources of the target machine; Hardware resources are allocated to the hypervisor and each virtual machine according to the structure.

8. The startup method according to claim 6, characterized in that: Also includes: When the hypervisor device tree includes the device tree of each virtual machine of the target machine and the loading address of the image file, the device tree and the image file of each virtual machine of the target machine are obtained from the loading address when the hypervisor is running.

9. A resource configuration device for a virtual machine, characterized in that: The configuration device is used to configure the resources of the virtual machine of the target machine through the visual interface of the SDC, and the configuration device includes: The original device tree module is used to obtain the original device tree on the hardware board of the target machine, wherein all hardware resources on the target machine have nodes in the original device tree; and is also used to set all nodes in the original device tree to a disabled state to obtain a new device tree for the target machine; The resource configuration module is used to configure hardware resources for each virtual machine of the target machine, and obtain the device tree of each virtual machine based on the hardware resources configured for each virtual machine using the new device tree as the basic device tree.

10. A virtual machine startup device, characterized in that: include: An acquisition module, configured to obtain a device tree of each virtual machine on a target machine according to any one of claims 1 to 5; The allocation module is used to allocate hardware resources to each virtual machine according to the device tree of each virtual machine when the hypervisor of the target machine is running; The startup module is used to run the image of each virtual machine on the hardware resources allocated to the virtual machine to start the virtual machine.

11. A computing device, characterized in that include, bus; a communication interface connected to the bus; at least one processor connected to the bus; as well as At least one memory is connected to the bus and stores program instructions, and when the program instructions are executed by the at least one processor, the at least one processor executes the method according to any one of claims 1 to 8.

12. A computer-readable storage medium, characterized in that Program instructions are stored thereon, and when the program instructions are executed by a computer, the computer is caused to execute the method according to any one of claims 1 to 8.