Operating system boot methods, devices, equipment, clusters, products and media

By setting different working modes and boot counts, combined with a voting mechanism, the adaptability of non-volatile memory file systems in different scenarios is solved, enabling fast and reliable file system reading and writing, and improving the success rate and efficiency of operating system boot.

CN122308929APending Publication Date: 2026-06-30HUAWEI TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HUAWEI TECH CO LTD
Filing Date
2024-12-28
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

Existing technologies for storing file systems in non-volatile memory cannot flexibly adapt to the needs of different scenarios, resulting in insufficient efficiency and reliability of read or write operations.

Method used

This paper provides an operating system boot method that flexibly selects to read file systems from multiple non-volatile storage devices by setting different working modes and boot counts, and uses a voting mechanism for error correction and recovery to ensure the accuracy and reliability of the file systems.

Benefits of technology

It enables fast and reliable file system reading and writing in different scenarios, improving the success rate and efficiency of operating system startup.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122308929A_ABST
    Figure CN122308929A_ABST
Patent Text Reader

Abstract

This application provides an operating system booting method, apparatus, device, cluster, product, and medium. The method includes: receiving a user-defined number of boot attempts for the operating system and a working mode for each boot attempt that reads the file system required to boot the operating system. The number of boot attempts is the maximum number of times the operating system is allowed to fail to boot, and the number of boot attempts is greater than one. Booting includes a first boot and a second boot attempt. The working modes include a first working mode and a second working mode. The first boot attempt uses the first working mode, and the second boot attempt uses the second working mode. The number of identical file systems that need to be read in the first working mode is different from the number of identical file systems that need to be read in the second working mode. The method also includes: reading the file system according to the number of boot attempts and the working mode for each boot attempt; and booting the operating system using the file system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computing processing, and more particularly to an operating system booting method, apparatus, device, cluster, product, and medium. Background Technology

[0002] Because the flux of high-energy particles in near-Earth orbit is several orders of magnitude higher than on Earth, bits in the file system of non-volatile memory (NVM) are prone to flipping. To ensure the accuracy of the file system, the same file system is typically stored simultaneously in multiple NVMs, with one copy stored in each NVM. This way, if one file system malfunctions, the other valid file systems can be used to correct the error. However, the current operating mode of reading or writing to multiple NVMs separately cannot meet the needs of various situations. Summary of the Invention

[0003] This application provides an operating system boot method, apparatus, device, cluster, product, and medium that can flexibly adapt to the needs of different scenarios.

[0004] Firstly, an operating system boot method is provided. The method includes:

[0005] First, the system receives the user-defined number of times the operating system can be booted and the operating mode for each boot, specifying the file system required to boot the operating system. The number of boots is the maximum number of times the operating system is allowed to fail to boot, and this number is greater than one. The booting process includes a first boot and a second boot, and the operating modes include a first operating mode and a second operating mode. The first boot uses the first operating mode, and the second boot uses the second operating mode. The number of identical file systems that need to be read in the first operating mode differs from the number of identical file systems that need to be read in the second operating mode. Second, the system reads the file system according to the number of boots and the operating mode for each boot. Finally, the system boots the operating system using the file system.

[0006] The above solution allows for flexible use of multiple working modes, adapting to different needs.

[0007] In some possible designs, the file system includes a first file system, a second file system, and a third file system. The first working mode and the second working mode will be described in detail below based on the inclusion of the first, second, and third file systems.

[0008] In the first working mode, the primary file system includes the first file system, and the secondary file system includes the second file system and the third file system.

[0009] In the case of the first startup, the first page of the first file system is read, and if the first page of the first file system is successfully read through the first verification, the reading of the first page of the file system ends;

[0010] If the first page of the first file system fails to pass the first verification, read the first page of the second file system and the first page of the third file system.

[0011] If the first page of the second file system and the first page of the third file system are successfully read and pass the first verification, and the contents of the first page of the second file system and the first page of the third file system are the same, then the first page of the first file system is restored based on the first page of the second file system and the first page of the third file system. The first verification is used to detect and correct errors in the pages of the file system.

[0012] If the first page of the second file system and the first page of the third file system are successfully read through the first verification, and the contents of the first page of the second file system and the first page of the third file system are different, select the first page of the second file system or the first page of the third file system, and end the reading of the first page of the file system;

[0013] If the first page of the second file system that has passed the first verification is successfully read, but the first page of the third file system is not successfully read, select the first page of the second file system and end the reading of the first page of the file system;

[0014] If the first page of the third file system that has passed the first verification is successfully read, but the first page of the second file system is not successfully read, select the first page of the third file system and end the reading of the first page of the file system;

[0015] If the first page of the second file system and the first page of the third file system are not successfully read, a second startup is triggered.

[0016] In the second working mode, the primary file system includes the second file system and the third file system, and the secondary file system includes the first file system.

[0017] In the case of the second startup, the first page of the second file system and the first page of the third file system are read. If the first page of the second file system and the first page of the third file system are successfully read, and the first page of the first file system and the first page of the second file system are the same, the reading of the first page of the file system ends.

[0018] If the first page of the second file system and the first page of the third file system are successfully read, and the first pages of the second file system and the third file system are different, then the first page of the first file system is read. If the first page of the first file system is successfully read, and the first page of the first file system is the same as the first page of the second file system, then the first page of the third file system is restored using the first page of the first file system and the first page of the second file system, and the reading of the first page of the file system ends. If the first page of the first file system is successfully read, and the first page of the first file system is the same as the first page of the third file system, then the first page of the second file system is restored using the first page of the first file system and the first page of the third file system, and the reading of the first page of the file system ends. If the first page of the first file system is not successfully read, then the first page of the second file system or the first page of the third file system is selected, and the reading of the first page of the file system ends.

[0019] If the first page of the second file system is successfully read, but the first page of the third file system is not successfully read, select the first page of the second file system and end the reading of the first page of the file system;

[0020] If the first page of the third file system is successfully read, but the first page of the second file system is not successfully read, select the first page of the third file system and end the reading of the first page of the file system;

[0021] If the first page of the second file system and the first page of the third file system are not successfully read, the first page of the first file system is read. If the first page of the first file system is successfully read, the first page of the first file system is returned. If the first page of the first file system is not successfully read, the second startup ends.

[0022] In the above scheme, since the processor reads multiple non-volatile memories serially, and the first working mode only needs to read a file system page in one non-volatile memory, the reading speed is very fast. The second working mode needs to read file system pages in two non-volatile memories. Therefore, although the reading speed is not as fast as the first working mode, the reliability is higher than the first working mode.

[0023] In some possible designs, before reading the file system according to the number of boots and the operating mode of the file system required to boot the operating system at each boot, the method further includes:

[0024] If the file system is detected to be in a creation state, a second file system and a third file system are created based on the first file system, wherein the first file system is a file system that was created before the power failure, and the second file system and the third file system are file systems that were not successfully created before the power failure.

[0025] In the above scheme, even if a power outage occurs after the first file system is created, the second and third file systems can still be created based on the creation status markers after the system is restarted.

[0026] In some possible designs, if the file system is detected to be marked as deleted, the second file system and the third file system are deleted, wherein the first file system is a file system that was deleted before the power failure, and the second file system and the third file system are file systems that were not successfully deleted before the power failure.

[0027] In the above scheme, even if a power outage occurs after deleting the first file system, the second and third file systems can still be deleted based on the deletion status markers after the system is restarted.

[0028] In some possible designs, the method further includes, before booting the operating system using the file system:

[0029] A second verification is performed on the file system, wherein the second verification is used to verify the integrity and consistency of the file system.

[0030] In some possible designs, after the operating system is booted using the file system, the method further includes:

[0031] When performing a write operation on the file system, after completing the write operations on the first file system and the second file system, the write operation on the third file system is paused.

[0032] Secondly, an operating system boot device is provided, comprising: a receiving module, a reading module, and a boot module.

[0033] The receiving module is used to receive the number of times the operating system is started by the user and the working mode of reading the file system required to start the operating system for each start. The number of starts is the maximum number of times the operating system is allowed to fail to start. The number of starts is greater than 1. The start includes a first start and a second start. The working mode includes a first working mode and a second working mode. The first start uses the first working mode and the second start uses the second working mode. The number of the same file system that needs to be read in the first working mode is different from the number of the same file system that needs to be read in the second working mode.

[0034] The reading module is used to read the file system according to the number of startups and the working mode of the file system required to start the operating system for each startup;

