Container creation method and device, operating system, equipment and storage medium
By storing configuration data in the container partition memory and utilizing container engine partition management, the problem of container configuration data acquisition under the microkernel architecture is solved, and the simplicity and performance of the container system are improved.
Patent Information
- Application Number
- CN202310341817.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-31
- Publication Date
- 2024-10-01
AI Technical Summary
In the existing technology, the partition operating system with microkernel architecture cannot provide a file system to obtain container configuration data, resulting in low configuration efficiency, poor maintenance, and poor performance of the container system.
Store the container's configuration data in the partition memory corresponding to each container, configure the container based on these data when the container running image is started, and create and manage container configuration data through the container engine partition.
It improves the simplicity, maintainability and performance of the container system, solves the problem that the microkernel cannot provide the file system to obtain container configuration data, and makes container configuration more efficient.
Smart Images

Figure CN118733189A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of embedded operating systems, and in particular to a container creation method, device, operating system, equipment and storage medium. Background Art
[0002] The current mainstream container implementation methods all add complex container function support to the operating system kernel. For example, on Linux, container support is mainly implemented through NameSpace, Control Group, and UFS. The configuration data of the container is stored in the container configuration data file. When the operating system starts the container, the container configuration data in the container configuration data file is read through the file system, and then the container is initialized using the read container configuration data.
[0003] The operation of containers requires that the operating system kernel must provide file system functions, which is not suitable for partitioned operating systems with a highly secure microkernel architecture. Summary of the invention
[0004] In view of this, an embodiment of the present invention provides a container creation method, apparatus, operating system, device and storage medium, and creates containers on each microkernel-based partition, the method comprising: storing the configuration data of the container in the memory of the partition corresponding to each container; and configuring the container according to the configuration data of the container when the running image of each container is started. The technical solution of the present invention solves the problem that the microkernel cannot provide a file system to obtain the container configuration data by storing the configuration data of the container in the memory of the partition corresponding to each container, making the configuration of each container of the container system more efficient, and improving the simplicity, maintainability and performance of the container system.
[0005] In a first aspect, an embodiment of the present invention provides a method for creating a container, which is used to create containers on each microkernel-based partition, including: storing configuration data of the container in the memory of the partition corresponding to each container; and configuring the running image of each container according to the configuration data of the container when the container is started.
[0006] From the above, by storing the configuration data of each container in the memory of the partition corresponding to each container, the problem that the microkernel cannot provide a file system to obtain the container configuration data is solved, making the configuration of each container in the container system more efficient and improving the simplicity, maintainability and performance of the container system.
[0007] In a possible implementation of the first aspect, storing configuration data of the container in a memory of a partition of each container includes: storing configuration data of the container corresponding to the partition in a set interval of a first memory in the memory of each partition, storing a running image of the container of the partition in the first memory of each partition; and retaining a corresponding address interval in a file of the running image corresponding to the partition in the set interval of the first memory of each partition.
[0008] As mentioned above, the configuration data of the container is saved in the memory interval corresponding to the memory of the partition in the setting interval of the running image of the container, which can more concisely manage the real-time container configuration data and further improve the simplicity, performance and maintainability of the container operating system.
[0009] In a possible implementation of the first aspect, the container system also includes a container engine partition deployed on an independent microkernel-based partition; before storing the configuration data of each container in the memory of the partition corresponding to the container, it also includes: the container engine partition creates a partition corresponding to the container on the microkernel, and loads the running image corresponding to the partition in the first memory of the partition.
[0010] As described above, the partitions corresponding to each container are created through the container engine, so that the configuration data of the corresponding container can exist in the memory of the partition corresponding to each container, solving the problem that the microkernel cannot provide a file system to obtain the container configuration data.
[0011] In a possible implementation of the first aspect, storing configuration data corresponding to each partition in a set interval of the first memory of the partition specifically includes: the container engine storing the configuration data of the container of each partition in a container control block of the partition; and the container engine obtaining the configuration data of the container of the partition from the container control block of each partition, and saving the data to the set interval of the first memory of the partition.
[0012] From the above, the running image of the container corresponding to the partition is loaded into the first memory of the partition through the container engine, which solves the problem that the microkernel cannot provide a file system to obtain container configuration data, making the configuration of each container in the container system more efficient.
[0013] In a possible implementation manner of the first aspect, the container configuration data of each container includes at least the disk space size of the container and information of each device; and the running image of each container configures the container according to the configuration data of the container when it is started, including: when the running image of each container is started, initializing the file system of the container according to the disk space size in the configuration data of the container, and initializing each device according to the information of each device in the configuration data of the container.
[0014] As described above, the configuration of the container is completed by initializing the file system of the container according to the disk space size in the configuration data of the container, and initializing each device according to the information of each device in the configuration data of the container.
[0015] In a possible implementation manner of the first aspect, the configuration data of each container further includes: description information of the container, a set of CPU cores for affinity running, and a memory space size.
[0016] As described above, by including the CPU core set and memory space size for affinity running in the container configuration data, the container can be aware of its own resources when running, thereby facilitating the utilization of resources.
[0017] In a second aspect, an embodiment of the present invention provides a container creation device for creating containers on each microkernel-based partition, including: a data storage module for storing configuration data of the container in the memory of the partition corresponding to each container; and a container configuration module for configuring the container according to the configuration data of the container when the running image of each container is started.
[0018] From the above, by storing the configuration data of each container in the memory of the partition corresponding to each container, the problem that the microkernel cannot provide a file system to obtain the container configuration data is solved, making the configuration of each container in the container system more efficient and improving the simplicity, maintainability and performance of the container system.
[0019] In a possible implementation of the second aspect, the data storage module is specifically used to store configuration data of a container corresponding to a partition in a set interval of the first memory in the memory of each partition, and the running image of the container of the partition is stored in the first memory of each partition; the set interval of the first memory of each partition is reserved in the corresponding address interval in the file of the running image corresponding to the partition.
[0020] As mentioned above, the configuration data of the container is saved in the memory interval corresponding to the memory of the partition in the setting interval of the running image of the container, which can more concisely manage the real-time container configuration data and further improve the simplicity, performance and maintainability of the container operating system.
[0021] In a possible implementation of the second aspect, the container system also includes a container engine partition deployed on an independent microkernel-based partition; the device also includes: before storing the configuration data of the container in the memory of the partition corresponding to each container, the container engine partition creates a partition corresponding to the container on the microkernel; the data storage module is also specifically used to load the running image corresponding to the partition in the first memory of the partition.
[0022] As described above, the partitions corresponding to each container are created through the container engine, so that the configuration data of the corresponding container can exist in the memory of the partition corresponding to each container, solving the problem that the microkernel cannot provide a file system to obtain the container configuration data.
[0023] In a possible implementation of the second aspect, when the data storage module stores the configuration data corresponding to the partition in the set interval of the first memory of each partition, the method includes: the container engine stores the configuration data of the container of each partition in the container control block of the partition; the container engine obtains the configuration data of the container of the partition from the container control block of each partition, and saves it to the set interval of the first memory of the partition.
[0024] From the above, the running image of the container corresponding to the partition is loaded into the first memory of the partition through the container engine, which solves the problem that the microkernel cannot provide a file system to obtain container configuration data, making the configuration of each container in the container system more efficient.
[0025] In a possible implementation of the second aspect, the container configuration data of each container includes at least the disk space size of the container and information of each device; the container configuration module is used to initialize the file system of the container according to the disk space size in the configuration data of the container when the running image of each container is started, and initialize each device according to the information of each device in the configuration data of the container.
[0026] As described above, the configuration of the container is completed by initializing the file system of the container according to the disk space size in the configuration data of the container, and initializing each device according to the information of each device in the configuration data of the container.
[0027] In a possible implementation manner of the second aspect, the configuration data of each container further includes: description information of the container, a set of CPU cores for affinity running, and a memory space size.
[0028] As described above, by including the CPU core set and memory space size of affinity running in the container configuration data, the container can be aware of its own resources when running, thereby facilitating the utilization of resources.
[0029] In a third aspect, an embodiment of the present invention provides a container operating system, which creates a container through any implementation described in the first aspect of the present invention.
[0030] In a fourth aspect, a computing device is provided, comprising: a bus; a communication interface connected to the bus; at least one processor connected to the bus; and at least one memory connected to the bus and storing program instructions, wherein when the program instructions are executed by the at least one processor, the at least one processor executes any one of the embodiments of the first aspect of the present invention.
[0031] In a fifth aspect, a computer-readable storage medium is provided, on which program instructions are stored. When the program instructions are executed by a computer, the computer executes any implementation of the first aspect of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1A A schematic diagram of the architecture of a container system according to a first embodiment of a method for creating a container of the present invention;
[0033] Figure 1B A schematic diagram of a process of a method for creating a container according to a first embodiment of the present invention;
[0034] Figure 2A This is a schematic diagram of the architecture of a container system according to Embodiment 2 of a method for creating a container of the present invention;
[0035] Figure 2B This is a schematic diagram of a flow chart of a second embodiment of a method for creating a container of the present invention;
[0036] Figure 3 A schematic diagram of the structure of a container running image in Embodiment 2 of a method for creating a container of the present invention;
[0037] Figure 4 It is a structural schematic diagram of a first embodiment of a device for creating a container of the present invention;
[0038] Figure 5 It is a structural schematic diagram of a second embodiment of a device for creating a container of the present invention;
[0039] Figure 6 Schematic diagram of the structure of the computing device according to various embodiments of the present invention. DETAILED DESCRIPTION
[0040] 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.
[0041] 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 invention described here can be implemented in an order other than that illustrated or described here.
[0042] 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.
[0043] 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 the present invention belongs. The terms used herein are only for the purpose of describing the embodiments of the present invention and are not intended to limit the present invention.
[0044] A partition is an abstraction of relatively independent space, time, and device resources, forming an entity that is as close to real independent computer resources as possible. A partition is abstracted as an operating unit, with operating space, operating time, status, priority, scheduling policy, operating context, and CPU properties bound to the operating physics. When the operating status and operating image usage of the partition are uniformly managed, the partition is now a real-time container, which still maintains isolation of operating time and operating space and has resource isolation characteristics.
[0045] The microkernel of the partition operating system of the microkernel framework does not support a file system. The purpose of the present invention is to implement lightweight real-time container configuration by storing configuration data in a container memory in the field of the partition operating system of the microkernel framework.
[0046] The embodiment of the present invention provides a container creation method, apparatus, operating system, device and storage medium, and creates containers on each microkernel-based partition, and the method includes: storing the configuration data of the container in the memory of the partition corresponding to each container; and configuring the container according to the configuration data of the container when the running image of each container is started. The technical solution of the present invention solves the problem that the microkernel cannot provide a file system to obtain the container configuration data by storing the configuration data of the container in the memory of the partition corresponding to each container, making the configuration of each container of the container system more efficient, and improving the simplicity, maintainability and performance of the container system.
[0047] Let's first combine Figures 1A to 3 Various embodiments of a method for creating a container according to the present invention are introduced.
[0048] A container creation method embodiment 1 creates containers on each microkernel-based partition, and stores configuration data of the container in the memory of the partition corresponding to each container; the running image of each container configures the container according to the configuration data of the container when it is started. The technical solution of this embodiment solves the problem that the microkernel cannot provide a file system to obtain container configuration data by storing the configuration data of the container in the memory of the partition corresponding to each container, making the configuration of each container of the container system more efficient and improving the simplicity, maintainability and performance of the container system.
[0049] Figure 1A The architecture of a container system of a first embodiment of a method for creating a container is shown.
[0050] The container system includes several containers, each of which is a real-time container, and each container is deployed on an independent microkernel-based partition. By implementing containers on partitions, the container system is not only lightweight, but also has high real-time performance. This container system is also called a lightweight real-time container system.
[0051] In some embodiments, the microkernel provides independent hardware resources for the partition corresponding to each container, and the hardware resources include a set of CPU cores, memory space, and devices that run in an affinity manner. The partition corresponding to each container has independent hardware resources, which improves the real-time performance of each container. In this case, each container is called a real-time container. The configuration data of the container is stored in the memory of the partition corresponding to each container.
[0052] Figure 1B The flowchart of a first embodiment of a method for creating a container is shown, including steps S110 and S120.
[0053] S110: Storing configuration data of each container in the memory of the partition corresponding to the container.
[0054] In some embodiments, a setting interval of a first memory in the memory of each partition stores configuration data of a container corresponding to the partition, and a running image of the container of the partition is stored in the first memory of each partition.
[0055] In some embodiments, configuration data of the container of each partition is stored in advance in the container control block of the partition.
[0056] In some embodiments, the configuration data of each container includes: the disk space size of the container and information of each device, the disk space size is the logical space of the container on the disk, and the device includes at least one of the following: a virtual network card device, a serial port device, a CAN device, an SPI device, a USB device, and a GPIO device.
[0057] In some embodiments, the configuration data of the container further includes: container description information, a set of CPU cores for affinity operation, and a memory space size. The set of CPU cores for affinity operation and the memory space size are the same as the set of CPU cores for affinity operation and the memory space size of the corresponding partition.
[0058] In some embodiments, the microkernel performs this step, and in other embodiments, this step is performed by establishing other partitions on the microkernel.
[0059] S120: When starting, the running image of each container configures the container according to the configuration data of the container.
[0060] In some embodiments, when starting, the running image of each container initializes the file system of the container according to the disk space size in the configuration data of the container, and initializes each device according to the information of each device in the configuration data of the container to complete the configuration of the container.
[0061] In some embodiments, the running image of each container obtains the configuration data of the container from the container control block of the partition corresponding to the container when starting.
[0062] In summary, embodiment 1 of a method for creating a container solves the problem that the microkernel cannot provide a file system to obtain container configuration data by storing the configuration data of the container in the memory of the partition corresponding to each container, thereby making the configuration of each container in the container system more efficient and improving the simplicity, maintainability and performance of the container system.
[0063] A second embodiment of a method for creating a container inherits the method of the first embodiment of a method for creating a container, and has all the advantages of the first embodiment of a method for creating a container. In addition, the configuration data of the container is stored in a memory interval corresponding to the set interval of the running image of the container in the partition memory according to actual scenario requirements through the container engine partition, thereby further improving the simplicity, maintainability and performance of the container system.
[0064] Figure 2A The architecture of the container system of the second embodiment of a method for creating a container is shown. A container engine partition is added on the basis of the architecture of the container system of the first embodiment of a method for creating a container. The container engine partition is independent of the partition corresponding to each container. The microkernel provides independent hardware resources for the container engine partition and the partition corresponding to each container. The hardware resources include a set of CPU cores, memory space, and devices that run in an affinity manner. All containers in the figure are real-time containers.
[0065] The configuration data of the container engine is stored in the memory of the partition, and the configuration data of each container is stored in the memory of the partition corresponding to the container.
[0066] Figure 2B The flowchart of a second embodiment of a method for creating a container is shown, including steps S210 to S270.
[0067] For the sake of convenience, this embodiment is described by taking the first container as an example.
[0068] S210: When generating a running image of the first container, a set interval is reserved in the code segment of the running image to store configuration data of the first container.
[0069] The setting interval is blank in the running image of the first container. When the running image of the first container is subsequently stored in the memory of the corresponding partition, the configuration data of the first container is saved in the memory interval corresponding to the setting interval.
[0070] Figure 3 The structure of a container running image in Embodiment 2 of a method for creating a container is shown.
[0071] For example, Figure 3 The setting interval is to reserve a fixed size of 0x1000 space at a fixed offset of 0x1000 from the start address of the running image code segment.
[0072] As described above, a setting interval is reserved in the running image of the container, so that the configuration data of the container can be saved in the corresponding interval of the setting interval of the running image in the memory of the partition.
[0073] S220: Create partitions on the microkernel, where each partition includes a container engine partition and partitions corresponding to each container.
[0074] In some embodiments, the container engine partition and the partitions corresponding to each container are created simultaneously by the microkernel, and a set of CPU cores and memory space for affinity operation are allocated to each partition.
[0075] In some embodiments, the microkernel first creates a container engine partition and allocates affinity CPU cores and memory space to the container engine partition. Then, the container engine partition creates partitions corresponding to related containers according to the needs of the actual scenario, and allocates affinity CPU cores and memory space to the partitions corresponding to each container.
[0076] S230: The container engine partition saves the configuration data of the first container to the container control block of the partition corresponding to the first container.
[0077] Among them, the configuration data of each container includes fixed items and non-fixed items. The fixed items include container description information, affinity-running CPU core set, memory space size, disk space size, number of virtual network card devices, number of serial port devices, number of CAN devices, number of SPI devices, number of USB devices, and number of GPIO devices. The affinity-running CPU core set and memory space size are the same as the affinity-running CPU core set and memory space size of the corresponding partition. The non-fixed items include device information of each device in each device.
[0078] Among them, when the number of a certain device among the number of virtual network card devices, serial port devices, CAN devices, SPI devices, USB devices, and GPIO devices in the fixed item content is not 0, the non-fixed item content includes the device information of each device of this type of device; when the number of a certain device among the number of virtual network card devices, serial port devices, CAN devices, SPI devices, USB devices, and GPIO devices in the fixed item content is 0, the non-fixed item content includes the device information of this type of device.
[0079] In some implementations, the container engine partition obtains the first container creation parameter to generate configuration data of the first container.
[0080] In some embodiments, the container engine partition first saves the fixed item content in the container control block of the partition corresponding to the first container, and then saves the non-fixed item content according to the number of each device in the fixed item content.
[0081] As described above, the fixed item content is first saved through the configuration data of the container, and then the number and device information of each device are saved, so as to minimize the configuration data space of the container and make the real-time container partition running image smaller.
[0082] S240: When starting the first container, the container engine partition reads the corresponding running image file on the hard disk according to the running image name in the container control block of the partition corresponding to the first container, and saves it to the memory of the partition corresponding to the first container.
[0083] S250: The container engine partition writes the configuration data in the container control block of the first container to the memory corresponding to the running image of the partition corresponding to the first container.
[0084] The running image of the first container is stored in a first memory of the memory of the partition corresponding to the first container, and the setting interval of the running image of the first container corresponds to an interval in the first memory. For example, the corresponding interval takes the 0X1000 address of the code segment of the running image of the first container as the starting address, and the interval size is 0X1000.
[0085] As mentioned above, the configuration data of the container is saved in the memory interval corresponding to the memory of the partition in the setting interval of the running image of the container, which can more concisely manage the real-time container configuration data and further improve the simplicity, performance and maintainability of the container operating system.
[0086] S260: When the running image of the first container is started, the configuration data of the first container in the running memory of the running image of the first container is read.
[0087] When accessing the fixed item content of the first container, the configuration data of the fixed item content of the real-time container is directly accessed according to the data member name; when accessing the non-fixed item content of the real-time container, the configuration data of the non-fixed item content is accessed according to the number of devices.
[0088] S270: The running image of the first container initializes the first container according to the configuration data of the first container.
[0089] Among them, when accessing the configuration data of the container, first access the fixed item content, and access the configuration data of the fixed item content directly according to the data member name, then access the non-fixed item content according to the number of devices of the fixed item content, and access the configuration data of the non-fixed item content according to the number of devices and the size of the device information.
[0090] For example, initialization of the first container includes the following container configuration process:
[0091] 1) If the partition of the first container is configured with a network protocol stack and the number of virtual network card devices in the configuration data is not 0, the network protocol stack is initialized using the virtual network card device information in the configuration data;
[0092] 2) If the partition of the first container is configured with NFS (Network File System) and the disk space size of the configuration data is not 0, the disk space size in the configuration data is used to initialize the NFS client to complete the file system configuration of the first container;
[0093] 3) If the partition of the first container is configured with a serial port device and the number of serial ports in the configuration data is not 0, the serial port device information in the configuration data is used to initialize the serial port device;
[0094] 4) If the partition of the first container is configured with a CAN device and the number of CANs in the configuration data is not 0, the CAN device information in the configuration data is used to initialize the CAN device;
[0095] 5) If the partition of the first container is configured with an SPI device and the number of SPIs in the configuration data is not 0, the SPI device information in the configuration data is used to initialize the SPI device;
[0096] 6) If the partition of the first container is configured with a USB device and the number of USBs in the configuration data is not 0, the USB device information in the configuration data is used to initialize the USB device;
[0097] 7) If the partition of the first container is configured with a GPIO device and the GPIO number in the configuration data is not 0, the GPIO device information in the real-time container configuration data is used to initialize the GPIO device.
[0098] In summary, embodiment 2 of a method for creating a container stores the configuration data of the container in a memory interval corresponding to a set interval of the running image of the container in the partitioned memory according to actual scenario requirements through container engine partitioning, thereby further improving the simplicity, maintainability and performance of the container system.
[0099] According to the following Figure 4 and Figure 5 Various embodiments of a container creation device are introduced.
[0100] A first embodiment of a device for creating a container runs the technical solution of a first embodiment of a method for creating a container, and has all the advantages of the first embodiment of a method for creating a container.
[0101] Figure 4 The structure of a first embodiment of a container creation device is shown, including: a data storage module 410 and a container configuration module 420,
[0102] The data storage module 410 is used to store the configuration data of each container in the memory of the partition corresponding to the container. For its principle and advantages, please refer to step S110 of the first embodiment of a method for creating a container.
[0103] The container configuration module 420 is used to configure each container according to the configuration data of the container when the running image of the container is started. For its principles and advantages, please refer to step S120 of the first embodiment of a method for creating a container.
[0104] Embodiment 2 of a device for creating a container runs the technical solution of embodiment 2 of a method for creating a container, and has all the advantages of embodiment 2 of a method for creating a container.
[0105] Figure 5 The structure of a second embodiment of a container creation device is shown, including: an image generation module 510, a partition creation module 520, a data storage module 530 and a container configuration module 540. For ease of description, this embodiment is described by taking the first container as an example.
[0106] The image generation module 510 is used to reserve a set interval in the code segment of the running image when generating the running image of the first container to save the configuration data of the first container. For its principles and advantages, please refer to step S210 of the second embodiment of a container creation method.
[0107] The partition creation module 520 is located in the microkernel and is used to create partitions on the microkernel. Each partition includes a container engine partition and a partition corresponding to each container. For its principles and advantages, please refer to step S220 of embodiment 2 of a method for creating a container.
[0108] The data storage module 530 is located in the container engine partition, and is used to save the configuration data of the first container to the container control block of the partition corresponding to the first container; it is also used to read the corresponding running image file on the hard disk according to the running image name in the container control block of the partition corresponding to the first container, and save it to the memory of the partition corresponding to the first container; it is also used to write the configuration data in the container control block of the first container to the memory corresponding to its running image in the memory of the partition corresponding to the first container. For its principles and advantages, please refer to steps S230, S240 and S250 of the second embodiment of a container creation method.
[0109] The container configuration module 540 is located in the running image of the first container, and is used to read the configuration data of the first container in the running memory of the running image of the first container when the running image of the first container is started, and configure the first container according to the configuration data of the first container. For its principles and advantages, please refer to steps S260 and S270 of the second embodiment of a method for creating a container.
[0110] The embodiment of the present invention further provides an operating system, which creates a container through various embodiments of a method for creating a container, and correspondingly has the advantages of various embodiments of a method for creating a container.
[0111] The embodiment of the present invention also provides a computing device, based on Figure 6 Detailed introduction.
[0112] The computing device 600 includes a processor 610 , a memory 620 , a communication interface 630 , and a bus 640 .
[0113] It should be understood that the communication interface 630 in the computing device 600 shown in this figure can be used to communicate with other devices.
[0114] The processor 610 may be connected to a memory 620. The memory 620 may be used to store the program code and data. Therefore, the memory 620 may be a storage unit inside the processor 610, or an external storage unit independent of the processor 610, or a component including a storage unit inside the processor 610 and an external storage unit independent of the processor 610.
[0115] Optionally, the computing device 600 may further include a bus 640. The memory 620 and the communication interface 630 may be connected to the processor 610 via the bus 640. The bus 640 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus 640 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.
[0116] It should be understood that in the embodiment of the present invention, the processor 610 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 gate 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 610 may adopt one or more integrated circuits to execute relevant programs to implement the technical solutions provided in the embodiment of the present invention.
[0117] The memory 620 may include a read-only memory and a random access memory, and provides instructions and data to the processor 610. A portion of the processor 610 may also include a nonvolatile random access memory. For example, the processor 610 may also store information on the device type.
[0118] When the computing device 600 is running, the processor 610 executes the computer-executable instructions in the memory 620 to perform the methods described in each method embodiment.
[0119] It should be understood that the computing device 600 according to an embodiment of the present invention can correspond to the corresponding subjects executing the methods according to the various embodiments of the present invention, and the above-mentioned and other operations and / or functions of each module in the computing device 600 are respectively for implementing the corresponding processes of each method of the present embodiment. For the sake of brevity, they will not be repeated here.
[0120] Those skilled 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 the present invention.
[0121] 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.
[0122] In the several embodiments provided by the present invention, 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.
[0123] 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.
[0124] In addition, each functional unit in each embodiment of the present invention 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.
[0125] 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 invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for enabling 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 invention. 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.
[0126] An embodiment of the present invention further 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 method described in each method embodiment.
[0127] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include, an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.
[0128] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated 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, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0129] 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.
[0130] Computer program code for performing the operations of the present invention may 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" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate 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 may 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 may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0131] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention 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 invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may also include more other equivalent embodiments without departing from the concept of the present invention, all of which belong to the scope of protection of the present invention.
Claims
1. A method for creating a container, characterized in that: Used to create containers on various microkernel-based partitions, including: The configuration data of each container is stored in the memory of the partition corresponding to the container; The running image of each container configures the container according to the configuration data of the container when it is started.
2. The method according to claim 1, characterized in that: Storing configuration data of the container in the memory of each partition of the container, specifically comprising: storing the configuration data of the container corresponding to the partition in a set interval of the first memory in the memory of each partition, and storing the running image of the container of the partition in the first memory of each partition; The setting interval of the first memory of each partition is reserved in the corresponding address interval of the file of the running image corresponding to the partition.
3. The method according to claim 2, characterized in that: The container system also includes a container engine deployed on an independent microkernel-based partition; Before storing the configuration data of the container in the memory of the partition corresponding to each container, the method further includes: the container engine partition creates a partition corresponding to the container on the microkernel, and loads the running image corresponding to the partition into the first memory of the partition.
4. The method according to claim 3, characterized in that: The configuration data corresponding to each partition is stored in a setting interval of the first memory of each partition, including: The container engine partition stores the configuration data of each partition's container in the container control block of the partition; The container engine partition obtains the configuration data of the container of each partition from the container control block of the partition, and saves the configuration data to the set interval of the first memory of the partition.
5. The method according to claim 1, characterized in that: The container configuration data of each container includes at least the disk space size of the container and information of each device; Each container's running image configures the container based on the container's configuration data when it is started, including: When the running image of each container is started, the file system of the container is initialized according to the disk space size in the configuration data of the container, and each device is initialized according to the information of each device in the configuration data of the container.
6. The method according to claim 5, characterized in that: The configuration data of each container also includes: description information of the container, the set of CPU cores to run with affinity, and the size of memory space.
7. A container creation device, characterized in that: Used to create containers on various microkernel-based partitions, including: A data storage module, used to store configuration data of each container in the memory of the partition corresponding to the container; The container configuration module is used to configure each container according to the configuration data of the container when the running image of the container is started.
8. A container operating system, characterized in that: The container is created by the method according to any one of claims 1 to 6.
9. 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 6.
10. A computer-readable storage medium having program instructions stored thereon, characterized in that: When the program instructions are executed by a computer, the computer executes the method according to any one of claims 1 to 6.
