Cloud desktop system power-off protection method and device and electronic equipment

By using UEFI boot program and WinPE combined with repair tools in the cloud desktop system, the problems of data loss and system instability after power outage of the cloud desktop system are solved, and the system is automated repair and high reliability are achieved.

CN119691822APending Publication Date: 2025-03-25GUANGZHOU SHIYUAN ELECTRONICS CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311238288.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-22
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

Cloud desktop systems may cause data loss or system crash after power outage. The existing anti-power failure corruption solutions mainly rely on mirror restoration, which cannot effectively avoid data loss and system instability.

Method used

Repair the file system by recording the power outage flag in the UEFI boot program and using WinPE and corresponding repair tools such as chkdsk and qemu-img when power outage occurs, reset the power outage flag, and restart WinPE to complete the file system repair.

Benefits of technology

It realizes automatic repair of file systems when the cloud desktop system is powered off, avoids data loss and system crashes, improves system reliability and stability, and reduces manual intervention and maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119691822A_ABST
    Figure CN119691822A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computers, and discloses a cloud desktop system power-off protection method and device and electronic equipment. The method comprises the following steps: controlling a BIOS (Basic Input Output System) to start, and loading a UEFI (Unified Through the UEFI bootstrap program, judging whether power failure occurs in a power failure flag bit or not; and if the power failure of the power failure flag bit occurs, starting WinPE, obtaining a corresponding repair tool according to the type of the file system, repairing the file system based on the WinPE and the repair tool, resetting the power failure flag bit, and restarting the WinPE to complete the repair of the file system. When the system is powered off, the file system is repaired in an automatic mode, the situations of data loss and system crash caused by power failure are avoided, and the reliability and stability of the system are improved. Meanwhile, the scheme has the advantages of automation, rapidness, accuracy and the like, the power-off repair efficiency and response speed of the system can be improved, and manual intervention and maintenance cost are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a power-off protection method, device and electronic equipment for a cloud desktop system. Background Art

[0002] Power outage instability is a common problem, not only for third-party cloud desktop vendors, but also for the cloud computing industry. In cloud desktop scenarios, since the servers where cloud desktops are located are usually centrally deployed in data centers, the risk of power outages is relatively high, which may cause data loss or damage in the cloud desktops. The current power outage damage prevention solution for cloud desktops is generally to restore the image to avoid damage, which is a post-processing solution.

[0003] The inventors found in the process of implementing the embodiments of the present application that the current power failure protection scheme for cloud desktops has at least the following problems: if the data in the cloud desktop is not backed up in time, once damaged, it may cause data loss and cannot be recovered. In addition, if the data in the cloud desktop is not backed up in time before damage, then when restoring the image, the image may be inconsistent, which may cause the restoration to fail or the data to be incomplete after restoration. Also, when restoring, the cloud desktop will not be able to provide services, which will affect the business continuity of users.

[0004] Therefore, for cloud desktop scenarios, simply restoring the image to avoid corruption cannot completely solve the problem. Other measures need to be taken to improve the reliability and stability of the cloud desktop. Summary of the invention

[0005] The implementation method of the present application mainly solves the technical problem of data corruption caused by power outage of the cloud desktop.

[0006] In order to solve the above technical problems, a technical solution adopted in the implementation mode of the present application is: providing a power-off protection method for a cloud desktop system, including: controlling BIOS startup and loading the UEFI boot program; judging whether a power-off flag has occurred through the UEFI boot program; if a power-off flag has occurred, starting WinPE and obtaining a corresponding repair tool according to the type of file system, repairing the file system based on the WinPE and the repair tool, resetting the power-off flag, and restarting the WinPE to complete the repair of the file system.

[0007] Optionally, before executing the steps of controlling BIOS startup and loading the UEFI boot program, the method further includes: determining virtual disk drive information.

[0008] Optionally, determining the virtual disk drive information includes: controlling the data to be written from the memory cache to the non-volatile storage medium, then updating the index, and ensuring that subsequent data requests are executed after the index update is completed.

[0009] Optionally, determining the virtual disk drive information further includes: controlling the data to follow a preset order, and when a preset time has passed or a preset condition is currently satisfied, writing the data from the memory cache into a non-volatile storage medium.

[0010] Optionally, controlling the data to be written from the memory cache to the non-volatile storage medium includes: using an IRP_MJ_FLUSH_BUFFERS command to write the data from the memory cache to the non-volatile storage medium.

[0011] Optionally, obtaining a corresponding repair tool according to the type of the file system, repairing the file system based on the WinPE and the repair tool, resetting the power-off flag, and restarting the WinPE includes: obtaining repair tools chkdsk and qemu-img according to the type of the file system; using chkdsk to repair the NTFS partition, using qemu-img to repair qcow2, resetting the power-off flag, and restarting the WinPE.

[0012] Optionally, starting WinPE includes: starting the WinPE according to a virtual machine corresponding to the cloud desktop system; or starting the WinPE using KVM virtualization technology through HostOS.

[0013] To solve the above technical problems, another technical solution adopted in the implementation mode of the present application is: to provide a power-off protection device for a cloud desktop system, including: a startup module, used to control BIOS startup and load the UEFI boot program; a power-off detection module, used to determine whether a power-off occurs at the power-off flag through the UEFI boot program; a repair module, used to start WinPE if a power-off occurs at the power-off flag, and obtain a corresponding repair tool according to the type of file system, repair the file system based on the WinPE and the repair tool, reset the power-off flag, and restart the WinPE to complete the repair of the file system.

[0014] To solve the above technical problems, another technical solution adopted in the implementation mode of the present application is: to provide an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method as described above.

[0015] In order to solve the above technical problems, another technical solution adopted in the implementation mode of the present application is: providing a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by an electronic device, the electronic device executes the method as described above.

[0016] Different from the related art, the embodiment of the present application provides a power-off protection method, device, electronic device and non-volatile computer-readable storage medium for a cloud desktop system. By controlling the BIOS startup and loading the UEFI boot program, the UEFI boot program is used to determine whether the power-off flag has been powered off. If the power-off flag has been powered off, WinPE is started, and the corresponding repair tool is obtained according to the type of the file system. The file system is repaired based on the WinPE and the repair tool, the power-off flag is reset, and the WinPE is restarted to complete the repair of the file system. Among them, during the operation of the cloud desktop system, the BIOS startup is controlled and the UEFI boot program is loaded to determine whether the system has been powered off, and the file system is repaired by WinPE and the repair tool when a power outage occurs, thereby ensuring the stability of the system and the integrity of the data. After the repair is completed, the power-off flag will be reset and WinPE will be restarted so that the system can continue to run. In summary, the implementation method provided by the present application repairs the file system in an automated manner when the system is powered off, thereby avoiding data loss and system crashes caused by power outages, and improving the reliability and stability of the system. At the same time, this solution has the advantages of automation, speed, and accuracy, which can improve the efficiency and response speed of system power outage repair and reduce manual intervention and maintenance costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] One or more embodiments are exemplarily described by corresponding drawings, which do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and the figures in the drawings do not constitute proportional limitations unless otherwise stated.