[0035] The startup module is used to start the operating system using the file system.

[0036] Thirdly, a computing device is provided, the computing device including a processor and a memory;

[0037] The processor is configured to execute instructions stored in the memory to cause the computing device to perform the operational steps of the method as described in any of the first aspects.

[0038] Fourthly, a computing device cluster includes multiple computing devices, each computing device including a processor and memory;

[0039] A processor of at least one computing device is configured to execute instructions stored in the memory of the at least one computing device to cause the cluster of computing devices to perform operational steps as described in any of the first aspects.

[0040] Fifthly, a computer program product containing instructions is provided, which, when executed by a cluster of computing devices, cause the cluster of computing devices to perform the operational steps of the method described in any of the first aspects.

[0041] In a sixth aspect, a computer-readable storage medium is provided, including computer program instructions that, when executed by a cluster of computing devices, perform operational steps as described in any of the first aspects. Attached Figure Description

[0042] Figure 1This is a schematic diagram of the structure of an operating system boot device provided in this application;

[0043] Figure 2 This is a schematic diagram of the structure of an operating system boot system provided in this application;

[0044] Figure 3 This is a flowchart illustrating an operating system boot method provided in this application;

[0045] Figure 4 This is a schematic diagram of the structure of a computing device provided in this application;

[0046] Figure 5 This is a schematic diagram of the structure of a computing device cluster provided in this application;

[0047] Figure 6 This is a schematic diagram of another computing device cluster provided in this application. Detailed Implementation

[0048] See Figure 1 , Figure 1 This is a schematic diagram of the structure of an operating system boot device provided in this application. Figure 1 As shown, the boot device of this application includes a processor 110, a volatile memory 120, and a plurality of non-volatile memories 130.

[0049] The processor 110 may include any one or more of the following computing devices: central processing unit (CPU), graphics processing unit (GPU), microprocessor (MP) or digital signal processor (DSP), application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), complex programmable logic device (CPLD), neural processing unit (NPU), system on chip (SoC), offload card, accelerator card, etc.

[0050] Volatile memory (VRAM) refers to memory whose stored data is immediately lost when power is turned off or interrupted. There can be one or more VRAMs. In computer systems, VRAM is typically used for temporary storage of running programs and data because it has high read / write speeds and can quickly exchange data with the central processing unit (CPU), thereby improving system efficiency. Common VRAMs include dynamic random access memory (DRAM), static random access memory (SRAM), and cache.

[0051] Non-volatile memory (NVRAM) refers to memory whose stored data is not lost when power is turned off or interrupted. Common NVRAMs include read-only memory (ROM), flash memory, magnetic random access memory (MRAM), phase-change memory (PCM), and resistive random access memory (RRAM). NVRAM is typically used for long-term storage of data and programs, such as file systems. To ensure the accuracy of the file system, multiple NVRAMs can be used, each storing the same file system. A file system is a collection of methods and data structures for managing and organizing files and directories on a boot device. Common file systems include the file allocation table (FAT), the new technology file system (NTFS), and the extended file system (EXT).

[0052] Because the same file system is stored in multiple non-volatile memory locations, when an error occurs in a minority of these locations, the boot device can use a voting mechanism to determine the correct file system based on the majority of the other valid non-volatile memory locations. For example, suppose the same file system is stored in three non-volatile memory locations. If one of these locations malfunctions due to interference, the remaining two locations will have valid file systems. Through a voting mechanism, the two valid file systems can be compared with the malfunctioning one to determine the correct file system. The above example uses three non-volatile memory locations to illustrate this; in practical applications, four or more non-volatile memory locations can also store the same file system. Furthermore, to avoid a tie in votes, the same file system can be stored in an odd number of non-volatile memory locations, such as five or seven.

[0053] Because data transfer between the processor and multiple non-volatile memories is serial, reads and writes to these memories must be performed sequentially. For example, if the processor needs to read and write file systems in three non-volatile memories (first, second, and third), it must first read and write file system 1 in the first non-volatile memory, then read and write file system 2 in the second non-volatile memory, and finally read and write file system 3 in the third non-volatile memory.

[0054] See Figure 2 , Figure 2 This is a schematic diagram of the structure of an operating system boot system provided in this application. Figure 2 The operating system shown boots up and runs in the following way: Figure 1 The startup device is shown. For example... Figure 2 As shown, the operating system boot system of this application includes: an application layer 210, a file system layer 220, and a storage layer 230. The application layer and file system layer can run on the processor, while the storage layer can run on non-volatile memory.

[0055] Storage layer 230 is used to manage file systems in multiple non-volatile memories by page. When storing a file system, if its size exceeds the size of a page, it will be divided into multiple pages for storage. Therefore, a file system typically includes multiple pages. A page is usually the basic unit for storing data, and the page size is usually fixed, with common sizes being 512 bytes, 1KB, 4KB, etc. Each page has a checksum, which can be used for initial verification of the page. This initial verification can be an error correction code (ECC), such as cyclic redundancy check, low-density parity check, parity check, etc. Storage layer 230 manages the file system by page, which effectively improves the file system's recovery capability. For example, suppose file system 1 includes page 1, page 2, and page 3; file system 2 includes page 1, page 2, and page 3; and file system 3 includes page 1, page 2, and page 3. Under normal circumstances, page 1 in file system 1, page 1 in file system 2, and page 1 in file system 3 should be identical; page 2 in file system 1, page 2 in file system 2, and page 2 in file system 3 should be identical; and page 3 in file system 1, page 3 in file system 2, and page 3 in file system 3 should be identical. However, under interference, page 1 in file system 1 and page 2 in file system 3 may become corrupted. In this case, through a voting mechanism, page 1 in file system 1 can be restored using page 1 in file system 2 and page 1 in file system 3, and page 2 in file system 1 and page 2 in file system 3 can be restored using page 2 in file system 1 and page 2 in file system 2.

[0056] The receiving module 211 in the application layer 210 is used to receive the number of times the operating system is started by the user and the working mode used for each startup.

[0057] The following sections will provide a detailed introduction to the number of startups and the working modes.

[0058] The boot count is the maximum number of times the operating system can be booted. For example, the boot count can be 2, 3, or even more. For instance, assuming the boot count is 4, if the first boot attempt fails, it will attempt a second boot attempt. If the second boot attempt also fails, it will attempt a third boot attempt. If the third boot attempt also fails, it will attempt a fourth boot attempt. However, if the fourth boot attempt fails, it will not attempt to boot the operating system again.

[0059] There can be multiple operating modes, and the number of file systems that need to be read varies depending on the operating mode. Since the operating system kernel file is usually stored in the file system, when the operating system starts, it needs to find and load the kernel from the file system in order to initialize the core functions of the operating system. Therefore, to successfully start the operating system, it is necessary to correctly read the file system.

[0060] Since the same file system is stored in multiple non-volatile memories, different operating modes can be set, and the number of file systems that need to be read varies in different operating modes. For example, suppose the same file system is stored in three non-volatile memories: a first non-volatile memory, a second non-volatile memory, and a third non-volatile memory. The file system stored in the first non-volatile memory can be called file system 1, the file system stored in the second non-volatile memory can be called file system 2, and the file system stored in the third non-volatile memory can be called file system 3. In this case, three different operating modes can be set. Since the reading process for each page in the file system is the same, page 1 will be used as an example below.

[0061] In operating mode 1, ideally, only page 1 of the file system needs to be read from one non-volatile memory. In operating mode 1, one file system can be designated as the primary file system, and the others as secondary file systems. The primary file system is the one that needs to be read in operating mode 1, and the secondary file systems are the escape files if reading from the primary file system fails. For example, file system 2 can be designated as the primary file system, and file systems 1 and 3 as secondary file systems. Therefore, in operating mode 1, page 1 of file system 2 can be read first from the second non-volatile memory. If page 1 of file system 3, which has passed the first check, is successfully read, the reading of page 1 of file system 2 can be stopped. Therefore, ideally, only page 1 of the file system needs to be read from one non-volatile memory. If page 1 of file system 2 is not successfully read, page 1 of file system 1 can be read from the first non-volatile memory, and page 1 of file system 3 can be read from the third non-volatile memory. Then, a voting process can be used to attempt to recover page 1 of file system 2. For example, if page 1 of file system 1 and page 1 of file system 3 are identical, a voting process can be used to determine that page 1 of file system 1 and page 1 of file system 3 are correct. Therefore, an attempt can be made to recover page 1 of file system 2 using page 1 of file system 1 and page 1 of file system 3. If page 1 of file system 2 and page 1 of file system 3 successfully pass the first verification, and the contents of page 1 of file system 2 and page 1 of file system 3 are different, then either page 1 of file system 2 or page 1 of file system 3 is selected, and the reading of page 1 of file system 2 ends. If page 1 of file system 2 successfully passes the first verification, but page 1 of file system 3 is not successfully read, then page 1 of file system 2 is selected, and the reading of page 1 of file system 2 ends. If page 1 of file system 3 successfully passes the first verification, but page 1 of file system 2 is not successfully read, then page 1 of file system 3 is selected, and the reading of page 1 of file system 2 ends. If neither page 1 of file system 2 nor page 1 of file system 3 is successfully read, then the reading of page 1 of file system 2 is considered a failure.

