Operating system deployment method and device, electronic equipment and storage medium
Patent Information
- Application Number
- CN202211678311.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-26
- Publication Date
- 2026-08-21
- Estimated Expiration
- 2042-12-26
AI Technical Summary
[0021] According to another aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions for causing the computer to perform the methods described above and any possible implementation thereof.
Smart Images

Figure CN116126403B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of artificial intelligence, specifically cloud computing and server installation technology, and can be applied in intelligent cloud scenarios. Background Technology
[0002] With the continuous development of Internet technology, the number of servers is also constantly increasing, from just a few servers in the early days to huge data centers.
[0003] Currently, in the scenario of large-scale server installation in Internet data centers, the network installation process of servers involves two hard reboots and the download of three operating system images. Summary of the Invention
[0004] This disclosure provides a method, apparatus, electronic device, and storage medium for deploying an operating system.
[0005] According to one aspect of this disclosure, a method for deploying an operating system is provided, the method being...
[0006] For the device to be deployed, including: 0, based on the first image system file, utilizing the first deployment agent, processing the first image system file...
[0007] The operating system corresponding to the image is initialized to obtain the second image operating system file;
[0008] Based on the second image operating system file, the first deployment agent is used to invoke a preset switching command to switch to the operating system corresponding to the second image operating system file;
[0009] Using the second deployment agent, the target operating system file is obtained, and the target operating system corresponding to the target operating system file is deployed;
[0010] Using the second deployment agent, a preset switching command is invoked to switch to the target operating system corresponding to the target operating system file.
[0011] According to another aspect of this disclosure, an operating system deployment apparatus is provided, disposed on a device to be deployed.
[0012] Deployment equipment, including:
[0013] The first acquisition unit is used to initialize the operating system corresponding to the first image system file using the first deployment agent, based on the first image system file, so as to obtain the second image operating system file.
[0014] The first switching unit is used to call a preset switching command based on the second image operating system file and using the first deployment agent to switch to the operating system corresponding to the second image operating system file;
[0015] The second acquisition unit is used to acquire the target operating system file using the second deployment agent, so as to deploy the target operating system corresponding to the target operating system file;
[0016] The second switching unit is used to invoke a preset switching command using the second deployment agent to switch to the target operating system corresponding to the target operating system file.
[0017] According to another aspect of this disclosure, an electronic device is provided, comprising:
[0018] At least one processor; and
[0019] A memory communicatively connected to the at least one processor; wherein,
[0020] The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the methods described above and any possible implementations.
[0021] According to another aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions for causing the computer to perform the methods described above and any possible implementation thereof.
[0022] According to another aspect of this disclosure, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the aspects and any possible implementations described above.
[0023] As can be seen from the above technical solution, the embodiments of this disclosure can initialize the operating system according to the first image system file using the first deployment agent to obtain the second image operating system file, and then use the first deployment agent to call a preset switching command according to the second image operating system file to switch to the operating system corresponding to the second image operating system file. Furthermore, the second deployment agent can be used to obtain the target operating system file to deploy the target operating system corresponding to the target operating system file. This allows the second deployment agent to call the preset switching command to switch to the target operating system corresponding to the target operating system file. Since the deployment agent and preset switching instructions are used to achieve fast switching between different operating system images during the device operating system deployment process, two hard reboots can be eliminated, greatly reducing the time spent on operating system deployment and thus improving the efficiency of operating system deployment.
[0024] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0025] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:
[0026] Figure 1 This is a schematic diagram based on the first embodiment of the present disclosure;
[0027] Figure 2 This is a schematic diagram according to the second embodiment of the present disclosure;
[0028] Figure 3 This is a schematic diagram according to the third embodiment of the present disclosure;
[0029] Figure 4 This is a block diagram of an electronic device used to implement the operating system deployment method of the embodiments of this disclosure. Detailed Implementation
[0030] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0031] Obviously, the described embodiments are only some, not all, of the embodiments disclosed herein. All other embodiments obtained by those skilled in the art based on the embodiments of this disclosure without inventive effort are within the scope of protection of this disclosure.
[0032] It should be noted that the terminal devices involved in the embodiments of this disclosure may include, but are not limited to, smart devices such as mobile phones, personal digital assistants (PDAs), wireless handheld devices, and tablet computers; the display devices may include, but are not limited to, personal computers, televisions, and other devices with display functions.
[0033] Furthermore, the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.
[0034] Currently, in related technical solutions, the server's network installation process involves the server booting via a network preboot execution environment (PXE), downloading and executing the bootfile pxelinux.0, which in turn downloads the kernel file vmlinuz and the file system initramfs over the network. After the server successfully boots using the network-downloaded kernel file, it downloads the first system image to memory and performs system initialization, entering the first...
[0035] After the first system image is created, the server information collection, automatic reporting, and registration logic begins, reporting the server to the control center. This completes the process for creating the first system image. Once the server has completed its reporting, the administrator can discover it from the control center and select the desired installation location.
[0036] The operating system image is accessed by clicking "Start Installation" from the control center. The server will perform its first hard reboot. At this stage, it will still boot from the PXE network and download the second-stage vmlinuz and initramfs to memory. The server will also download the second system image to memory, which will be used to perform the installation process. After entering the second system, the server will begin various installation operations, including downloading the third system image to the hard drive and setting the correct boot order for the operating system bootloader (grub). At this point, the work of the second system image is complete. After the second-stage installation process (stage 5) is complete, the server can perform a second hard reboot. This boot will start from the hard drive.
[0037] The bootloader, based on the GRUB configuration, locates vmlinuz and initramfs in the / boot directory of the hard drive.
[0038] It will then begin booting, and once booted successfully, you will enter the operating system that needs to be installed.
[0039] In summary, the relevant technical solutions require two hard reboots and three downloads for the server's network installation.
[0040] Operating system images. Three operating system images are used for server information collection and automatic network registration, executing the server installation process and configuration, and installing the target operating system, respectively. Switching between the three operating systems is achieved through two server hard reboots. The hard reboot includes hardware initialization performed by the Basic Input Output System (BIOS) and the bootloader. However, these two hard reboot steps are time-consuming.
[0041] Especially when dealing with high-configuration servers, the process becomes even more time-consuming, accounting for up to 60% of the entire installation process. In large-scale installation scenarios, installation efficiency is particularly crucial.
[0042] The two steps mentioned above severely slow down the installation process and urgently need to be optimized.
[0043] Therefore, there is an urgent need to provide an operating system deployment method that can reduce the number of hard reboots during server installation, thereby improving server installation efficiency.
[0044] Figure 1 This is a schematic diagram based on the first embodiment of the present disclosure, as shown below. Figure 1 As shown.
[0045] 101. Based on the first image system file, use the first deployment agent to initialize the operating system corresponding to the first image system file to obtain the second image operating system file.
[0046] 102. Based on the second image operating system file, the first deployment agent is used to invoke a preset switching command to switch to the operating system corresponding to the second image operating system file.
[0047] 103. Using the second deployment agent, obtain the target operating system file to deploy the target operating system corresponding to the target operating system file.
[0048] 104. Using the second deployment agent, invoke a preset switching command to switch to the target operating system corresponding to the target operating system file.
[0049] It should be noted that the equipment to be deployed can include physical servers and other devices. For example, servers in Internet Data Centers (IDCs), and hardware devices in 5G and edge computing scenarios.
[0050] In addition, during the network installation process, the devices to be deployed can interact with the control center to complete steps 101-104.
[0051] It should be noted that the first deployment agent and the second deployment agent can be processes started at different stages based on the same process file. Both the first and second deployment agents can be used to deploy the operating system and invoke preset switching instructions.
[0052] In this way, by using the first deployment agent to initialize the operating system corresponding to the first image system file based on the first image system file, a second image operating system file can be obtained. Then, based on the second image operating system file, the first deployment agent can be used to call a preset switching command to switch to the operating system corresponding to the second image operating system file. Subsequently, the second deployment agent can be used to obtain the target operating system file and deploy the target operating system corresponding to the target operating system file. This allows the second deployment agent to call the preset switching command to switch to the target operating system corresponding to the target operating system file. Since the deployment agent and preset switching instructions are used to achieve fast switching between different operating system images during the device operating system deployment process, the two hard reboot operations in the existing solution can be eliminated, greatly reducing the time spent on operating system deployment and thus improving the efficiency of operating system deployment.
[0053] Optionally, in one possible implementation of this embodiment, in step 101, the device data of the device to be deployed can be collected using the first deployment agent based on the first image system file, and the device data can be reported. In response to receiving a deployment request, the second image operating system file can be obtained.
[0054] In a specific implementation of this approach, firstly, after collecting device data of the device to be deployed using the first deployment agent based on the first image system file, the device data can be reported to the control center to register the device to be deployed. Secondly, after receiving the device data, the control center can determine the deployment request based on pre-configured deployment information and send the deployment request to the device to be deployed. Thirdly, the device to be deployed can receive the deployment request using the first deployment agent, obtain the second image operating system file based on the deployment request, and download the second image operating system file to the first system disk of the device to be deployed.
[0055] In this specific implementation process, the pre-configured deployment information may include the deployment method configured by the administrator and the operating system to be deployed.
[0056] Thus, in this implementation, the operating system can be initialized using the first deployment agent, which can then register and report the device and obtain a deployment request. Based on the deployment request, the second image operating system file can be obtained. Since the relevant operating system initialization and acquisition processes are performed through the first deployment agent, the operating system deployment process is optimized, ensuring the efficiency and reliability of subsequent operating system deployment operations.
[0057] Optionally, in one possible implementation of this embodiment, in step 102, the operating system corresponding to the second image operating system file can be deployed on the first system disk of the device to be deployed using the first deployment agent based on the second image operating system file. Then, the first deployment agent can be used to call a preset switching command, so that the device to be deployed can switch to the operating system corresponding to the second image operating system file according to the preset switching command, and refresh the memory of the device to be deployed.
[0058] In this implementation, the preset switching commands may include, but are not limited to, the kexec command. The kexec command can directly boot from the currently running kernel to a new kernel, meaning it allows a new kernel to be started from the currently running kernel.
[0059] Specifically, the kexec command can be: kexec -l / deploy / boot / vmlinuz-baidu --initrd= / deploy / boot / initramfs-baidu.img --reuse-cmdline.
[0060] In a specific implementation of this approach, firstly, based on the second image operating system file, the first deployment agent can be used to deploy the operating system corresponding to the second image operating system file onto the first system disk of the device to be deployed. Secondly, the first deployment agent can be used to call the kexec command to directly switch to the new operating system, that is, to the operating system corresponding to the second image operating system file. At the same time, the memory of the device to be deployed is refreshed, and hardware status is reset.
[0061] Understandably, during the operating system deployment process, the device to be deployed can send its own deployment status information to the control center.
[0062] Thus, in this implementation, by utilizing the first deployment agent and preset switching commands, a fast switch between different operating system images can be achieved, avoiding the need for a hard reboot and thereby improving the deployment efficiency of the operating system.
[0063] It should be noted that the specific implementation process provided in this embodiment can be combined with the specific implementation process for obtaining the second image operating system file provided in the aforementioned implementation methods to implement the operating system deployment method of this embodiment. Detailed descriptions can be found in the relevant content of the aforementioned implementation methods, and will not be repeated here.
[0064] Optionally, in one possible implementation of this embodiment, in step 103, a second deployment agent can be used to obtain the deployment status information of the device to be deployed and the target operating system file, and then deploy the target operating system corresponding to the target operating system file in the second system disk of the device to be deployed according to the deployment status information.
[0065] In this implementation, the deployment status information may include the current deployment status information of the device to be deployed. The target operating system file may be a pre-configured file of the operating system to be deployed.
[0066] In one specific implementation of this method, after executing step 102, the device to be deployed can start another deployment agent, namely the second deployment agent. Using this second deployment agent, the deployment status information and target operating system file of the device to be deployed are obtained from the control center. Then, based on the deployment status information, the target operating system corresponding to the target operating system file is deployed on the second system disk of the device to be deployed.
[0067] In another specific implementation of this method, the target operating system file can be downloaded to the second system disk based on the deployment status information. This allows the deployment program to perform network configuration and GRUB configuration, enabling the deployment of the target operating system file corresponding to the target operating system to the second system disk of the device to be deployed.
[0068] Here, after step 103, the second deployment agent can be used to call the preset switching command again to directly switch to the target operating system corresponding to the deployed target operating system file, thus completing the deployment process of the operating system of the device to be deployed.
[0069] It is understandable that the first system disk and the second system disk can belong to two different hard drives.
[0070] Thus, in this implementation, by utilizing the second deployment agent, the deployment status information of the device to be deployed and the target operating system files can be obtained. Then, based on the deployment status information, the target operating system can be deployed on the second system disk of the device to be deployed, which can effectively complete the deployment of the target operating system and further ensure the reliability of the operating system deployment.
[0071] It should be noted that the various specific implementation processes for deploying the target operating system provided in this implementation method can be combined with the specific implementation processes provided in the foregoing implementation methods to implement the operating system deployment method of this embodiment. Detailed descriptions can be found in the relevant content of the foregoing implementation methods, and will not be repeated here.
[0072] Optionally, in one possible implementation of this embodiment, before step 101, a first image operating system file can be obtained based on the PXE operating system file, and the first image operating system file can be loaded into the memory of the device to be deployed.
[0073] In this implementation, the PXE operating system files may include the kernel file vmlinuz and the file system initramfs. These PXE operating system files can be obtained by the device to be deployed via network PXE boot.
[0074] Understandably, during the process of booting the operating system on the device to be deployed via network PXE, vmlinuz and initramfs can be loaded into the device's memory. vmlinuz can be the kernel file used during the boot process. The initramfs filesystem can be the initialized filesystem.
[0075] In one specific implementation of this approach, firstly, the device to be deployed boots via network PXE, downloads and executes the bootfile pxelinux.0, and pxelinux.0 can download the kernel file vmlinuz and the file system initramfs, i.e., the PXE operating system file, over the network. Secondly, after the device to be deployed successfully boots using the PXE operating system file, it can download the first image operating system file to memory.
[0076] Thus, in this implementation, the first image operating system file can be obtained from the PXE operating system file and loaded into the memory of the device to be deployed, enabling remote and simultaneous automatic assembly of multiple devices, thereby ensuring the scalability and automation of operating system deployment.
[0077] It should be noted that the specific implementation process provided in this implementation method can be combined with the specific implementation processes provided in the aforementioned implementation methods to implement the operating system deployment method of this embodiment. Detailed descriptions can be found in the relevant content of the aforementioned implementation methods, and will not be repeated here.
[0078] In this embodiment, the operating system corresponding to the first image system file can be initialized using a first deployment agent based on the first image system file to obtain a second image operating system file. Then, based on the second image operating system file, the first deployment agent can invoke a preset switching command to switch to the operating system corresponding to the second image operating system file. Subsequently, the second deployment agent can be used to obtain the target operating system file and deploy the target operating system corresponding to the target operating system file. This allows the second deployment agent to invoke the preset switching command to switch to the target operating system corresponding to the target operating system file. Since the deployment agent and preset switching instructions are used during the device's operating system deployment process to achieve rapid switching between different operating system images, the two hard reboot operations in existing solutions can be eliminated, significantly reducing the time required for operating system deployment and thus improving the efficiency of operating system deployment.
[0079] Furthermore, by adopting the technical solution provided in this embodiment, the operating system can be initialized using the first deployment agent, thereby registering and reporting the device and obtaining a deployment request. Based on the deployment request, the second image operating system file can be further obtained. Since the relevant operating system initialization and acquisition processes are performed through the first deployment agent, the operating system deployment process is optimized, ensuring the efficiency and reliability of subsequent operating system deployment operations.
[0080] In addition, by using the technical solution provided in this embodiment, a fast switch between different operating system images can be achieved by utilizing the first deployment agent and the preset switching command, avoiding the need for a hard reboot and thus improving the deployment efficiency of the operating system.
[0081] Furthermore, by employing the technical solution provided in this embodiment, the deployment status information of the device to be deployed and the target operating system file can be obtained by utilizing the second deployment agent. Then, based on the deployment status information, the target operating system can be deployed on the second system disk of the device to be deployed, which can effectively complete the deployment of the target operating system and further ensure the reliability of the operating system deployment.
[0082] In addition, by adopting the technical solution provided in this embodiment, the first image operating system file can be obtained from the PXE operating system file and loaded into the memory of the device to be deployed, thereby enabling remote and simultaneous automatic assembly of multiple devices, thus ensuring the scale and automation of operating system deployment.
[0083] Figure 2 This is a schematic diagram based on the second embodiment of the present disclosure, as shown below. Figure 2 As shown.
[0084] In this embodiment, the application scenario may include a server and a control center. The control center can be used to issue server installation (i.e., operating system deployment) procedures, record installation status, and act as a scheduler for server installation. The server can be used to execute the operating system deployment method of this embodiment. The server executing the operating system deployment method may include three stages, such as the first stage (steps 201-202), the second stage (steps 203-205), and the third stage (step 206).
[0085] To better understand the operating system deployment method of this embodiment, the following is combined with... Figure 2 A detailed explanation will be provided.
[0086] 201. Obtain the kernel file and file system through PXE to obtain the first image system.
[0087] 202. Based on the first image system, use the first deployment agent to collect device data and report it.
[0088] In this embodiment, the server is powered off and ready for deployment. When deployment begins, the server can be started via PXE over the network.
[0089] Specifically, the bootfile file pxelinux.0 can be downloaded and executed via the network. pxelinux.0 can then download the kernel file vmlinuz and the file system initramfs via the network. After the server successfully boots using the downloaded kernel file, it downloads the first system image (the first system image) into memory and performs initialization. Once the server system is in the first system image, a deployment agent, DeployAgent1 (the first deployment agent), can be started to execute the server's automatic reporting and registration logic, reporting the server to the control center.
[0090] Additionally, DeployAgent1 can also be used to wait for deployment requests issued by the control center.
[0091] 203. Obtain the second image system based on the received deployment request.
[0092] 204. Using the first deployment agent, invoke the Kexec command to switch to the second image system.
[0093] 205. Use the second deployment agent to obtain deployment status information and the target operating system in order to deploy the target operating system.
[0094] In this embodiment, after the control center identifies the server, the administrator can select the installation method and the operating system to be deployed, and then click "Install Server". In response to the administrator's installation operation and the information pre-configured by the administrator, the control center determines the corresponding deployment request and sends the deployment request to the server.
[0095] Specifically, after DeployAgent1 on the server receives the deployment request, it begins downloading the second-stage second image system to the corresponding hard drive's system disk. Once the download is complete, DeployAgent1 mounts the system disk to a specific directory and can invoke Kexec, executing `kexec -l / deploy / boot / vmlinuz-baidu --initrd= / deploy / boot / initramfs-baidu.img --reuse-cmdline`, to directly switch into the new system, i.e., the second image system.
[0096] Simultaneously, it can perform operations such as memory refresh and hardware state reset. This eliminates the need for a hard reboot.
[0097] Furthermore, upon switching into the second image system, since the memory has been refreshed, a new DeployAgent2 will be launched within this image, serving as the second deployment agent. DeployAgent2 can continue to report to the control center to obtain current deployment status information. Simultaneously, the control center can send the deployment status information and the target operating system to the server, which then uses DeployAgent2 to schedule the installation of the target operating system based on the deployment status information.
[0098] Specifically, scheduling the installation and deployment process of the target operating system based on the deployment status information can involve downloading the target operating system image to the corresponding system disk, controlling the deployment program to perform network configuration and GRUB configuration, in order to complete the deployment of the target operating system.
[0099] Here, the system disk used to load the target operating system is different from the system disk used to load the second image system mentioned above.
[0100] 206. Using the second deployment agent, invoke the Kexec command to switch to the target operating system.
[0101] In this embodiment, after DeployAgent2 completes the deployment operation, it can mount the system disk to a specific directory and call Kexec to enter the target operating system.
[0102] At this point, the server does not need to be restarted; the operating system installation and deployment have been completed, and the server has entered the new operating system.
[0103] Understandably, the first phase of the deployment process can be executed in the server's memory system. The second and third phases of the deployment process can be executed in the server's hard disk system. The DeployAgent, i.e., the first deployment agent DeployAgent1 and the second deployment agent DeployAgent, can be processes.
[0104] In this embodiment, the DeployAgent process can be added to the images of the first two stages of operating system deployment to identify the deployment stage of each operating system and interact with the control center to trigger the corresponding deployment and call Kexec to switch between systems, thereby completing the deployment of the server's operating system. By modifying the server's hard reboot to use the DeployAgent and Kexec to achieve fast switching between different operating system images, the hardware initialization performed by the BIOS and the boot loading performed by the Bootloader during the two hard reboots are eliminated, greatly reducing the time spent on hard reboots and thus improving the efficiency of server installation.
[0105] In addition, by using the technical solution provided in this embodiment, when importing the second-stage image system, it is not necessary to install a bootloader on the hard drive, thereby avoiding the need for multiple bootable hard drives and further improving the efficiency of server installation.
[0106] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this disclosure is not limited to the described order of actions, because according to this disclosure, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this disclosure.
[0107] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0108] Figure 3 This is a schematic diagram based on the third embodiment of the present disclosure, as shown below. Figure 3 As shown. The operating system deployment device 300 of this embodiment may include a first acquisition unit 301, a first switching unit 302, a second acquisition unit 303, and a second switching unit 304. The operating system deployment device 300 may be disposed on the device to be deployed. The first acquisition unit 301 is used to initialize the operating system corresponding to the first image system file using a first deployment agent based on the first image system file, so as to obtain a second image operating system file. The first switching unit 302 is used to call a preset switching command using the first deployment agent based on the second image operating system file, so as to switch to the operating system corresponding to the second image operating system file. The second acquisition unit 303 is used to acquire a target operating system file using a second deployment agent, so as to deploy the target operating system corresponding to the target operating system file. The second switching unit 304 is used to call a preset switching command using the second deployment agent, so as to switch to the target operating system corresponding to the target operating system file.
[0109] Optionally, in one possible implementation of this embodiment, the first acquisition unit 301 may be used to collect device data of the device to be deployed using the first deployment agent based on the first image system file, report the device data, and obtain the second image operating system file in response to receiving the deployment request.
[0110] Optionally, in one possible implementation of this embodiment, the first switching unit 302 may be specifically used to deploy the operating system corresponding to the second image operating system file in the first system disk of the device to be deployed using the first deployment agent, and to call a preset switching command using the first deployment agent to switch to the operating system corresponding to the second image operating system file and refresh the memory of the device to be deployed.
[0111] Optionally, in one possible implementation of this embodiment, the second acquisition unit 303 may be used to acquire the deployment status information of the device to be deployed and the target operating system file using the second deployment agent, and deploy the target operating system corresponding to the target operating system file in the second system disk of the device to be deployed according to the deployment status information.
[0112] Optionally, in one possible implementation of this embodiment, the first acquisition unit 301 can also be used to obtain a first image operating system file based on the PXE operating system file, and load the first image operating system file into the memory of the device to be deployed.
[0113] In this embodiment, the first acquisition unit can initialize the operating system corresponding to the first image system file using a first deployment agent to obtain a second image operating system file. Then, the first switching unit can use the first deployment agent to call a preset switching command to switch to the operating system corresponding to the second image operating system file. The second acquisition unit can use the second deployment agent to obtain the target operating system file and deploy the target operating system corresponding to the target operating system file. This allows the second switching unit to use the second deployment agent to call a preset switching command to switch to the target operating system corresponding to the target operating system file. Since the deployment agent and preset switching instructions are used to achieve fast switching between different operating system images during the device operating system deployment process, two hard reboot operations can be eliminated, greatly reducing the time spent on operating system deployment and thus improving the efficiency of operating system deployment.
[0114] Furthermore, by adopting the technical solution provided in this embodiment, the operating system can be initialized using the first deployment agent, thereby registering and reporting the device and obtaining a deployment request. Based on the deployment request, the second image operating system file can be further obtained. Since the relevant operating system initialization and acquisition processes are performed through the first deployment agent, the operating system deployment process is optimized, ensuring the efficiency and reliability of subsequent operating system deployment operations.
[0115] In addition, by using the technical solution provided in this embodiment, a fast switch between different operating system images can be achieved by utilizing the first deployment agent and the preset switching command, avoiding the need for a hard reboot and thus improving the deployment efficiency of the operating system.
[0116] Furthermore, by employing the technical solution provided in this embodiment, the deployment status information of the device to be deployed and the target operating system file can be obtained by utilizing the second deployment agent. Then, based on the deployment status information, the target operating system can be deployed on the second system disk of the device to be deployed, which can effectively complete the deployment of the target operating system and further ensure the reliability of the operating system deployment.
[0117] In addition, by adopting the technical solution provided in this embodiment, the first image operating system file can be obtained from the PXE operating system file and loaded into the memory of the device to be deployed, thereby enabling remote and simultaneous automatic assembly of multiple devices, thus ensuring the scale and automation of operating system deployment.
[0118] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0119] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0120] Figure 4 A schematic block diagram of an example electronic device 400 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0121] like Figure 4As shown, the electronic device 400 includes a computing unit 401, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 402 or a computer program loaded from a storage unit 408 into a random access memory (RAM) 403. The RAM 403 may also store various programs and data required for the operation of the electronic device 400. The computing unit 401, ROM 402, and RAM 403 are interconnected via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.
[0122] Multiple components in electronic device 400 are connected to I / O interface 405, including: input unit 406, such as keyboard, mouse, etc.; output unit 407, such as various types of displays, speakers, etc.; storage unit 408, such as disk, optical disk, etc.; and communication unit 409, such as network card, modem, wireless transceiver, etc. Communication unit 409 allows electronic device 400 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0123] The computing unit 401 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 401 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 401 performs the various methods and processes described above, such as the operating system deployment method. For example, in some embodiments, the operating system deployment method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 408. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 400 via ROM 402 and / or communication unit 409. When the computer program is loaded into RAM 403 and executed by the computing unit 401, one or more steps of the operating system deployment method described above may be performed. Alternatively, in other embodiments, the computing unit 401 may be configured to perform the operating system deployment method by any other suitable means (e.g., by means of firmware).
[0124] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0125] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0126] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0127] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0128] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0129] A computer system can include clients and servers. Clients and servers are generally located far apart from each other.
[0130] They typically interact via communication networks. The client-server relationship is established by computer programs running on corresponding computers that have a client-server relationship with each other.
[0131] It can be a cloud server, a server for a distributed system, or a server that incorporates blockchain technology.
[0132] It should be understood that the various forms of processes shown above can be used to reorder, add, or...
[0133] Deletion steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this document does not impose any restrictions.
[0134] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A method for deploying an operating system, the method being applied to a device to be deployed, comprising: Based on the first image operating system file, the first deployment agent is used to initialize the operating system corresponding to the first image operating system file to obtain the second image operating system file; Based on the second image operating system file, the first deployment agent is used to invoke a preset switching command to switch to the operating system corresponding to the second image operating system file and start the second deployment agent; Using the second deployment agent, a target operating system file is obtained to deploy the target operating system corresponding to the target operating system file. The target operating system file is a pre-configured file of the operating system to be deployed. Using the second deployment agent, a preset switching command is invoked to switch to the target operating system corresponding to the target operating system file; The step of initializing the operating system corresponding to the first image operating system file using a first deployment agent to obtain a second image operating system file includes: Based on the first image operating system file, the device data of the device to be deployed is collected using the first deployment agent; The device data is reported to the control center, so that after receiving the device data, the control center determines the deployment request based on the pre-configured deployment information; In response to receiving a deployment request from the control center, the second image operating system file is obtained according to the deployment request; The step of using the second deployment agent to obtain the target operating system file and deploying the target operating system corresponding to the target operating system file includes: The deployment status information of the device to be deployed and the target operating system files are obtained using the second deployment agent. Based on the deployment status information, the target operating system corresponding to the target operating system file is deployed in the second system disk of the device to be deployed.
2. The method according to claim 1, wherein, The step of using the first deployment agent to invoke a preset switching command based on the second image operating system file to switch to the operating system corresponding to the second image operating system file includes: Based on the second image operating system file, the first deployment agent is used to deploy the operating system corresponding to the second image operating system file in the first system disk of the device to be deployed. Using the first deployment agent, a preset switching command is invoked; According to the preset switching command, switch to the operating system corresponding to the second image operating system file, and refresh the memory of the device to be deployed.
3. The method according to any one of claims 1-2, wherein, Before initializing the operating system corresponding to the first image operating system file using the first deployment agent, the process includes: Obtain the first image operating system file based on the PXE operating system file; The first image operating system file is loaded into the memory of the device to be deployed.
4. An operating system deployment apparatus, disposed on a device to be deployed, comprising: The first acquisition unit is used to initialize the operating system corresponding to the first image operating system file using the first deployment agent, based on the first image operating system file, in order to obtain the second image operating system file. The first switching unit is used to call a preset switching command based on the second image operating system file and the first deployment agent to switch to the operating system corresponding to the second image operating system file, and start the second deployment agent. The second acquisition unit is used to acquire a target operating system file using the second deployment agent, so as to deploy the target operating system corresponding to the target operating system file, wherein the target operating system file is a pre-configured file of the operating system to be deployed; The second switching unit is used to invoke a preset switching command using the second deployment agent to switch to the target operating system corresponding to the target operating system file; The first acquisition unit is specifically used for: Based on the first image operating system file, the device data of the device to be deployed is collected using the first deployment agent; The device data is reported to the control center, so that after receiving the device data, the control center determines the deployment request based on the pre-configured deployment information; In response to receiving a deployment request from the control center, the second image operating system file is obtained according to the deployment request; The second acquisition unit is specifically used for: Using the second deployment agent, the deployment status information of the device to be deployed and the target operating system file are obtained; Based on the deployment status information, the target operating system corresponding to the target operating system file is deployed in the second system disk of the device to be deployed.
5. The apparatus according to claim 4, wherein, The first switching unit is specifically used for: Based on the second image operating system file, the first deployment agent is used to deploy the operating system corresponding to the second image operating system file in the first system disk of the device to be deployed. Using the first deployment agent, a preset switching command is invoked; According to the preset switching command, switch to the operating system corresponding to the second image operating system file, and refresh the memory of the device to be deployed.
6. The apparatus according to any one of claims 4-5, wherein, The first acquisition unit is further configured to: Obtain the first image operating system file based on the PXE operating system file; The first image operating system file is loaded into the memory of the device to be deployed.
7. An electronic device, comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1-3.
8. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-3.
9. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1-3.
Citation Information
Patent Citations
PXE-based method for rapidly installing operation systems in batches
CN105426207A
Cloud computing platform data processing method and device
CN110971642A