[0018] Figure 1 It is a structural diagram of a cloud desktop system provided in an embodiment of the present application;

[0019] Figure 2 It is a flow chart of a power-off protection method for a cloud desktop system provided in an embodiment of the present application;

[0020] Figure 3 It is a structural schematic diagram of a power-off protection device for a cloud desktop system provided in an embodiment of the present application;

[0021] Figure 4It is a hardware structure diagram of an electronic device 30 for executing a power-off protection method for a cloud desktop system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0022] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0023] It should be noted that, if there is no conflict, the various features in the embodiments of the present application can be combined with each other, all within the scope of protection of the present application. In addition, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in a different order than the module division in the device schematic diagram or the order in the flow chart.

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

[0025] Cloud desktop is a virtual desktop solution based on cloud computing technology. By virtualizing the user's desktop environment to the cloud, users can access their desktop environment anywhere, at any time, and on any device, thus realizing the mobility and cloudification of the desktop environment. Cloud desktop is generally provided by cloud computing service providers or the IT department within the enterprise. Users can access and use it through cloud desktop clients or web browsers.

[0026] The situations in which the cloud desktop system loses power generally include: Power system failure, such as power line failure, power fluctuation, circuit short circuit and other factors may cause the cloud desktop system to lose power. Hardware failure, such as power supply, motherboard, graphics card and other hardware failures may cause the cloud desktop system to lose power. Human operation errors, such as accidentally turning off the computer power, unplugging the power cord and other operation errors may cause the cloud desktop system to lose power. Natural disasters, such as lightning strikes, earthquakes and other natural disasters may cause the cloud desktop system to lose power.