[0062] The example above illustrates the principle of prioritizing page 1 of file system 1 in the secondary file system for escape, followed by page 1 of file system 3 in the secondary file system. In practical applications, it is also possible to prioritize page 1 of file system 3 in the secondary file system for escape, followed by page 1 of file system 1 in the secondary file system.

[0063] The above example uses file system 2 as the primary file system and other file systems as secondary file systems. In practical applications, file system 1 can also be used as the primary file system and other file systems as secondary file systems, or file system 3 can be used as the primary file system and other file systems as secondary file systems, and so on.

[0064] As mentioned earlier, the processor reads multiple non-volatile memories serially, while operating mode 1 only needs to read page 1 of the file system in one non-volatile memory, so the read speed is very fast.

[0065] In operating mode 2, ideally, only page 1 of the file system needs to be read from two non-volatile storage locations. In operating mode 2, two file systems can be designated as primary file systems, and the others as secondary file systems. For example, file systems 1 and 2 can be designated as primary file systems, and file system 3 as a secondary file system. Therefore, in operating mode 2, page 1 of file system 1 can be read first from the first non-volatile storage location, and page 1 of file system 2 can be read from the second non-volatile storage location. If page 1 of file system 1 and page 1 of file system 2 are completely identical, then page 1 of file system 1 and page 1 of file system 2 are considered correct, and either page 1 of file system 1 or page 1 of file system 2 has been successfully read. If page 1 of file system 1 and page 1 of file system 2 are different, page 1 of file system 3 is read from the third non-volatile storage location, and a voting mechanism is used to attempt to recover either page 1 of file system 1 or page 1 of file system 2. For example, if page 1 of file system 3 is the same as page 1 of file system 1, it means that page 1 of file system 2 is incorrect. Therefore, page 1 of file system 2 can be recovered using page 1 of file system 1 and page 1 of file system 3. If page 1 of file system 3 is the same as page 1 of file system 2, it means that page 1 of file system 1 is incorrect. Therefore, page 1 of file system 1 can be recovered using page 1 of file system 2 and page 1 of file system 3, and page 1 of either file system 1 or file system 2 can be successfully read. If page 1 of file system 1 is not successfully read, page 1 of either file system 2 or file system 3 can be selected to end the reading of page 1 of file system 1. If page 1 of file system 2 is successfully read, but page 1 of file system 3 is not successfully read, page 1 of file system 2 can be selected to end the reading of page 1 of file system 1. If page 1 of file system 3 is successfully read, but page 1 of file system 2 is not successfully read, page 1 of file system 3 can be selected to end the reading of page 1 of file system 1. If page 1 of file system 2 and page 1 of file system 3 are not successfully read, then page 1 of file system 1 is read. If page 1 of file system 1 is successfully read, then page 1 of file system 1 is returned. If page 1 of file system 1 is not successfully read, then the read of page 1 of file system 1 is considered to have failed.

[0066] As mentioned earlier, the processor reads multiple non-volatile memories serially, while operating mode 2 requires reading page 1 of the file system in two non-volatile memories. Therefore, although the read speed is not as fast as operating mode 1, the reliability is higher than that of operating mode 1.

[0067] In operating mode 3, page 1 of the file system needs to be read from three non-volatile memories. In operating mode 3, pages 1 of file system 1, file system 2, and file system 3 can be read separately from the three non-volatile memories.

[0068] If page 1 of all three file systems is the same, then page 1 of these file systems is considered correct, and page 1 of file system 1, file system 2, or file system 3 can be read. If page 1 of two of the three file systems is the same, then page 1 of the same file system can be considered correct, and page 1 of the remaining file system can be recovered using page 1 of these two file systems. If page 1 of all three file systems is different, an escape can be performed. First, page 1 of any one of file systems (file system 1, file system 2, or file system 3) can be selected for escape.

[0069] If only two file systems are successfully read from the three non-volatile memories, an escape can be made using either file system.

[0070] If only one file system is successfully read from the three non-volatile memories, then an escape can be made using that file system.

[0071] If the file system cannot be successfully read from any of the three non-volatile storage devices, the read of page 1 of the file system is considered to have failed.

[0072] As mentioned earlier, the processor reads multiple non-volatile memories serially, while operating mode 3 requires reading page 1 of the file system in three non-volatile memories. Therefore, the read speed of operating mode 3 is not as fast as operating mode 1 and operating mode 2. However, the reliability of operating mode 3 is higher than that of operating mode 1 and operating mode 2. Furthermore, operating mode 3 can recover from errors in page 1 of one of the file systems through a voting mechanism.

[0073] It is understandable that the above uses three file systems as examples to illustrate various working modes. In practical applications, when there are more file systems, there can be even more working modes, which are not specifically limited here.

[0074] The number of times the operating system can be booted and the operating mode used each time can be configured according to the user's needs. For example, it can be set to boot twice, with the first boot using operating mode 1 and the second boot using operating mode 2. Alternatively, it can be set to boot twice, with the first boot using operating mode 3 and the second boot using operating mode 1. Or, it can be set to boot three times, with the first boot using operating mode 1, the second boot using operating mode 2, and the third boot using operating mode 1. Or, it can be set to boot four times, with the first boot using operating mode 1, the second boot using operating mode 2, the third boot using operating mode 1, and the fourth boot using operating mode 1.

[0075] The read module 221 in the file system layer 220 is used to read the file system pages from the storage layer according to the number of times the operating system is started and the working mode adopted at each startup, and send the read file system pages to the application layer.

[0076] For simplicity, the following explanation will use the following example: the file system includes file system 1, file system 2, and file system 3, and each file system includes page 1, page 2, and page 3. The system is started 4 times. The first startup uses working mode 1, where the primary file system in working mode 1 is file system 1, and the secondary file systems are file system 2 and file system 3. The second startup uses working mode 2, where the primary file system in working mode 2 is file system 2 and file system 3, and the secondary file system is file system 1. The third startup uses working mode 1, where the primary file system in working mode 1 is file system 2, and the secondary file systems are file system 1 and file system 3. The fourth startup uses working mode 1, where the primary file system in working mode 1 is file system 3, and the secondary file systems are file system 1 and file system 2.

[0077] Upon initial startup, the system reads the file systems according to working mode 1, where the primary file system is file system 1, and the secondary file systems are file system 2 and file system 3.

[0078] (1) Read page 1 of the file system from the storage layer.

[0079] According to working mode 1, read page 1 of file system 1. If page 1 of file system 1 is successfully read and passes the first verification, then stop reading page 1 of file system 1 and start reading page 2 of file system 2.

[0080] If page 1 of file system 1 fails to read after the first verification, then enter working mode 3 to read page 1 of file system 2 and page 1 of file system 3.

[0081] If page 1 of file system 2 and page 1 of file system 3 are successfully read, and the contents of page 1 of file system 2 and page 1 of file system 3 are the same, page 1 of file system 1 is restored through a voting mechanism.

[0082] If the first verification of page 1 of file system 2 and page 1 of file system 3 is successfully read, and the contents of page 1 of file system 2 and page 1 of file system 3 are different, select page 1 of file system 2 or page 1 of file system 3 and end reading page 1 of file system 2.

[0083] If page 1 of file system 2 is successfully read after passing the first verification, but page 1 of file system 3 is not successfully read, then page 1 of file system 2 is selected and the reading of page 1 of file system 2 is ended.

[0084] If page 1 of file system 3 is successfully read after passing the first verification, but page 1 of file system 2 is not successfully read, then page 1 of file system 3 is selected and the reading of page 1 of file system 3 ends.

[0085] If page 1 of file system 2 and page 1 of file system 3 are not successfully read, a second boot is triggered.

[0086] (2) Read page 2 of the file system from the storage layer.

[0087] According to working mode 1, read page 2 of file system 1. If page 2 of file system 1 is successfully read and passes the first verification, then stop reading page 2 of file system and start reading page 3 of file system.

[0088] If page 2 of file system 1 fails to read after the first verification, then enter working mode 3 to read page 2 of file system 2 and page 2 of file system 3.

[0089] If page 2 of file system 2 and page 2 of file system 3 are successfully read, and the contents of page 2 of file system 2 and page 2 of file system 3 are the same, page 2 of file system 1 is restored through a voting mechanism.

[0090] If the first verification of page 2 of file system 2 and page 2 of file system 3 is successfully read, and the contents of page 2 of file system 2 and page 2 of file system 3 are different, select page 2 of file system 2 or page 2 of file system 3 and end reading page 2 of file system 2.

[0091] If page 2 of file system 2 is successfully read after passing the first verification, but page 2 of file system 3 is not successfully read, then page 2 of file system 2 is selected and the reading of page 2 of file system 2 is ended.

[0092] If page 2 of file system 3 is successfully read after passing the first verification, but page 2 of file system 3 is not successfully read, then page 2 of file system 3 is selected and the reading of page 2 of file system 3 ends.

[0093] If page 2 of file system 2 and page 2 of file system 3 are not successfully read, a second boot is triggered.

[0094] (3) Read page 3 of the file system from the storage layer.

[0095] According to working mode 1, read page 3 of file system 1. If page 3 of file system 1 that has passed the first verification is successfully read, then stop reading page 3 of file system and successfully read the entire file system.

[0096] If page 3 of file system 1 fails to read after the first verification, then enter working mode 3 to read page 3 of file system 2 and page 3 of file system 3.

[0097] If page 3 of file system 2 and page 3 of file system 3 are successfully read, and the contents of page 3 of file system 2 and page 3 of file system 3 are the same, page 3 of file system 1 is restored through a voting mechanism.

[0098] If the first verification of page 3 of file system 2 and page 3 of file system 3 is successfully read, and the contents of page 3 of file system 2 and page 3 of file system 3 are different, select page 3 of file system 2 or page 3 of file system 3, end the reading of page 3 of file system 2, and successfully read the entire file system.

[0099] If page 3 of file system 2 is successfully read after passing the first verification, but page 3 of file system 3 is not successfully read, then page 3 of file system 2 is selected, the reading of page 3 of file system 2 ends, and the entire file system is successfully read.

[0100] If page 3 of file system 3 is successfully read after passing the first verification, but page 3 of file system 2 is not successfully read, then page 3 of file system 3 is selected and the reading of page 3 of file system 3 ends.

[0101] If page 3 of file system 2 and page 3 of file system 3 are not successfully read, a second boot is triggered.

[0102] During the second boot, the system operates in working mode 2, where the primary file system consists of file system 2 and file system 3, and the secondary file system is file system 1. The system then reads the file systems as follows:

[0103] (1) Read page 1 of the file system from the storage layer.

[0104] According to working mode 2, read page 1 of file system 2 and page 1 of file system 3. If the read page 1 of file system 2 and page 1 of file system 3 are the same, then stop reading page 1 of file system and start reading page 2 of file system.

[0105] If page 1 of file system 2 and page 1 of file system 3 are different, then enter working mode 3 and read page 1 of file system 1.

[0106] If page 1 of file system 1 is successfully read, and page 1 of file system 1 is the same as page 1 of file system 2, then page 1 of file system 3 is restored using page 1 of file system 1 and page 1 of file system 2, and the reading of page 1 of file system 3 ends.

[0107] If page 1 of file system 1 is successfully read, and page 1 of file system 1 is the same as page 1 of file system 3, then page 1 of file system 2 is restored using page 1 of file system 1 and page 1 of file system 3, and the reading of page 1 of file system 2 ends; if page 1 of file system 1 is not successfully read, then page 1 of file system 2 or page 1 of file system 3 is selected, and the reading of page 1 of file system 2 ends.

[0108] If page 1 of file system 2 is successfully read, but page 1 of file system 3 is not successfully read, select page 1 of file system 2 and end the reading of page 1 of file system 2.

[0109] If page 1 of file system 3 is successfully read, but page 1 of file system 3 is not successfully read, select page 1 of file system 3 and end the reading of page 1 of file system 3;

[0110] If page 1 of file system 2 and page 1 of file system 3 are not successfully read, then read page 1 of file system 1. If page 1 of file system 1 is successfully read, return to page 1 of file system 1. If page 1 of file system 1 is not successfully read, end the second boot.

[0111] (2) Read page 2 of the file system from the storage layer.

[0112] According to working mode 2, read page 2 of file system 2 and page 2 of file system 3. If the page 2 of file system 2 and page 2 of file system 3 are the same, then stop reading page 2 of file system and start reading page 3 of file system.

[0113] If page 2 of file system 2 and page 2 of file system 3 are different, then enter working mode 3 and read page 2 of file system 1.

[0114] If page 2 of file system 1 is successfully read, and page 2 of file system 1 is the same as page 2 of file system 2, then page 2 of file system 3 is restored using page 2 of file system 1 and page 2 of file system 2, and the reading of page 2 of file system 3 ends.

[0115] If page 2 of file system 1 is successfully read, and page 2 of file system 1 is the same as page 2 of file system 3, then page 2 of file system 2 is restored using page 2 of file system 1 and page 2 of file system 3, and the reading of page 2 of file system 2 ends; if page 2 of file system 1 is not successfully read, then page 2 of file system 2 or page 2 of file system 3 is selected, and the reading of page 2 of file system 2 ends.

[0116] If page 2 of file system 2 is successfully read, but page 2 of file system 3 is not successfully read, select page 2 of file system 2 and end the reading of page 2 of file system 2;

[0117] If page 2 of file system 3 is successfully read, but page 2 of file system 3 is not successfully read, select page 2 of file system 3 and end the reading of page 2 of file system 3;

[0118] If page 2 of file system 2 and page 2 of file system 3 are not successfully read, then page 2 of file system 1 is read. If page 2 of file system 1 is successfully read, then page 2 of file system 1 is returned. If page 2 of file system 1 is not successfully read, then the second boot process ends.

[0119] (3) Read page 3 of the file system from the storage layer.

[0120] According to working mode 2, read page 3 of file system 2 and page 3 of file system 3. If the page 3 of file system 2 and page 3 of file system 3 are the same, then stop reading page 3 of file system and successfully read the file system.

[0121] If page 3 of file system 2 and page 3 of file system 3 are different, then enter working mode 3 and read page 3 of file system 1.

[0122] If page 3 of file system 1 is successfully read, and page 3 of file system 1 is the same as page 3 of file system 2, then page 3 of file system 3 is restored using page 3 of file system 1 and page 3 of file system 2, and the reading of page 3 of file system 3 ends.

[0123] If page 3 of file system 1 is successfully read, and page 3 of file system 1 is the same as page 3 of file system 3, then page 3 of file system 2 is restored using page 3 of file system 1 and page 3 of file system 3, and the reading of page 3 of file system 2 ends; if page 3 of file system 1 is not successfully read, then page 3 of file system 2 or page 3 of file system 3 is selected, and the reading of page 3 of file system 2 ends.

[0124] If page 3 of file system 2 is successfully read, but page 3 of file system 3 is not successfully read, select page 3 of file system 2 and end the reading of page 3 of file system 2.

[0125] If page 3 of file system 3 is successfully read, but page 3 of file system 3 is not successfully read, select page 3 of file system 3 and end the reading of page 3 of file system 3.

[0126] If page 3 of file system 2 and page 3 of file system 3 are not successfully read, then page 3 of file system 1 is read. If page 3 of file system 1 is successfully read, then page 3 of file system 1 is returned. If page 3 of file system 1 is not successfully read, then the second boot process ends.

[0127] During the third boot, the system reads the file systems according to working mode 1, where the primary file system is file system 2, and the secondary file systems are file system 1 and file system 3.

[0128] (1) Read page 1 of the file system from the storage layer.

[0129] According to working mode 1, read page 1 of file system 2. If page 1 of file system 2 is successfully read and passes the first verification, then stop reading page 1 of file system and start reading page 2 of file system.

[0130] If page 1 of file system 2 fails to read after the first verification, then enter working mode 3 to read page 1 of both file system 1 and file system 3.