[0027] Users can access their desktop environment through cloud computing resources and network connections, thus realizing the mobility and cloudification of the desktop environment. However, in the cloud desktop system, since the system runs in the cloud, the user's computing device only accesses the system through a network connection, so the stability of the system and the data integrity are more important. System power outage is a common system failure, which may cause problems such as system data loss and system crash, and thus affect the user's work and business. Therefore, in order to ensure the stability and data integrity of the cloud desktop system, it is necessary to adopt corresponding anti-power failure damage technology to avoid data loss and system crash caused by power outage. This can improve the reliability and stability of the system, ensure that users can smoothly access and use the cloud desktop system, and improve work efficiency and user satisfaction.

[0028] Currently, third-party cloud desktop vendors all have power outage instability, and usually restore the system by restoring the image. The problem is that after a power outage, there is a high probability that user data will be lost and cannot be recovered. Among them, image restoration is a means of data backup and recovery. The image file of the entire system can be backed up and restored when recovery is needed. Image restoration is usually a full disk restore operation that can restore the entire system to the state at the time of backup, including the operating system, applications, data, etc. The image restoration process is a recovery operation that can be used to restore when the system is damaged or data is lost.

[0029] Therefore, the inventor provides a power-off protection method and device for a cloud desktop system, which can make the power-off protection stability performance reach the power-off stability level of a physical machine, greatly avoid the possibility of user data loss caused by accidental power off, and is implemented purely by software without additional hardware support, reducing the cost and complexity of the system, improving the flexibility and scalability of the system, and also reducing the maintenance and operation costs of the system. The main method adopted by this application is: by recording the power-off flag in the UEFI boot program, and using WinPE to repair the image storage partition file system and image file after a power outage occurs, the damaged data can be effectively restored, and the reliability and stability of the cloud desktop system can be guaranteed. The drive information of the virtual disk is also set to ensure the integrity and orderliness of the data. At the same time, the above process also includes using repair tools such as chkdsk and qemu-img to check and repair the image storage partition file system and image file to ensure the consistency and integrity of the data. Among them, using WinPE to repair the image storage partition file system and image file is intended to restore the damaged data and ensure the reliability and stability of the system. This process is a targeted repair operation that can be repaired for specific problems. Therefore, using WinPE to repair the image storage partition file system and image file is different from the image restoration mentioned above.

[0030] For more information about the cloud desktop system, please refer to Figure 1 , Figure 1 Schematic diagram of the structure of a cloud desktop system provided in an embodiment of the present application. The power-off protection method for the cloud desktop system provided in an embodiment of the present application can be applied to the cloud desktop system. Figure 1 As shown, the cloud desktop system 100 includes: a cloud server 101 , a virtual machine manager 102 , a desktop environment 103 and a user access interface 104 .

[0031] In the cloud desktop system 100, all desktop environments 103 can be virtual machines deployed on the cloud server 101. Each virtual machine is an independent desktop environment. Users can access these virtual machines through a network connection, thereby realizing the mobility and cloudification of the desktop environment.