[0131] If page 1 of file system 1 and page 1 of file system 3 are successfully read, and the contents of page 1 of file system 1 and page 1 of file system 3 are the same, page 1 of file system 2 is restored through a voting mechanism.

[0132] If page 1 of file system 1 and page 1 of file system 3 are successfully read through the first verification, and the contents of page 1 of file system 1 and page 1 of file system 3 are different, select page 1 of file system 1 or page 1 of file system 3 and end reading page 1 of file system 1.

[0133] If page 1 of file system 1 is successfully read and passes the first verification, but page 1 of file system 3 is not successfully read, then page 1 of file system 1 is selected and the reading of page 1 of file system 3 ends.

[0134] If page 1 of file system 3 is successfully read after passing the first verification, but page 1 of file system 3 is not successfully read, then page 1 of file system 3 is selected and the reading of page 1 of file system 3 ends.

[0135] If page 1 of file system 1 and page 1 of file system 3 are not successfully read, a fourth boot is triggered.

[0136] (2) Read page 2 of the file system from the storage layer.

[0137] According to working mode 1, read page 2 of file system 2. If page 2 of file system 2 is successfully read and passes the first verification, then stop reading page 2 of file system 2 and start reading page 3 of file system 2.

[0138] If page 2 of file system 2 fails to read after the first verification, then enter working mode 3 to read page 2 of file system 1.

[0139] If page 2 of file system 1 and page 2 of file system 3 are successfully read, and the contents of page 2 of file system 1 and page 2 of file system 3 are the same, page 2 of file system 2 is restored through a voting mechanism.

[0140] If the first verification of page 2 of file system 1 and page 2 of file system 3 is successfully read, and the contents of page 2 of file system 1 and page 2 of file system 3 are different, select page 2 of file system 1 or page 2 of file system 3 and end reading page 2 of file system 1.

[0141] If page 2 of file system 1 is successfully read after passing the first verification, but page 2 of file system 3 is not successfully read, then page 2 of file system 1 is selected and the reading of page 2 of file system 3 ends.

[0142] If page 2 of file system 3 is successfully read after passing the first verification, but page 2 of file system 1 is not successfully read, then page 2 of file system 3 is selected and the reading of page 2 of file system 3 is ended.

[0143] If page 2 of file system 1 and page 2 of file system 3 are not successfully read, a fourth boot is triggered.

[0144] (3) Read page 3 of the file system from the storage layer.

[0145] According to working mode 1, read page 3 of file system 2. If page 3 of file system 2 is successfully read and passes the first verification, then stop reading page 3 of file system and successfully read the entire file system.

[0146] If page 3 of file system 2 fails to read after the first verification, then enter working mode 3 to read page 3 of file system 1 and page 3 of file system 3.

[0147] If page 3 of file system 1 and page 3 of file system 3 are successfully read, and the contents of page 3 of file system 1 and page 3 of file system 3 are the same, page 3 of file system 2 is restored through a voting mechanism.

[0148] If the first verification of page 3 of file system 1 and page 3 of file system 3 is successfully read, and the contents of page 3 of file system 1 and page 3 of file system 3 are different, select page 3 of file system 1 or page 3 of file system 3, end the reading of page 3 of file system 1, and successfully read the entire file system.

[0149] If page 3 of file system 1 is successfully read after passing the first verification, but page 3 of file system 3 is not successfully read, then page 3 of file system 1 is selected, the reading of page 3 of file system 1 ends, and the entire file system is successfully read.

[0150] If page 3 of file system 3 is successfully read after passing the first verification, but page 3 of file system 1 is not successfully read, then page 3 of file system 3 is selected, the reading of page 3 of file system 3 ends, and the entire file system is successfully read.

[0151] If page 3 of file system 1 and page 3 of file system 3 are not successfully read, a fourth boot is triggered.

[0152] During the fourth boot, the system operates in working mode 1, where the primary file system is file system 3, and the secondary file systems are file system 1 and file system 2.

[0153] (1) Read page 1 of the file system from the storage layer.

[0154] According to working mode 1, read page 1 of file system 3. If page 1 of file system 3 is successfully read and passes the first verification, then stop reading page 1 of file system and start reading page 2 of file system.

[0155] If page 1 of file system 3 fails to read after the first verification, then enter working mode 3 to read page 1 of file system 1 and page 1 of file system 2.

[0156] If page 1 of file system 1 and page 1 of file system 2 are successfully read, and the contents of page 1 of file system 1 and page 1 of file system 2 are the same, page 1 of file system 3 is restored through a voting mechanism.

[0157] If page 1 of file system 1 and page 1 of file system 2 are successfully read through the first verification, and the contents of page 1 of file system 1 and page 1 of file system 2 are different, then select page 1 of file system 1 or page 1 of file system 2 and end reading page 1 of file system 1.

[0158] If page 1 of file system 1 is successfully read after passing the first verification, but page 1 of file system 2 is not successfully read, then page 1 of file system 1 is selected and the reading of page 1 of file system 2 ends.

[0159] If page 1 of file system 2 is successfully read after passing the first verification, but page 1 of file system 2 is not successfully read, then page 1 of file system 2 is selected and the reading of page 1 of file system 2 ends.

[0160] If page 1 of file system 1 and page 1 of file system 2 are not successfully read, the file system read is considered to have failed.

[0161] (2) Read page 2 of the file system from the storage layer.

[0162] According to working mode 1, read page 2 of file system 3. If page 2 of file system 3 is successfully read and passes the first verification, then stop reading page 2 of file system and start reading page 2 of file system.

[0163] If page 2 of file system 3 fails to read after the first verification, then enter working mode 3 to read page 2 of file system 1 and page 2 of file system 2.

[0164] If page 2 of file system 1 and page 2 of file system 2 are successfully read, and the contents of page 2 of file system 1 and page 2 of file system 2 are the same, page 2 of file system 3 is restored through a voting mechanism.

[0165] If the first verification of page 2 of file system 1 and page 2 of file system 2 is successfully read, and the contents of page 2 of file system 1 and page 2 of file system 2 are different, select page 2 of file system 1 or page 2 of file system 2 and end reading page 2 of file system 1.

[0166] If page 2 of file system 1 is successfully read after passing the first verification, but page 2 of file system 2 is not successfully read, then page 2 of file system 1 is selected and the reading of page 2 of file system 1 ends.

[0167] If page 2 of file system 2 is successfully read after passing the first verification, but page 2 of file system 1 is not successfully read, then page 2 of file system 2 is selected and the reading of page 2 of file system 2 is ended.

[0168] If page 2 of file system 1 and page 2 of file system 2 are not successfully read, the file system read is considered to have failed.

[0169] (3) Read page 3 of the file system from the storage layer.

[0170] According to working mode 1, read page 3 of file system 3. If page 3 of file system 3 that has passed the first verification is successfully read, then stop reading page 3 of file system and successfully read file system.

[0171] If page 3 of file system 3 fails to read after the first verification, then enter working mode 3 to read page 3 of file system 1 and page 3 of file system 2.

[0172] If page 3 of file system 1 and page 3 of file system 2 are successfully read, and the contents of page 3 of file system 1 and page 3 of file system 2 are the same, page 3 of file system 3 is restored through a voting mechanism.

[0173] If page 3 of file system 1 and page 3 of file system 2 are successfully read through the first verification, and the contents of page 3 of file system 1 and page 3 of file system 2 are different, then select page 3 of file system 1 or page 3 of file system 2 and end reading page 3 of file system 1.

[0174] If page 3 of file system 1 is successfully read after passing the first verification, but page 3 of file system 2 is not successfully read, then page 3 of file system 1 is selected and the reading of page 3 of file system 2 ends.

[0175] If page 3 of file system 2 is successfully read after passing the first verification, but page 3 of file system 1 is not successfully read, then page 3 of file system 2 is selected and the reading of page 3 of file system 2 is ended.

[0176] If page 3 of file system 1 and page 3 of file system 2 are not successfully read, the file system read is considered to have failed.

[0177] The startup module 212 of the application layer 210 is used to perform a second verification on the file system, and if the file system verification passes, to start the operating system using the file system.

[0178] The second check can calculate the hash value of the file system and compare it with a known correct hash value to verify whether the file content has been tampered with or corrupted. For example, the second check can be MD5, SHA-1, SHA-256, etc.

[0179] The application layer performs a second check on the file system. If the second check passes, it means that the file system read is correct and can be used to boot the operating system. If the second check fails and the number of boot attempts is less than 4, the next boot attempt can be performed.

[0180] It's understandable that the above explanation uses the example of rereading from page 1 on each startup. However, in practical applications, if a portion of the pages has already been successfully read on the first startup, then on the next startup, the previously read pages don't need to be read repeatedly; instead, only the unread pages can be read. For example, if page 1 has already been read on the first startup, then on the second startup, reading can start from page 2.

[0181] In the above scheme, since the operating system needs to boot quickly, and the processor can only read the file system from multiple non-volatile memories sequentially, which is very time-consuming, the first boot can prioritize using a working mode that reads fewer file systems to effectively improve the boot speed. However, if the first boot fails, it indicates severe interference and file system corruption. In this case, a working mode that reads more file systems, such as working mode 2 or working mode 3, can be prioritized to improve the accuracy of file system reading. If the second boot also fails, it can still be attempted to boot in working mode 1 on the third and fourth attempts, but the main file system in working mode 1 will be different.

[0182] The above scheme performs verification at multiple levels. For example, at the storage layer, verification can be performed through a first verification; at the file system layer, multiple file systems can be compared and verified against each other; and at the application layer, the file system can be verified through a second verification. Through these multiple verification methods, the accuracy of the file system can be effectively improved.

[0183] In the above scheme, if one of the file systems or the non-volatile memory containing that file system fails during the boot process, the file system can be isolated, and the operating mode can be set to operating mode 1. If the failed file system is the original primary file system, one of the original secondary file systems can be selected as the new primary file system. Similarly, if the read time of one of the file systems is very slow during the boot process, for example, if the read time exceeds a threshold multiple times, then that file system can also be isolated.

[0184] After the operating system boots up successfully, you can set the file system's "read" mode to working mode 3 and its "write" mode to working mode 2.

[0185] The reason for setting the file system's "read" mode to operating mode 3 is that, in environments susceptible to interference, the file system stored in non-volatile memory is prone to errors. Therefore, after the operating system successfully boots up, setting the file system's "read" mode to 3 allows for file system recovery during each read operation, preventing errors from accumulating and ultimately becoming unrecoverable. Furthermore, after the operating system boots up, the time requirement for file system reads is not high; even if multiple reads of the file system take longer, it's not a significant issue. To ensure file system recoverability, the file system can be periodically read in operating mode 3, further preventing error accumulation and potential unrecoverable file system failures.

[0186] The reason for setting the file system's "write" operation to mode 2 is that since the processor writes the file system to multiple non-volatile memories serially, it takes a relatively long time. To improve write speed, setting the "write" operation to mode 2 means that only two copies of the file system need to be written immediately during the write process; a third copy doesn't need to be written immediately. The third copy is only written to the non-volatile memory before restarting. Writing two copies ensures that the two file systems can be compared with each other. Therefore, after writing two copies, the processor can continue processing other tasks until it becomes idle, at which point it will continue writing the third copy. Furthermore, while writing the third copy, some operations can be performed in parallel, such as performing a second check on the previous two copies or writing some data from the file system to volatile memory.

[0187] Scenarios for "writing" to a file system can include updating certain data in the file system or upgrading the file system.

[0188] When updating some data in the file system, it may only involve updating a small amount of data. Therefore, the time required to update some data in the file system will not be too long. In this case, the file system "write" may not use the above working mode 2, but rather working mode 3, or it may use the above working mode 2.

[0189] Upgrading a file system often involves updating a large amount of data. Therefore, working mode 2 can be used during file system upgrades. Alternatively, working mode 3 can be used in environments with severe interference. Before upgrading, the old version of the file system has a first-version identifier; after upgrading, the new version has a second-version identifier. By setting different version identifiers for different file systems, it prevents data from being unable to be deleted. For example, if file systems 1 and 2 malfunction and can only be read but not written, neither file system 1 nor 2 will be successfully upgraded to the new version. Only file system 3 will be successfully upgraded. According to a voting mechanism, if file systems 1 and 2 are identical, and file system 3 is different from both, then file systems 1 and 2 will be considered correct, and file system 3 will be incorrect, leading to an error. By setting version identifiers, it can be confirmed that although file systems 1 and 2 are identical, they are older versions, while file system 3, although only a single copy exists, is a newer version, thus determining that file system 3 is the correct one.

[0190] If you need to create three file systems, you can mark them as "creating" and start creating them from the main file system. After all three file systems are created, mark them as "not created." Then, periodically check; if any file systems are marked as "creating," create the remaining uncreated file systems. This prevents a sudden power outage after one file system has been created, ensuring the remaining two file systems are not created.

[0191] If you need to delete three file systems, you can mark them as deleted and start deleting from the main file system. After all three file systems are deleted, mark them as not deleted. Then, periodically check; if any file systems marked as deleted still exist, delete the remaining ones. This prevents a power outage after two file systems have been deleted, ensuring one file system remains.

[0192] It is understood that the receiving module, reading module, and startup module can all be implemented in software or hardware. For example, the following section will use the reading module as an example to illustrate its implementation. Similarly, the implementation methods for the receiving module and startup module can refer to the implementation method for the reading module.

[0193] As an example of a software functional unit, a reading module may include code running on a computing instance. A computing instance may include at least one of a physical host (computing device), a virtual machine, or a container. Furthermore, the aforementioned computing instance may be one or more. For example, a reading module may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code may be distributed within the same region or in different regions. Further, the multiple hosts / virtual machines / containers used to run the code may be distributed within the same availability zone (AZ) or in different AZs, each AZ comprising one or more geographically proximate data centers. Typically, a region may include multiple AZs.

[0194] Similarly, multiple hosts / virtual machines / containers used to run this code can be distributed within the same Virtual Private Cloud (VPC) or across multiple VPCs. Typically, a VPC is set up within a region. Communication between two VPCs within the same region, as well as between VPCs in different regions, requires a communication gateway to be set up within each VPC to enable interconnection between VPCs.

[0195] As an example of a hardware functional unit, a reading module may include at least one computing device, such as a server. Alternatively, the reading module may be implemented using a central processing unit (CPU), an application-specific integrated circuit (ASIC), or a programmable logic device (PLD). The aforementioned PLD may be implemented using a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), a data processing unit (DPU), a neural network processing unit (NPU), a system-on-chip (SoC), an offload card, an accelerator card, or any combination thereof.

[0196] The multiple computing devices included in the read module can be distributed within the same region or in different regions. Similarly, the multiple computing devices included in the read module can be distributed within the same Availability Zone (AZ) or in different AZs. Likewise, the multiple computing devices included in the read module can be distributed within the same Virtual Private Cloud (VPC) or multiple VPCs. These multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, GALs, DPUs, NPUs, SoCs, offloading cards, and accelerator cards.

[0197] See Figure 3 , Figure 3 This is a flowchart illustrating an operating system boot method provided in this application. Figure 3 As shown, the operating system boot method of this application includes:

[0198] S101: The operating system boot device receives the number of times the operating system is booted as set by the user, as well as the working mode for each boot, which involves reading the file system required to boot the operating system.

[0199] The file system is stored in non-volatile memory. To ensure the accuracy of the file system, multiple identical file systems can be included, and different file systems are stored in different non-volatile memories. This way, even if a few file systems fail, recovery can be achieved using the majority of the other file systems. In a specific embodiment, the file system may include a first file system, a second file system, and a third file system, with the first file system stored in a first non-volatile memory, the second file system stored in a second non-volatile memory, and the third file system stored in a third non-volatile memory.

[0200] A file system is a collection of methods and data structures for managing and organizing files and directories on a boot device. Common file systems include FAT, NTFS, and EXT. The operating system's boot program (such as the boot loader in BIOS or UEFI) and critical files like the kernel are typically stored in the file system. Therefore, the file system contains the basic instructions and information needed to boot the operating system, and it must be able to be correctly read before the operating system can boot.

[0201] The boot count is the maximum number of times the operating system is allowed to fail to boot. The boot count can be greater than one. Booting includes the first boot and the second boot; in other embodiments, booting may also include a third boot, a fourth boot, or even more, which is not specifically limited here.

[0202] The operating modes include a first operating mode and a second operating mode. The first boot uses the first operating mode, and the second boot uses the second operating mode. The number of identical file systems that the first operating mode needs to read differs from the number of identical file systems that the second operating mode needs to read. Here, the first operating mode can be any one of the operating modes 1, 2, and 3 mentioned above. The second operating mode can be any other one of the operating modes 1, 2, and 3 mentioned above. It is understood that the operating modes can also include a third, fourth, and more, but this is not specifically limited here.