[0032] Among them, the cloud server 101 is a server based on cloud computing technology, which can provide computing, storage and network resources, and support the simultaneous operation of multiple virtual machines and applications. In the cloud desktop system, the cloud server 101 is usually deployed on a specific physical server device, which usually has the characteristics of high performance, high reliability and high security, and can support the simultaneous operation of multiple virtual machines and applications, thereby achieving the stability and reliability of the cloud desktop system. The virtual machine manager 102 is a software for managing and monitoring virtual machines, which is responsible for allocating and managing virtualized resources, monitoring the operating status of virtual machines, maintaining the stability and reliability of virtual machines, and providing security control and management functions for virtualized services. In the cloud desktop system, the virtual machine manager 102 can be an important component deployed on the cloud server 101, which is used to allow users to access and use the virtual desktop environment on the cloud server 101. The desktop environment 103 can be an operating system and application deployed in a virtual machine, which can be installed and configured in the virtual machine, allowing users to use them like on a local computer. Different virtual machines can deploy different desktop environments 103, thereby enabling multiple users to share resources on the same physical server, as well as cloud and mobile desktop environments. The user access interface 104 refers to the interface for users to access the cloud desktop system 100 by connecting to the cloud server through the network. It can be a web-based remote desktop protocol (such as RDP, VNC or HTML5), or it can be accessed through a dedicated desktop client. The user access interface 104 is the main way for users to interact with the cloud desktop system 100. Through the user access interface 104, users can access and manage the virtual desktop environment on the cloud server 101, including starting virtual machines, logging into the desktop environment, using applications, accessing files and data, etc.

[0033] The cloud desktop system 100 composed of the cloud server 101, the virtual machine manager 102, the desktop environment 103 and the user access interface 104 can be an application environment of the cloud desktop system power failure protection method. In the cloud desktop system power failure protection method, these components need to implement a reliable backup and recovery mechanism to ensure that the system can be restored in time after power failure, and the user's data and operations will not be lost or damaged.

[0034] The following is a detailed description of the power-off protection method for the cloud desktop system according to the embodiment of the present application.

[0035] See also Figure 2 , Figure 2 1 is a flow chart of a power-off protection method for a cloud desktop system provided in an embodiment of the present application. Figure 2 As shown, the method comprises the following steps:

[0036] S11. Control BIOS startup and load the UEFI boot program.

[0037] In the cloud desktop system, power-off protection can be achieved by setting relevant options in BIOS. BIOS is the basic input / output system of the computer. It is a firmware located in a chip on the computer motherboard. It is responsible for initializing and testing hardware devices and starting the operating system. When the computer suddenly loses power, some settings in the BIOS may be lost, which may cause the computer to fail to boot normally. To solve this problem, BIOS provides an option called "power-off recovery" or "AC recovery", which can automatically restart the computer after a power outage and try to restore the previous state. During the startup process, BIOS will try to find a bootable device, such as a hard drive, optical drive, or USB drive. If a bootable device is found and the UEFI (Unified Extensible Firmware Interface) boot program is installed on the device, the BIOS will load the UEFI boot program and transfer control to the UEFI boot program.

[0038] The UEFI bootloader is a small piece of software that runs when the computer starts up and is responsible for loading the operating system. The UEFI bootloader is located in a specific partition of the hard drive and runs automatically after the BIOS loads it. When the computer starts up, the UEFI bootloader scans the various devices on the computer, finds the device containing the operating system, and loads the operating system kernel. Once the kernel is loaded, the operating system starts running and the computer enters a normal working state.

[0039] Therefore, by setting the power failure recovery option in the BIOS, you can ensure that after the computer suddenly loses power, it can automatically restart and try to restore the previous state. At the same time, the BIOS will try to load the UEFI boot program on the bootable device to start the operating system and ensure that the computer can re-enter the normal working state.

[0040] S12: Determine whether a power-off flag has been powered off by using the UEFI boot program.

[0041] Among them, the power-off flag is a flag used to indicate whether the computer system was shut down normally during the last operation. If the computer was shut down normally during the last operation, the power-off flag will be cleared. If the computer had an unexpected power outage or crash during the last operation, the power-off flag will be set. In some computer systems, the power-off flag is maintained by special files or disk partitions. For example, in the Windows operating system, the power-off flag can be maintained by the hiberfil.sys file. The hiberfil.sys file is a file that contains the memory image when the system is in hibernation. When the computer enters hibernation mode, the operating system saves the contents of the memory to the hiberfil.sys file and sets the power-off flag to hibernate.

[0042] In an embodiment of the present application, the UEFI boot program can determine whether the power-off flag is set by checking a special file in a specific file system. For example, the UEFI boot program scans all available devices on the computer, looking for a device containing a UEFI boot program and an operating system. Once a device containing a UEFI boot program is found, the UEFI boot program will attempt to mount the file system therein and read the special file therein to determine the state of the power-off flag. If the UEFI boot program detects that the special file already exists and the flag therein is set to indicate that the power has been cut off, the UEFI boot program will perform corresponding operations, such as starting a recovery environment or prompting the user to perform a recovery operation. If the UEFI boot program detects that the special file does not exist or the flag is not set, it can be considered that the computer was shut down normally last time, and the UEFI boot program will continue to load the operating system and start the computer.

[0043] If the power-off flag is powered off, the following step S13 is executed.

[0044] If the power-off flag does not indicate a power-off, Windows GuestOS is started, and Windows GuestOS performs operations such as shutting down and restarting the computer or restarting the computer or performing power-off and restarting operations.

[0045] Among them, Windows GuestOS refers to the virtualized operating system running in the cloud desktop system. It is a client operating system running in the virtualized environment of the cloud desktop system, and usually refers to the Windows operating system running in the virtual machine. In the cloud desktop system, the virtual machine is a simulated computer environment created by virtualization software. The virtualization software divides the resources of the physical computer (such as CPU, memory, storage, etc.) into multiple virtual machines, each of which runs a client operating system, such as the Windows operating system. These virtual machines can run on the same physical computer at the same time, and each virtual machine has an independent operating system, application program, and user data. In the cloud desktop system, power failure protection usually needs to ensure that the virtual machine can automatically recover to its previous state after power failure. If the power failure flag does not fail, Windows GuestOS can perform operations such as shutdown, restart, or power failure restart to ensure that the virtual machine can automatically recover to its previous state and resume normal operation. These operations can be achieved by running corresponding commands in Windows GuestOS or remotely controlling through virtualization management tools.

[0046] S13, start WinPE, and obtain a corresponding repair tool according to the type of the file system, repair the file system based on the WinPE and the repair tool, reset the power-off flag, and restart the WinPE to complete the repair of the file system.

[0047] Wherein, starting WinPE includes: starting the WinPE according to the virtual machine corresponding to the cloud desktop system; or starting the WinPE through HostOS using KVM virtualization technology. WinPE is a simplified version of the Windows operating system, which is based on the Windows kernel but only contains necessary components and drivers, and is small and can be started quickly.

[0048] In the embodiment of the present application, the cloud desktop system can start WinPE in two ways. One is to start WinPE according to the virtual machine corresponding to the cloud desktop system. This method is to mount the WinPE ISO image file into the virtual machine, and start WinPE from the ISO image file when the virtual machine starts. This method requires the virtualization software to support starting the virtual machine from the ISO image file. The other is to start WinPE using KVM virtualization technology through HostOS. This method is to start WinPE as a virtual machine, use KVM virtualization technology to create a virtual machine on HostOS, and mount the WinPE ISO image file into the virtual machine. This method requires HostOS to support KVM virtualization technology.

[0049] After WinPE is started, users can use the tools and functions in it to perform various maintenance and recovery tasks.

[0050] Among them, the method of obtaining the corresponding repair tool according to the type of file system, repairing the file system based on the WinPE and the repair tool, resetting the power-off flag, and restarting the WinPE includes: obtaining the repair tools chkdsk and qemu-img according to the type of file system; using chkdsk to repair the NTFS partition, using qemu-img to repair qcow2, resetting the power-off flag, and restarting the WinPE.

[0051] Chkdsk is a disk check and repair tool in the Windows operating system that can scan the file system on the computer's hard disk and check for errors and damage in the file system. If errors and damage are found, chkdsk can try to repair the file system and recover damaged data. Chkdsk can be run from the command line or the disk check tool in Windows Explorer. qemu-img is a command line tool that can be used to create, convert, and manage virtual disk image files, such as creating and managing qcow2, vmdk, raw, etc.

[0052] For example, if the file system on the computer's hard disk is damaged or an error occurs, you can use chkdsk to check and repair the file system. If you use virtualization technology to create and manage virtual machines, you can also use qemu-img to manage virtual disk image files.