[0203] In one specific embodiment, the first operating mode may include a primary file system and a secondary file system. The primary file system is the file system that needs to be read during normal operation, and the secondary file system is an escape file system that is read when the primary file system encounters an error. For example, assuming the file system includes a first file system, a second file system, and a third file system, the primary file system in the first operating mode includes the first file system, and the secondary file system includes the second and third file systems.

[0204] In one specific embodiment, the second operating mode may include a primary file system and a secondary file system. For example, assuming the file system includes a first file system, a second file system, and a third file system, the primary file system in the second operating mode includes the first file system and the second file system, and the secondary file system includes the third file system.

[0205] The number of boot attempts and the operating mode used to read the file system required for the boot operating system at each boot can be configured as needed. For example, the number of boot attempts can be set to four, with the first boot using the first operating mode, the second boot using the second operating mode, the third boot using the first operating mode, the fourth boot using the first operating mode, and so on. No specific limitations are specified here. Optionally, the first operating mode can be operating mode 1 as described above, and the second operating mode can be operating mode 2 as described above.

[0206] S102: The operating system boot device reads the file system according to the number of boots and the working mode of reading the file system required to boot the operating system for each boot.

[0207] After determining the number of boot attempts and the operating mode for reading the file system required by the boot operating system at each boot, the file system can be read according to the boot attempts and the operating mode used at each boot. For example,

[0208] Upon initial startup, the first page of the first file system is read. If the first page of the first file system is successfully read and passes the first verification, the reading of the first page of the file system ends. If the first page of the first file system is not successfully read and passes the first verification, the first pages of the second and third file systems are read. If the first pages of the second and third file systems are successfully read and pass the first verification, and the contents of the first pages of the second and third file systems are identical, the first page of the first file system is restored based on the first pages of the second and third file systems. The first verification is used to detect and correct errors in the pages of the file system. If the first page of the second file system is successfully read and passes the first verification, the first page of the first file system is restored. If the contents of the first page of the second file system and the first page of the third file system are different, select either the first page of the second file system or the first page of the third file system, and end the reading of the first page of the file system; if the first page of the second file system that has passed the first verification is successfully read, but the first page of the third file system is not successfully read, select the first page of the second file system, and end the reading of the first page of the file system; if the first page of the third file system that has passed the first verification is successfully read, but the first page of the second file system is not successfully read, select the first page of the third file system, and end the reading of the first page of the file system; if neither the first page of the second file system nor the first page of the third file system is successfully read, trigger a second boot.

[0209] In the second boot scenario, the first page of the second file system and the first page of the third file system are read. If the first pages of the second and third file systems are successfully read, and the first pages of the first and second file systems are identical, the reading of the first page of the file system ends. If the first pages of the second and third file systems are successfully read, and the first pages of the second and third file systems are different, the first page of the first file system is read. If the first page of the first file system is successfully read, and the first page of the first and second file systems is identical, the first page of the third file system is restored using the first pages of the first and second file systems, and the reading of the first page of the file system ends. If the first page of the first file system is the same as the first page of the third file system, then the first page of the second file system is restored using the first and third file system pages, and the process of reading the first page of the file system ends. If the first page of the first file system is not successfully read, then the first page of either the second or third file system is selected, and the process of reading the first page of the file system ends. If the first page of the second file system is successfully read, but the first page of the third file system is not successfully read, then the first page of the second file system is selected, and the process of reading the first page of the file system ends. If the first page of the third file system is successfully read, but the first page of the second file system is not successfully read, then the first page of the third file system is selected, and the process of reading the first page of the file system ends.

[0210] S103: The operating system boot device uses the file system to boot the operating system.

[0211] Before booting the operating system, the boot device can perform a second check on the file system. This second check verifies the integrity and consistency of the file system. If the second check succeeds, the operating system boots; if it fails, it triggers an additional boot attempt, or the boot process fails.

[0212] After the operating system boots, if a file system is detected as being in a creation state, a second and third file system are created based on the first file system. The first file system was created before the power outage, while the second and third file systems were not successfully created before the power outage. If a file system is detected as being in a deletion state, the second and third file systems are deleted based on this process. Again, the first file system was deleted before the power outage, while the second and third file systems were not successfully deleted before the power outage.

[0213] When performing write operations on a file system, write operations on the third file system are paused after the write operations on the first and second file systems are completed.

[0214] This application also provides a computing device 300. For example... Figure 4 As shown, the computing device 300 includes a bus 302, a processor 304, a memory 306, and a communication interface 308. The processor 304, the memory 306, and the communication interface 308 communicate with each other via the bus 302. The computing device 300 can be a server or a terminal device. It should be understood that this application does not limit the number of processors and memories in the computing device 300.

[0215] Bus 302 can be a Peripheral Component Interconnect Express (PCIe) bus, an Extended Industry Standard Architecture (EISA) bus, a Unified Bus (Ubus or UB), a Compute Express Link (CXL), a Cache Coherent Interconnect for Accelerators (CCIX), etc. The Unified Bus is also known as the Lingqu Bus. Buses can be divided into address buses, data buses, control buses, etc. For ease of representation, Figure 4 The bus 104 is represented by a single line, but this does not mean that there is only one bus or one type of bus. Bus 104 may include a path for transmitting information between various components of computing device 300 (e.g., memory 306, processor 304, communication interface 308). The unified bus may also be referred to as the Lingqu bus.

[0216] Processor 304 may include any one or more computing devices such as central processing unit (CPU), graphics processing unit (GPU), microprocessor (MP) or digital signal processor (DSP), ASIC, FPGA, CPLD, NPU, SoC, offload card, accelerator card, etc.

[0217] Memory 306 may include volatile memory, such as random access memory (RAM). Processor 304 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD). Furthermore, memory 306 may also be implemented using storage class memory (SCM), phase change memory (PCM), or other types of storage media.

[0218] It is worth noting that the same type of storage medium can be configured in the same computing device to realize the function of memory 306, or two or more types of storage media can be configured to realize the function of memory 306. This application does not limit this.

[0219] The memory 306 stores executable program code, which the processor 304 executes to implement the functions of the aforementioned receiving module, reading module, and boot module, thereby implementing the operating system boot method. In other words, the memory 306 stores instructions for executing the operating system boot method.

[0220] Alternatively, the memory 306 stores executable code, which the processor 304 executes to implement the functions of the aforementioned operating system boot device, thereby implementing the operating system boot method. That is, the memory 306 stores instructions for executing the operating system boot method.

[0221] The communication interface 308 uses transceiver modules, such as, but not limited to, network interface cards and transceivers, to enable communication between the computing device 300 and other devices or communication networks.

[0222] As one possible implementation, the computing device 300 may also include a chip system, which includes a processor and a power supply circuit. The power supply circuit supplies power to the processor, and the processor executes the operation steps corresponding to the operating system startup method. For simplicity, further details are omitted here. The processor can be implemented using a GPU, or it can be implemented using computing devices or AI chips such as a DPU, NPU, XPU, SoC, offloading card, or accelerator card.

[0223] As one possible implementation, the computing device 300 may include multiple types of processors 304, meaning the computing device 300 is a heterogeneous device. For example, the computing device 300 may include a CPU and a GPU, and at least one of the processors 304 may execute the operation steps corresponding to the operating system boot method. For the sake of brevity, further details will not be elaborated here.

[0224] This application also provides a computing device cluster. The computing device cluster includes at least one computing device. The computing device can be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device can also be a terminal device such as a desktop computer, a laptop computer, or a smartphone.

[0225] like Figure 5 As shown, the computing device cluster includes at least one computing device 300. The memory 306 of one or more computing devices 300 in the computing device cluster may store the same instructions for executing the operating system startup method.

[0226] In some possible implementations, the memory 306 of one or more computing devices 300 in the computing device cluster may also store partial instructions for executing the operating system boot method. In other words, a combination of one or more computing devices 300 can jointly execute the instructions for executing the operating system boot method.

[0227] It should be noted that the memory 306 in different computing devices 300 within the computing device cluster can store different instructions, each used to execute a portion of the functions of the operating system boot device. That is, the instructions stored in the memory 306 of different computing devices 300 can implement the functions of one or more modules among the read module, receive module, and boot module.