[0053] Repairing NTFS partitions using chkdsk can include: in Windows operating system, open the command prompt window by entering the command; in the command prompt window, enter the corresponding command of chkdsk and start it; chkdsk starts scanning and repairing errors and bad sectors in the NTFS partition. If chkdsk finds errors on the NTFS partition, you may need to restart the computer to complete the repair operation. After the computer restarts, chkdsk will automatically run and try to continue repairing errors.

[0054] Repairing qcow2 using qemu-img can include: opening a command prompt or terminal window; running the qemu-imgcheck command; qemu-img starts scanning and repairing errors in the qcow2 virtual disk image file. If qemu-img finds errors and repairs them, it will display a corresponding message.

[0055] The above-mentioned NTFS partition and qcow2 are respectively the commonly used file systems and virtual disk image formats in computer systems.

[0056] In some embodiments, before executing the steps of controlling BIOS startup and loading the UEFI boot program, the method further includes: determining virtual disk drive information.

[0057] Determining the virtual disk drive information includes: controlling the data to be written from the memory cache to the non-volatile storage medium, then updating the index, and ensuring that subsequent data requests are executed after the index update is completed.

[0058] In a virtualized environment, the virtual disk driver is responsible for managing the read and write operations of the virtual disk. When an application needs to read or write virtual disk data, the virtual disk driver writes the data from the memory cache to a non-volatile storage medium, such as a hard disk or SSD. Before writing data, the virtual disk driver updates the index to ensure that the data is written in order. This avoids errors or loss of data when writing to the non-volatile storage medium, while also ensuring data consistency and integrity. If the virtual disk driver does not control the order in which data is written, errors may occur in the order in which data is written, which may cause data corruption or loss. In addition, if the virtual disk driver executes subsequent data requests before updating the index, data read errors may occur, which may also cause data corruption or loss.

[0059] Cloud desktop systems are usually implemented based on virtualization technology. The operating system and applications in the virtual machine use virtual disks to store data. In a virtualized environment, the virtual disk driver is responsible for managing the read and write operations of the virtual disk. If the virtual disk driver fails to write data from the memory cache to the non-volatile storage medium in a timely manner during a power outage or other unexpected circumstances, data loss or damage may occur, resulting in system crashes or data loss.

[0060] In order to avoid this situation, the embodiment of the present application controls the data to be written from the memory cache to the non-volatile storage medium before executing the power-off protection step of the cloud desktop system, and executes subsequent data requests after the index update is completed. This can ensure the consistency and integrity of the data, avoid data loss or damage, and ensure the stability and reliability of the system.

[0061] Optionally, the determining of the virtual disk driver information further includes: controlling the data to follow a preset order, and when a preset time is waited or a preset condition is currently satisfied, writing the data from the memory cache to the non-volatile storage medium. In a virtualized environment, the virtual disk driver needs to manage the read and write operations of the virtual disk, including writing data from the memory cache to the non-volatile storage medium. If the virtual disk driver controls the order in which data is written, it can ensure that the order in which data is written is orderly, thereby avoiding errors or data loss when writing data.

[0062] The above-mentioned control data is written from the memory cache to the non-volatile storage medium, including: using the IRP_MJ_FLUSH_BUFFERS command to write the data from the memory cache to the non-volatile storage medium. The IRP_MJ_FLUSH_BUFFERS command is a command provided by the Windows operating system, which can refresh the data in the file system cache to the disk. In a virtualized environment, the virtual disk driver can use the IRP_MJ_FLUSH_BUFFERS command to write the data in the memory to the non-volatile storage medium, thereby ensuring the consistency and integrity of the data.

[0063] The embodiment of the present application provides a power-off protection method for a cloud desktop system, which controls the BIOS to start and loads the UEFI boot program, and determines whether the power-off flag bit is powered off through the UEFI boot program. If the power-off flag bit is powered off, WinPE is started, and the corresponding repair tool is obtained according to the type of the file system, the file system is repaired based on the WinPE and the repair tool, the power-off flag bit is reset, and the WinPE is restarted to complete the repair of the file system. Wherein, during the operation of the cloud desktop system, the BIOS is controlled to start and the UEFI boot program is loaded to determine whether the system is powered off, and the file system is repaired through WinPE and the repair tool when a power outage occurs, thereby ensuring the stability of the system and the integrity of the data. After the repair is completed, the power-off flag bit will be reset, and WinPE will be restarted so that the system continues to run. When the system is powered off, the method repairs the file system in an automated manner, avoiding the occurrence of data loss and system crashes caused by power outages, and improving the reliability and stability of the system. At the same time, the scheme has the advantages of automation, speed, and accuracy, which can improve the efficiency and response speed of system power-off repair and reduce manual intervention and maintenance costs.

[0064] See also Figure 3 , Figure 3 1 is a schematic diagram of a power failure protection device for a cloud desktop system provided in an embodiment of the present application. The cloud desktop system power failure protection device 20 comprises: a startup module 21 , a power failure detection module 22 and a repair module 23 .

[0065] The startup module 21 is used to control the BIOS startup and load the UEFI boot program; the power-off detection module 22 is used to determine whether a power-off occurs on the power-off flag through the UEFI boot program; the repair module 23 is used to start WinPE if a power-off occurs on the power-off flag, and obtain the corresponding repair tool according to the type of file system, repair the file system based on the WinPE and the repair tool, reset the power-off flag, and restart the WinPE to complete the repair of the file system.

[0066] The repair module 23 is specifically used to obtain the repair tools chkdsk and qemu-img according to the type of the file system; use chkdsk to repair the NTFS partition, use qemu-img to repair qcow2, reset the power-off flag, and restart the WinPE.

[0067] The starting of WinPE includes: starting the WinPE according to a virtual machine corresponding to the cloud desktop system; or starting the WinPE using KVM virtualization technology through HostOS.

[0068] In some embodiments, a virtual disk drive information setting module 24 is also included, which is used to determine the virtual disk drive information, specifically to control the data to be written from the memory cache to the non-volatile storage medium, and then update the index, and ensure that subsequent data requests are executed after the index update is completed. Optionally, the virtual disk drive information setting module 24 is also specifically used to control the data to be written from the memory cache to the non-volatile storage medium in a preset order, and wait for a preset time or when a preset condition is currently met.

[0069] The controlling data to be written from the memory cache to the non-volatile storage medium includes: using an IRP_MJ_FLUSH_BUFFERS command to write the data from the memory cache to the non-volatile storage medium.

[0070] It should be noted that the above-mentioned cloud desktop system power failure protection device can execute the cloud desktop system power failure protection method provided in the embodiment of the present application, and has the corresponding functional modules and beneficial effects of the execution method. For technical details not fully described in the embodiment of the cloud desktop system power failure protection device, please refer to the cloud desktop system power failure protection method provided in the embodiment of the present application.

[0071] See also Figure 4 , Figure 4 is a hardware structure diagram of an electronic device 30 for executing a power-off protection method for a cloud desktop system provided in an embodiment of the present application, such as Figure 4 As shown, the electronic device 30 includes: one or more processors 31 and a memory 32, Figure 4 A processor 31 is taken as an example.

[0072] The processor 31 and the memory 32 may be connected via a bus or other means. Figure 4 The example of connecting through bus is taken in the following.

[0073] The memory 32 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions / modules corresponding to the power-off protection method for the cloud desktop system in the embodiment of the present application. The processor 31 executes various functional applications and data processing of the electronic device by running the non-volatile software programs, instructions and modules stored in the memory 32, that is, the power-off protection method for the cloud desktop system in the above method embodiment is implemented.

[0074] The memory 32 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and applications required for at least one function; the data storage area may store data created according to the use of the power-off protection device of the cloud desktop system, etc. In addition, the memory 32 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 32 may optionally include a memory remotely arranged relative to the processor 31, and these remote memories may be connected to the power-off protection device of the cloud desktop system via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0075] The one or more modules are stored in the memory 32, and when executed by the one or more processors 31, the cloud desktop system power-off protection method in any of the above method embodiments is executed.