[0228] In some possible implementations, one or more computing devices in a computing device cluster can be connected via a network. This network can be a wide area network (WAN) or a local area network (LAN), etc. Figure 6 One possible implementation is shown. For example... Figure 6 As shown, two computing devices 300A and 300B are connected via a network. Specifically, they are connected to the network through communication interfaces in each computing device. In this possible implementation, the memory 306 in computing device 300A stores instructions for executing the read module's functions. Simultaneously, the memory 306 in computing device 300B stores instructions for executing the receive module and the start module's functions.

[0229] Figure 6The connection method between the computing device clusters shown can be such that, considering the operating system boot method provided in this application requires a large amount of data storage, the functions implemented by the receiving module and the boot module are delegated to the computing device 300B.

[0230] It should be understood that Figure 6 The functions of the computing device 300A shown can also be performed by multiple computing devices 300. Similarly, the functions of the computing device 300B can also be performed by multiple computing devices 300.

[0231] This application also provides another computing device cluster. The connection relationships between the computing devices in this computing device cluster can be similarly referred to... Figure 5 and Figure 6 The connection method of the computing device cluster is different in that the memory 306 of one or more computing devices 300 in the computing device cluster can store the same instructions for executing the operating system boot method.

[0232] In some possible implementations, the memory 306 of one or more computing devices 300 in the computing device cluster may also store partial instructions for executing the operating system boot method. In other words, a combination of one or more computing devices 300 can jointly execute the instructions for executing the operating system boot method.

[0233] It should be noted that the memory 306 in different computing devices 300 within the computing device cluster can store different instructions for executing some functions of the operating system boot process. That is, the instructions stored in the memory 306 of different computing devices 300 can implement the functions of one or more devices in the operating system boot process.

[0234] This application also provides a computer program product containing instructions. The computer program product may be a software or program product containing instructions, capable of running on a computing device or stored on any usable medium. When the computer program product is run on at least one computing device, it causes the at least one computing device to execute an operating system startup method.

[0235] This application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that a computing device can store, or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive). The computer-readable storage medium includes instructions that instruct the computing device to execute an operating system boot method.

[0236] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the protection scope of the technical solutions of the embodiments of this application.

Claims

1. An operating system boot method, characterized in that, include: The system receives the number of times the operating system is started by the user and the working mode for each startup, which is used to read the file system required to start the operating system. The number of startups is the maximum number of times the operating system is allowed to fail to start. The number of startups is greater than 1. The startup includes a first startup and a second startup. The working mode includes a first working mode and a second working mode. The first startup uses the first working mode and the second startup uses the second working mode. The number of identical file systems that need to be read in the first working mode is different from the number of identical file systems that need to be read in the second working mode. The file system is read according to the number of boots and the working mode of reading the file system required to boot the operating system for each boot; The operating system is started using the file system.

2. The method according to claim 1, characterized in that, The file system includes a first file system, a second file system, and a third file system. The main file system in the first working mode includes the first file system. The first file system, the second file system, and the third file system all include multiple pages. Based on the number of boot attempts and the operating mode used for each boot attempt to read the file system required to boot the operating system, the file system is read, including: In the case of the first startup, the first page of the first file system is read, and if the first page of the first file system is successfully read through the first verification, the reading of the first page of the file system ends; If the first page of the first file system fails to pass the first verification, read the first page of the second file system and the first page of the third file system. If the first page of the second file system and the first page of the third file system are successfully read and pass the first verification, and the contents of the first page of the second file system and the first page of the third file system are the same, the first page of the first file system is restored based on the first page of the second file system and the first page of the third file system. The first verification is used to detect and correct the pages in the file system.

3. The method according to claim 2, characterized in that, The secondary file system in the first working mode includes the second file system and the third file system. If the first page of the second file system and the first page of the third file system are successfully read through the first verification, and the contents of the first page of the second file system and the first page of the third file system are different, select the first page of the second file system or the first page of the third file system, and end the reading of the first page of the file system; If the first page of the second file system that has passed the first verification is successfully read, but the first page of the third file system is not successfully read, select the first page of the second file system and end the reading of the first page of the file system; If the first page of the third file system that has passed the first verification is successfully read, but the first page of the second file system is not successfully read, select the first page of the third file system and end the reading of the first page of the file system; If the first page of the second file system and the first page of the third file system are not successfully read, a second startup is triggered.

4. The method according to claim 1, characterized in that, The file system includes a first file system, a second file system, and a third file system. The main file system in the second working mode includes the second file system and the third file system. Based on the number of boot attempts and the operating mode used for each boot attempt to read the file system required to boot the operating system, the file system is read, including: In the case of the second startup, the first page of the second file system and the first page of the third file system are read. If the first page of the second file system and the first page of the third file system are successfully read, and the first page of the first file system and the first page of the second file system are the same, the reading of the first page of the file system ends. If the first page of the second file system and the first page of the third file system are successfully read, and the first pages of the second file system and the third file system are different, then read the first page of the first file system. If the first page of the first file system is successfully read, and the first page of the first file system is the same as the first page of the second file system, then restore the first page of the third file system using the first page of the first file system and the first page of the second file system, and end the reading of the first page of the file system. If the first page of the first file system is successfully read, and the first page of the first file system is the same as the first page of the third file system, then restore the first page of the second file system using the first page of the first file system and end the reading of the first page of the file system. If the first page of the first file system is not successfully read, then select the first page of the second file system or the first page of the third file system, and end the reading of the first page of the file system. If the first page of the second file system is successfully read, but the first page of the third file system is not successfully read, select the first page of the second file system and end the reading of the first page of the file system; If the first page of the third file system is successfully read, but the first page of the second file system is not successfully read, select the first page of the third file system and end the reading of the first page of the file system.

5. The method according to claim 4, characterized in that, The secondary file system in the second working mode includes the first file system. If the first page of the second file system and the first page of the third file system are not successfully read, the first page of the first file system is read. If the first page of the first file system is successfully read, the first page of the first file system is returned. If the first page of the first file system is not successfully read, the second startup ends.

6. The method according to any one of claims 2 to 5, characterized in that, Before reading the file system according to the number of boots and the working mode of reading the file system required to boot the operating system for each boot, the method further includes: If the file system is detected to be in a creation state, a second file system and a third file system are created based on the first file system, wherein the first file system is a file system that was created before the power failure, and the second file system and the third file system are file systems that were not successfully created before the power failure.

7. The method according to any one of claims 2 to 5, characterized in that, The method further includes: If the file system is detected to be marked as deleted, the second file system and the third file system are deleted, wherein the first file system is a file system that was deleted before the power failure, and the second file system and the third file system are file systems that were not successfully deleted before the power failure.

8. The method according to any one of claims 1 to 7, characterized in that, Before booting the operating system using the file system, the method further includes: A second verification is performed on the file system, wherein the second verification is used to verify the integrity and consistency of the file system.

9. The method according to any one of claims 1 to 7, characterized in that, After booting the operating system using the file system, the method further includes: When performing a write operation on the file system, after completing the write operations on the first file system and the second file system, the write operation on the third file system is paused.

10. An operating system boot device, characterized in that, include: The module consists of a receiving module, a reading module, and a startup module. The receiving module is used to receive the number of times the operating system is started by the user and the working mode of reading the file system required to start the operating system for each start. The number of starts is the maximum number of times the operating system is allowed to fail to start. The number of starts is greater than 1. The start includes a first start and a second start. The working mode includes a first working mode and a second working mode. The first start uses the first working mode and the second start uses the second working mode. The number of the same file system that needs to be read in the first working mode is different from the number of the same file system that needs to be read in the second working mode. The reading module is used to read the file system according to the number of startups and the working mode of the file system required to start the operating system for each startup; The startup module is used to start the operating system using the file system.

11. A computing device, characterized in that, The computing device includes a processor and memory; The processor is configured to execute instructions stored in the memory to cause the computing device to perform the operational steps of the method as described in any one of claims 1 to 9.

12. A computing device cluster, characterized in that, It includes multiple computing devices, each of which includes a processor and memory; A processor of at least one computing device is configured to execute instructions stored in the memory of the at least one computing device to cause the cluster of computing devices to perform the operational steps of the method as described in any one of claims 1 to 9.

13. A computer program product containing instructions, characterized in that, When the instruction is executed by the computing device cluster, the computing device cluster causes the computing device cluster to perform the operation steps of the method as described in any one of claims 1 to 9.

14. A computer-readable storage medium, characterized in that, It includes computer program instructions, which, when executed by a cluster of computing devices, perform the operational steps of the method as described in any one of claims 1 to 8.