[0076] The above-mentioned product can execute the method provided in the embodiment of the present application, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not fully described in this embodiment, please refer to the method provided in the embodiment of the present application.

[0077] The electronic devices of the embodiments of the present application exist in various forms, including but not limited to: ultra-mobile personal computer devices, which belong to the category of personal computers, have computing and processing functions, and generally also have mobile Internet access features. Server: A device that provides computing services. The server consists of a processor, hard disk, memory, system bus, etc. The server is similar to a general computer architecture, but because it needs to provide highly reliable services, it has higher requirements in terms of processing power, stability, reliability, security, scalability, manageability, etc. Other electronic devices with data interaction functions.

[0078] The embodiment of the present application provides a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are executed by one or more processors, such as Figure 4A processor 31 in the embodiment can enable the one or more processors to execute the cloud desktop system power-off protection method in any of the above method embodiments.

[0079] An embodiment of the present application provides a computer program product, which includes a computer program stored on a non-volatile computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by the electronic device, the electronic device is enabled to execute the cloud desktop system power-off protection method in any of the above-mentioned method embodiments.

[0080] The device embodiments described above are merely illustrative, wherein 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 modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0081] Through the description of the above implementation methods, ordinary technicians in this field can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, it can also be implemented by hardware. Ordinary technicians in this field can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.

[0082] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Under the concept of the present application, the technical features in the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other changes in different aspects of the present application as described above, which are not provided in detail for the sake of simplicity. Although the present application has been described in detail with reference to the aforementioned embodiments, a person of ordinary skill in the art should understand that the technical solutions described in the aforementioned embodiments can still be modified, or some of the technical features can be replaced by equivalents. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A power failure protection method for a cloud desktop system, characterized in that: include: Control BIOS startup and load the UEFI boot program; Determine whether a power failure occurs at the power failure flag by using the UEFI boot program; If the power off flag is off, WinPE is started, and the corresponding repair tool is obtained according to the type of file system, the file system is repaired based on WinPE and the repair tool, the power off flag is reset, and WinPE is restarted to complete the repair of the file system.

2. The method according to claim 1, characterized in that Before executing the step of controlling BIOS startup and loading the UEFI boot program, the method further includes: Confirm the virtual disk drive information.

3. The method according to claim 2, characterized in that Determining the virtual disk drive information includes: After the control data is written from the memory cache to the non-volatile storage medium, the index is updated, and it is ensured that subsequent data requests are executed after the index update is completed.

4. The method according to claim 3, characterized in that The determining of the virtual disk drive information further includes: The control data is written from the memory cache to the non-volatile storage medium in a preset order and when a preset time has passed or a preset condition is currently met.

5. The method according to claim 3 or 4, characterized in that: The control data is written from the memory cache to the non-volatile storage medium, comprising: Use the IRP_MJ_FLUSH_BUFFERS command to write data from the memory cache to non-volatile storage media.

6. The method according to claim 1, characterized in that The obtaining of a corresponding repair tool according to the type of the file system, repairing the file system based on the WinPE and the repair tool, resetting the power-off flag, and restarting the WinPE includes: Obtain the repair tools chkdsk and qemu-img according to the file system type; Use chkdsk to repair the NTFS partition, use qemu-img to repair qcow2, reset the power-off flag, and restart the WinPE.

7. The method according to claim 1, characterized in that The WinPE startup includes: Start the WinPE according to the virtual machine corresponding to the cloud desktop system; or The WinPE is started by using the KVM virtualization technology through the HostOS.

8. A power failure protection device for a cloud desktop system, characterized in that: include: The startup module is used to control BIOS startup and load the UEFI boot program; A power-off detection module, used to determine whether a power-off flag has occurred through the UEFI boot program; The repair module is used to start WinPE if the power-off flag is off, and obtain the corresponding repair tool according to the type of file system, repair the file system based on WinPE and the repair tool, reset the power-off flag, and restart WinPE to complete the repair of the file system.

9. An electronic device, characterized in that: include: 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, and the instructions are 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 to 7.

10. A non-volatile computer-readable storage medium, characterized in that: The non-volatile computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by an electronic device, the electronic device executes the method according to any one of claims 1 to 7.