Terminal operating system switching method, device, equipment, medium and product

By centrally storing operating system images on a cloud platform and utilizing the collaborative work of the management processor and the trusted agent, efficient and secure multi-operating system switching on the terminal physical hardware is achieved. This solves the problems of low switching efficiency and insufficient security in existing technologies, and enables uninterrupted operating system switching and image integrity assurance.

CN123177983APending Publication Date: 2026-11-27CHINA MOBILEHANGZHOUINFORMATION TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611271726.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-20
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

Existing technologies make it difficult to easily and efficiently run and switch between multiple operating systems on the physical hardware of the terminal. Remote virtual container solutions rely on network connections and the computing tasks are completed in the cloud, making it impossible to run on a real device. Local privacy space solutions cannot change the underlying operating system type.

Method used

By centrally storing multiple operating system images on the image management server of the cloud platform, the terminal pulls the target image to an independent cache partition as needed, and the management processor overwrites it to the root partition through a trusted agent, realizing the switching of operating system with one download, one overwrite, and restart. The management processor and application processor are physically isolated to prevent interference from malware.

Benefits of technology

It significantly reduces terminal storage usage and network dependence, improves the efficiency and security of operating system switching, enables zero-interruption downloads and seamless business parallel processing for users, and ensures the integrity and reliability of the image.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123177983A_ABST
    Figure CN123177983A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of mobile terminals, and provides a terminal operating system switching method, device, equipment, medium and product. The method is applied to an image management server of a cloud platform, the image management server comprises a management processor, and the method comprises the following steps: receiving, by the management processor, an operating system switching request sent by a terminal; sending, by the management processor, target operating system image information to the terminal; in the case that it is determined that the target operating system image is successfully written into a cache partition of the terminal, performing, by the management processor, an overwriting operation on a root partition of the terminal via a trusted agent of the terminal; and triggering, by the management processor, the terminal to start the target operating system. The terminal operating system switching method, device, equipment, medium and product provided by the application can support the terminal to pull a target operating system image from the cloud on demand and dynamically overwrite a root partition, so that simple and efficient switching of multiple operating systems on the physical hardware of the terminal is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of mobile terminal technology, and in particular to a method, apparatus, device, medium and product for switching terminal operating systems. Background Technology

[0002] Currently, the main solutions for implementing multiple operating systems on a terminal include remote virtual container solutions and local privacy space solutions. The remote virtual container solution creates multiple virtualized instances on a remote server using cloud computing infrastructure. Each instance runs a specific operating system independently, and the terminal only acts as a client, receiving interface rendering data and uploading input events via remote desktop protocols. This solution is highly dependent on network connectivity, and all computational tasks are completed in the cloud, leaving local hardware resources idle; it does not run the target operating system on the actual terminal device. The local privacy space solution, on the other hand, uses isolation technology to build logically independent running environments based on the same operating system kernel. Each running environment shares the same operating system kernel, making it impossible to change the underlying operating system type, and therefore does not represent true multi-operating system switching.

[0003] Therefore, how to simply and efficiently implement the operation and switching of multiple operating systems on the physical hardware of the terminal is a problem that needs to be solved. Summary of the Invention

[0004] This application provides a terminal operating system switching method, apparatus, device, medium, and product, which at least improves the problem of how to simply and efficiently implement the operation and switching of multiple operating systems on the physical hardware of a terminal.

[0005] In a first aspect, embodiments of this application provide a terminal operating system switching method, applied to an image management server of a cloud platform, the image management server including a management processor; the method includes: The management processor receives operating system switching requests sent by the terminal. These requests are used to request a switch to the target operating system. The target operating system image information is sent to the terminal through the management processor. The target operating system image information is used by the terminal to obtain the target operating system image. If it is determined that the target operating system image has been successfully written to the terminal's cache partition, the management processor performs an overwrite operation on the terminal's root partition via the terminal's trusted agent. The cache partition is independent of the root partition, which stores the terminal's current operating system image. The trusted agent is used to support control over the cache partition and the root partition. The overwrite operation is used to overwrite the current operating system image in the root partition based on the target operating system image in the cache partition. The target operating system is launched by triggering the terminal through the management processor.

[0006] Based on this, multiple operating system images can be centrally stored on the cloud platform. The terminal only needs to set a single root partition. When the operating system needs to be switched, the target operating system image is pulled from the cloud on demand, temporarily stored in an independent cache partition, and then the management processor overwrites the target operating system image to the root partition through a trusted agent. This enables the ability to switch between multiple operating systems on a real device with one download, one overwrite, and a reboot, significantly reducing the terminal's storage usage and network dependence, and improving the efficiency and security of operating system switching.

[0007] Furthermore, the aforementioned management processor is physically isolated from the terminal's application processor. Based on this, critical operations such as image verification and root partition overwriting can be controlled and executed by a management processor independent of the terminal's upper-layer software environment. This isolates the management processor from user services running on the application processor, preventing interference or tampering of the switching process by malware running on the application processor and improving the security and reliability of operating system switching.

[0008] In one embodiment, during the process of writing the target operating system image to the cache partition, and during the process of determining whether the target operating system image has been successfully written to the cache partition, the terminal continues to run the services of the current operating system. Based on this, the image download and verification process can be completely parallelized with the terminal's services, achieving a zero-interruption download effect. This is imperceptible to the user and avoids the problem of prolonged service interruption caused by the need for the user to manually enter recovery mode or the boot menu in traditional solutions.

[0009] In one embodiment, the target operating system image information includes at least one of the following: the download address of the target operating system image, the image size, the hash value, and the digital signature.

[0010] Based on this, an acquisition path and verification benchmark can be provided for terminals to obtain target operating system images, ensuring that the image source obtained by the terminal is trustworthy and the content is complete, thereby improving the security and reliability of image transmission.

[0011] In one embodiment, determining that the target operating system image has been successfully written to the terminal's cache partition includes: reading the written image data in the cache partition through the management processor, determining the hash value of the written image data, and verifying the digital signature of the written image data; if the hash value of the written image data is consistent with the hash value of the target operating system image, and the digital signature of the written image data is verified, then determining that the target operating system image has been successfully written to the cache partition.

[0012] Based on this, the management processor can directly read the cache partition data for dual verification of hash comparison and signature verification, preventing incomplete or tampered images from being written to the root partition and ensuring the security of overwrite operations.

[0013] In one embodiment, the method further includes: if the hash value of the written image data is inconsistent with the hash value of the target operating system image, and / or the digital signature verification of the written image data fails, clearing the written image data in the cache partition and re-triggering the writing of the target operating system image to the cache partition.

[0014] Based on this, the cache can be automatically cleared and the image can be re-downloaded when verification fails, without user intervention. This ensures that the image finally written to the root partition is a complete and reliable image, improving the fault tolerance and automation of the switching process.

[0015] In one embodiment, when it is determined that the target operating system image has been successfully written to the cache partition of the terminal, the method further includes: setting a handover flag corresponding to the target operating system in the terminal through the management processor; and performing an overwrite operation on the root partition of the terminal through the trusted agent of the terminal via the management processor, including: in response to a handover confirmation instruction sent by the terminal, performing an overwrite operation on the root partition through the trusted agent via the management processor.

[0016] Based on this, the terminal can be marked as ready to switch by a switch flag, and the right to trigger the overwrite operation can be handed over to the user for confirmation, thus avoiding overwriting the root partition without the user's confirmation and improving the controllability of the switching process.

[0017] In one embodiment, performing an overwrite operation on the root partition via a trusted agent through a management processor includes: sending an interrupt indication to the application processor of the terminal via the management processor, the interrupt indication being used to instruct the application processor to perform at least one of the following: stopping the services running in the current operating system, synchronizing the file system, and unmounting other partitions except the root partition; taking over the storage controller of the terminal via the trusted agent through the management processor and cutting off the application processor's write access permissions to the physical storage area where the root partition is located; and writing the target operating system image in the cache partition to the root partition through the management processor.

[0018] Based on this, terminal services can be stopped in an orderly manner through interruption instructions to ensure data consistency before overwriting. Furthermore, by taking over the storage controller and cutting off the application processor's write access permissions, the overwriting process can be isolated from the upper-layer software environment, so that even if there is malicious software on the application processor side, it cannot interfere with or tamper with the overwriting process.

[0019] In one embodiment, the method further includes: in the event of a power outage or abnormality during the writing of the target operating system image to the root partition, performing a rollback on the root partition through the write protection logic of the management processor.

[0020] Based on this, the system can roll back to a safe state in the event of a power outage or abnormality during the overwrite process, preventing the terminal from failing to boot due to the root partition being in an incomplete intermediate state, thus improving the reliability of the overwrite operation.

[0021] In one embodiment, the method further includes: upon completion of the process of writing the target operating system image to the root partition, performing at least one of the following by the management processor: verifying the integrity of the target operating system image in the root partition; clearing the switch-out flag; and releasing control of the storage controller.

[0022] Based on this, integrity verification can be performed after the overwrite is completed, and the terminal's storage access status can be restored to ensure that the terminal can boot normally based on the complete target operating system image.

[0023] In one embodiment, the image management server stores multiple operating system image files; the method further includes: receiving an access request sent by a terminal through a management processor; sending a list of image files to the terminal through the management processor, the list of image files including at least one of the following: image name, image version, image size, and applicable hardware platform of the candidate operating system image files; the candidate operating system image files are the operating system image files that match the terminal among the multiple operating system image files.

[0024] Based on this, the cloud platform can uniformly maintain multiple operating system image files and provide the terminal with a list of candidate images that match its hardware platform, making it convenient for users to select the target operating system as needed and avoiding invalid transmission and resource waste caused by downloading images that are incompatible with the terminal.

[0025] In one embodiment, triggering the terminal to start the target operating system via the management processor includes: sending a reset signal to the terminal's power management unit via the management processor.

[0026] Based on this, the management processor can directly trigger a terminal reset and restart after the overwrite is completed. After the terminal restarts, it can load the target operating system image in the root partition without the need for the user to perform additional boot menu selection or manual intervention, thus achieving seamless switching.

[0027] Secondly, embodiments of this application provide a terminal operating system switching method, applied to a terminal, the terminal including a trusted agent; the method includes: Send an operating system switch request to the image management server of the cloud platform. The operating system switch request is used to request a switch to the target operating system. The image management server includes a management processor. It receives the target operating system image information sent by the image management server, obtains the target operating system image based on the target operating system image information, and writes the target operating system image to the cache partition; the cache partition is independent of the root partition, which stores the current operating system image of the terminal; the trusted agent is used to support control over the cache partition and the root partition; If the target operating system image is successfully written to the cache partition, an overwrite operation is performed on the root partition under the control of the management processor through a trusted agent; the overwrite operation is used to overwrite the current operating system image in the root partition based on the target operating system image in the cache partition; Boot the target operating system based on the target operating system image in the root partition.

[0028] In one embodiment, obtaining the target operating system image based on the target operating system image information includes: establishing a secure network connection based on the download address and downloading the target operating system image in a streaming manner through the secure network connection; writing the target operating system image to a cache partition includes: writing the image data of the downloaded target operating system image to the cache partition through a trusted proxy.

[0029] Based on this, the target operating system image can be obtained through a secure network connection and streaming download, and the write operations to the storage medium are performed by a trusted agent, ensuring the security of the image transmission and writing process.

[0030] In one embodiment, the method further includes: when a switch flag corresponding to the target operating system is set in the terminal, sending a switch confirmation instruction to the image management server in response to a switch confirmation operation.

[0031] Based on this, users can confirm the switching after the terminal enters the switching state, giving users control over the timing of the overwrite.

[0032] In one embodiment, the method further includes: receiving an interrupt indication sent by a management processor via an application processor; and in response to the interrupt indication, performing at least one of the following via the application processor: stopping services running in the current operating system, synchronizing the file system, and unmounting partitions other than the root partition.

[0033] Therefore, terminal services can be stopped in an orderly manner before overwriting to ensure data consistency and avoid data damage or loss during the overwriting process.

[0034] In one embodiment, the method further includes: providing control of the storage controller to the management processor via a trusted agent, and revoking the application processor's write access permissions to the physical storage region where the root partition resides.

[0035] Based on this, a trusted agent can establish a control path for the management processor to the storage controller, while blocking write access to the root partition from the application processor side, thereby achieving hardware-level security isolation for the overwrite process.

[0036] In one embodiment, starting a target operating system based on a target operating system image in the root partition includes: receiving a reset signal sent by a management processor through a power management unit; performing a reboot in response to the reset signal; and, upon completion of the reboot, loading the target operating system image from the root partition through a bootloader to start the target operating system.

[0037] Based on this, the terminal can load the target operating system image directly from the root partition after reboot, enabling the target operating system to run completely on the terminal's physical hardware.

[0038] In one embodiment, the method further includes: clearing the target operating system image from the cache partition if the target operating system boots successfully.

[0039] Based on this, the storage space of the cache partition can be released after the switch is completed, so that the cache space can be reused when switching again, thereby improving the utilization rate of terminal storage resources.

[0040] Thirdly, embodiments of this application provide a terminal operating system switching device, comprising: The receiving module is used to receive operating system switching requests sent by the terminal. The operating system switching request is used to request switching to the target operating system. The sending module is used to send target operating system image information to the terminal, and the target operating system image information is used by the terminal to obtain the target operating system image. The processing module is used to perform an overwrite operation on the root partition of the terminal via the trusted agent of the terminal when it is determined that the target operating system image has been successfully written to the cache partition of the terminal. The cache partition is independent of the root partition, and the root partition stores the current operating system image of the terminal. The trusted agent is used to support the control of the cache partition and the root partition. The overwrite operation is used to overwrite the current operating system image in the root partition according to the target operating system image in the cache partition. The processing module is also used to trigger the terminal to start the target operating system.

[0041] Fourthly, embodiments of this application provide a terminal operating system switching device, comprising: The sending module is used to send an operating system switching request to the image management server of the cloud platform. The operating system switching request is used to request a switch to the target operating system. The image management server includes a management processor. The receiving module is used to receive the target operating system image information sent by the image management server, obtain the target operating system image based on the target operating system image information, and write the target operating system image to the cache partition; the cache partition is independent of the root partition, and the root partition stores the current operating system image of the terminal; The processing module is used to perform an overwrite operation on the root partition under the control of the management processor when the target operating system image is successfully written to the cache partition; the overwrite operation is used to overwrite the current operating system image in the root partition based on the target operating system image in the cache partition. The processing module is also used to boot the target operating system based on the target operating system image in the root partition.

[0042] Fifthly, embodiments of this application provide an electronic device, including a processor and a memory storing a computer program, wherein the processor executes the computer program to implement the steps of any of the possible terminal operating system switching methods described in the first or second aspect above.

[0043] In a sixth aspect, embodiments of this application provide a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of any of the possible terminal operating system switching methods described in the first or second aspect above.

[0044] In a seventh aspect, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the possible terminal operating system switching methods described in the first or second aspect above. Attached Figure Description

[0045] To more clearly illustrate the technical solutions in this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0046] Figure 1 This is one of the architectural diagrams of the terminal operating system switching system provided in the embodiments of this application.

[0047] Figure 2 This is the second schematic diagram of the architecture of the terminal operating system switching system provided in the embodiments of this application.

[0048] Figure 3 This is a schematic diagram of the startup process of the terminal operating system provided in the embodiments of this application.

[0049] Figure 4 This is one of the flowcharts illustrating the terminal operating system switching method provided in the embodiments of this application.

[0050] Figure 5 This is a schematic diagram of the overwriting process of the operating system image provided in the embodiments of this application.

[0051] Figure 6This is the second flowchart illustrating the terminal operating system switching method provided in this application embodiment.

[0052] Figure 7 This is one of the structural schematic diagrams of the terminal operating system switching device provided in the embodiments of this application.

[0053] Figure 8 This is the second schematic diagram of the terminal operating system switching device provided in the embodiments of this application.

[0054] Figure 9 This is a schematic diagram of the terminal structure provided in the embodiments of this application.

[0055] Figure 10 This is a schematic diagram of the server structure provided in an embodiment of this application.

[0056] Figure 11 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0057] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0058] In this application, "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent three cases: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this document indicates that the preceding and following related objects have an "or" relationship.

[0059] "At least one of the following", "at least one of the following", or similar expressions refer to any combination of these items, including any combination of single or plural items, or any combination of one or more items. For example, "at least one or more of a, b, or c" can mean: a, b, c, a and b, a and c, b and c, or a, b, and c, where each of a, b, and c can be an element itself or a set containing one or more elements.

[0060] In this application, "at least one" means one or more. "More than one" means two or more. The descriptions of "first," "second," etc., appearing in the embodiments of this application are only for illustration and to distinguish the described objects, and have no order, nor do they indicate a special limitation on the number in the embodiments of this application, and cannot constitute any limitation on the embodiments of this application.

[0061] In this application, terms such as "exemplary," "in some embodiments," and "in other embodiments" are used to indicate that something is an example, illustration, or description. Any embodiment or design described as "exemplary" in this application should not be construed as being more preferred or advantageous than other embodiments or designs. Rather, the term "exemplary" is used to present the concept in a specific manner.

[0062] In this application, the terms "of," "corresponding (relevant)," "corresponding," and "related" may sometimes be used interchangeably. It should be noted that, unless a distinction is emphasized, their intended meanings are consistent. Similarly, in the embodiments of this application, "communication" and "transmission" may sometimes be used interchangeably. It should be noted that, unless a distinction is emphasized, their intended meanings are consistent. For example, transmission can include sending and / or receiving, and can be a noun or a verb.

[0063] To enable simple and efficient operation and switching of multiple operating systems on terminal physical hardware, this application provides a terminal operating system switching method. Multiple operating system images are centrally stored on an image management server of a cloud platform. When the terminal needs to switch operating systems, it pulls the target operating system image from the cloud as needed, temporarily stores it in a local independent cache partition, and the management processor of the image management server overwrites the target operating system image in the cache partition to the root partition through the trusted agent of the terminal. After the overwriting is completed, the terminal restarts to run the target operating system.

[0064] The terminal in this application embodiment can also be referred to as a terminal device or mobile terminal, and can be a mobile phone, tablet computer, wearable device, vehicle-mounted device, robot (such as a unibody intelligent robot or home service robot), handheld device with wireless communication function, computing device or other processing device, etc. This application embodiment is not limited in this respect.

[0065] The image management server in this application embodiment is a server-side device deployed on a cloud platform, which can be a single physical server, a server cluster consisting of multiple physical servers, etc. This application embodiment does not limit this.

[0066] Figure 1 This is one of the architectural diagrams of the terminal operating system switching system provided in the embodiments of this application. For example... Figure 1 As shown, the system includes a mirror management server and at least one terminal.

[0067] The image management server stores system image 1, system image 2, system image 3 through system image n, where n is a positive integer greater than 1, meaning the image management server stores multiple operating system image files. The image management server also includes an MCPU, which can perform management operations such as querying, maintaining, and reading system image 1 through system image n. Each terminal includes a trusted proxy, system selection, and a cache partition. The system selection is the system selection client described below. For example, a terminal can send a request to the image management server. The MCPU of the image management server receives and parses the request, then returns information to the terminal, such as a list of image files and target operating system image information, and sends data to the terminal, such as the image data of the target operating system image.

[0068] The image management server is deployed on a cloud platform and stores multiple complete, platform-independent operating system image files (such as boot.img, system.img, etc.). Figure 1 The system images shown are 1 to n, and services such as image list query, image version maintenance, image storage address saving and updating, integrity hash value provision, and digital signature provision are provided. The image management server includes a management CPU (MCPU).

[0069] In one embodiment, the management processor is a low-power, high-reliability processing unit that is physically isolated from the application processor of the terminal.

[0070] As an example, the physical isolation between the management processor and the application processor can be understood as follows: the management processor is deployed on the image management server of the cloud platform, while the application processor is deployed on the terminal. They belong to different physical devices and do not share a runtime environment or storage space. The management processor communicates with the terminal via a secure network channel, thereby managing critical operations such as image verification and overwrite control performed by the management processor, which are physically isolated from the user services running on the application processor. In this way, even if malware exists on the application processor side, it cannot interfere with or tamper with the operating system switching process controlled by the management processor, thus improving the security and reliability of operating system switching.

[0071] The terminal includes an application processor, a trusted agent, a storage controller, storage media, and a power management unit. The application processor runs the current operating system and a system selection client. The storage media includes at least a root partition, a cache partition, and a data partition.

[0072] The system selection client is primarily used to select a new operating system image during system switchovers and updates, display a list of image files, and respond to user selections by sending an operating system switchover request to the image management server. It should be noted that the system selection client does not directly perform any image write operations to the storage media. The system selection client's lack of participation in image write operations can be understood as follows: the system selection client does not have write access permissions to the physical storage area where the root partition resides. For example, during the process of writing the target operating system image to the cache partition, the image data received by the system selection client is written to the cache partition via a trusted agent; that is, the write operation to the storage media is completed by the trusted agent under hardware access control.

[0073] A trusted agent is a trusted module deployed on the endpoint for hardware access control, supporting control over cache partitions and the root partition. Connected to the storage controller, the trusted agent provides the management processor with a control path to the storage controller. In other words, the management processor communicates with the trusted agent via a secure network channel and, through the trusted agent, gains control over the storage controller and power management unit, enabling it to perform read, write, and access control operations on the cache and root partitions.

[0074] As an example, a trusted agent can be implemented as a trusted execution environment, firmware module, or hardware access control unit independent of the current operating system environment, without restriction.

[0075] Figure 2 This is the second schematic diagram of the terminal operating system switching system provided in the embodiments of this application. For example... Figure 2 As shown, the MCPU (Management Processor) is located on the image management server of the cloud platform and communicates with the mobile terminal via a secure network channel. Figure 2 The mobile terminal comprises an AP (Application Processor), a general partition, a trusted proxy area, a storage controller, a cache (i.e., a cache partition), and a root partition. The general partition is used to run the system selection client and the current operating system services. The trusted proxy area, where the trusted proxy resides, provides hardware access control. The storage controller connects to both the cache and the root partition. In other words, information sent by the management processor reaches the mobile terminal via a secure network channel, and the hardware access control of the trusted proxy area acts on the storage controller, thereby enabling control over the cache and the root partition.

[0076] The root partition stores an image of the operating system currently running on the terminal. The cache partition is independent of the root and data partitions and is dedicated to temporarily storing new images. The cache partition is independent of the root partition, meaning they are independent storage areas within the storage medium. Writing to the cache partition does not affect the physical storage area where the root partition resides, thus not impacting the current operating system's operation.

[0077] Figure 3 This is a schematic diagram illustrating the startup process of the terminal operating system provided in an embodiment of this application. For example... Figure 3 As shown, the startup process of the terminal operating system includes: powering on the terminal, loading the Boot ROM, loading the Bootloader, initializing hardware such as RAM, loading the system image, loading and decompressing it into RAM, and starting the system.

[0078] Specifically, when the user presses the power button on the terminal, the terminal powers on. The Boot ROM (the first-level boot code embedded in the chip) inside the terminal's Application Processor (AP) begins execution from the preset reset vector, completing the most basic hardware initialization. The Boot ROM loads the second-level boot program (Bootloader) from a fixed partition of the external storage medium. The Bootloader performs more comprehensive hardware configuration, such as Random Access Memory (RAM) initialization, and is responsible for reading the operating system boot image, such as boot.img, i.e., loading the system image. The system image file boot.img may contain components such as the operating system kernel, device tree file, and RAM disk image (initramfs). The Bootloader loads the operating system kernel image into the system's agreed physical memory address, decompresses the kernel, and deploys the device tree and initramfs to the designated area, i.e., loads and decompresses them into RAM. Then, it hands control over to the kernel, enters the general kernel boot process, and completes the system startup.

[0079] The following is combined Figures 4 to 6 This application describes a terminal operating system switching method provided in its embodiments.

[0080] Figure 4 This is one of the flowcharts illustrating a terminal operating system switching method provided in an embodiment of this application. The method is applied to an image management server on a cloud platform, and the image management server includes a management processor. For example... Figure 4 As shown, the method includes the following steps 410 to 440.

[0081] Step 410: Receive the operating system switching request sent by the terminal through the management processor.

[0082] The operating system switch request is used to request a switch to the target operating system.

[0083] In one embodiment, the operating system switching request is used to request a switch to the target operating system. This can be understood as follows: the management processor determines, based on the operating system switching request, that the terminal needs to switch its current operating system to the target operating system, that is, it determines that it needs to provide the terminal with an image of the target operating system, i.e., the target operating system image.

[0084] As an example, the target operating system and the current operating system can be different types of operating systems. For instance, the current operating system is Android, and the target operating system is a real-time operating system (RTOS), meaning the target and current operating systems are different types of operating systems across architectures. Alternatively, the current operating system can be a general-purpose operating system, and the target operating system can be a gaming operating system, a security / privacy operating system, or an elderly-mode operating system, etc. The target and current operating systems can also be the same type but different versions of the same operating system. This application does not limit this.

[0085] As an example, an operating system switch request may carry an identifier of the target operating system, such as the image name and / or image version of the target operating system image, so that the management processor can determine the target operating system image based on the identifier.

[0086] In one embodiment, the image management server stores multiple operating system image files. Prior to step 410, the method may further include: receiving an access request sent by a terminal via a management processor; and sending a list of image files to the terminal via the management processor.

[0087] The list of image files includes at least one of the following: image name, image version, image size, and applicable hardware platform. The candidate operating system image file is the one that matches the terminal among multiple operating system image files.

[0088] As an example, the candidate operating system image file is an operating system image file from multiple operating system image files that matches the terminal. This can be understood as follows: after the management processor receives and parses the access request sent by the terminal, it selects the operating system image file from the multiple stored operating system image files that matches the terminal's hardware platform, based on the terminal's hardware platform information (such as chip platform model, storage capacity, etc.). This avoids the terminal downloading an image incompatible with its hardware platform, thus preventing the waste of network and storage resources caused by invalid transmissions.

[0089] Furthermore, after receiving the list of image files, the terminal can display the list in a graphical interface through the system selection client. After the user selects the target operating system to switch to and confirms it on the system selection client interface, the terminal can send an operating system switch request to the image management server in response to the selection of the target operating system.

[0090] Step 420: Send the target operating system image information to the terminal through the management processor.

[0091] Among them, the target operating system image information is used by the terminal to obtain the target operating system image.

[0092] In one embodiment, the target operating system image information includes at least one of the following: Download address for the target operating system image; The size of the target operating system image; The hash value of the target operating system image; Digital signature of the target operating system image.

[0093] The download address indicates the path to obtain the target operating system image, and the terminal can obtain the target operating system image based on this download address.

[0094] Image size indicates the amount of data in the target operating system image. It can be used to confirm whether the available space in the terminal cache partition meets the temporary storage requirements, and / or to confirm the progress and integrity of the image download.

[0095] The hash value is an integrity verification value calculated based on the data in the target operating system image. For example, the hash value can be calculated using hash algorithms such as SHA-256, and there is no limitation thereto.

[0096] A digital signature is information obtained by the image provider signing the target operating system image, and is used to verify the source credibility and integrity of the target operating system image.

[0097] In one embodiment, the target operating system image information is transmitted in an encrypted manner. For example, the management processor can encrypt the target operating system image information before transmitting it to the terminal. This prevents the target operating system image information from being stolen or tampered with during transmission, ensuring the security of subsequent image acquisition and verification processes.

[0098] In one embodiment, after receiving the target operating system image information, the terminal can establish a secure network connection based on the download address and download the target operating system image in a streaming manner through the secure network connection. During the download process, the image data received by the terminal is written to a cache partition via a trusted proxy.

[0099] It should be noted that during the process of writing the target operating system image to the cache partition, the terminal continues to run the services of the current operating system. Specifically, since the cache partition is independent of the root partition and the data partition, the writing of the image data does not involve the storage area on which the current operating system depends. Therefore, the currently running operating system and its services continue to operate normally without any impact, achieving complete parallelism between image download and service execution, that is, achieving zero-interruption download.

[0100] Step 430: If it is confirmed that the target operating system image has been successfully written to the terminal's cache partition, the management processor performs an overwrite operation on the terminal's root partition through the terminal's trusted agent.

[0101] The cache partition is independent of the root partition, which stores the terminal's current operating system image. The trusted agent supports control over both the cache partition and the root partition. The overwrite operation overwrites the current operating system image in the root partition based on the target operating system image in the cache partition.

[0102] In one embodiment, determining that the target operating system image has been successfully written to the terminal's cache partition includes: reading the written image data in the cache partition through the management processor, determining the hash value of the written image data, and verifying the digital signature of the written image data; if the hash value of the written image data is consistent with the hash value of the target operating system image, and the digital signature of the written image data is verified, then determining that the target operating system image has been successfully written to the cache partition.

[0103] As an example, after the target operating system image is completely downloaded to the cache partition, the terminal can call the management processor's verification interface (such as the hardware verification interface) through the system-selected client. The management processor directly reads the written image data in the cache partition via the trusted agent, calculates its hash value, and compares the calculated hash value with the hash value of the target operating system image sent in step 420, while simultaneously verifying the digital signature of the written image data. In this way, through the dual verification of hash comparison and signature verification, it can be confirmed that the image data written to the cache partition is complete, undisturbed, and of a trustworthy source, preventing incomplete or tampered images from being written to the root partition.

[0104] It should be noted that the verification operation is completed by the management processor reading data from the cache partition, which does not occupy the computing resources of the application processor. That is, while determining whether the target operating system image has been successfully written to the cache partition, the terminal continues to run the current operating system's services.

[0105] In one embodiment, the method further includes: if the hash value of the written image data is inconsistent with the hash value of the target operating system image, and / or the digital signature verification of the written image data fails, clearing the written image data in the cache partition and re-triggering the writing of the target operating system image to the cache partition.

[0106] As an example, if the hash values ​​don't match, it indicates that the image data was corrupted or missing during transmission or writing; if the digital signature verification fails, it indicates that the image data may have been tampered with or its source is untrustworthy. In these cases, the written image data in the cache partition can be automatically cleared, and the download process can be restarted, i.e., the writing of the target operating system image to the cache partition is retried until the verification passes. In this way, the image can be reacquired without user intervention, ensuring that the final image used for overwriting is a complete and trustworthy image, improving the fault tolerance and automation of the switching process.

[0107] In one embodiment, if it is determined that the target operating system image has been successfully written to the terminal's cache partition, the method further includes: setting a switch-to flag corresponding to the target operating system in the terminal by managing the processor.

[0108] The handover pending flag indicates that the terminal is in a handover pending state. As an example, the handover pending flag can be stored in a storage area accessible to the terminal's trusted agent, such as the metadata area of ​​the cache partition or the trusted agent's registers, without restriction.

[0109] Accordingly, performing an overwrite operation on the root partition of the terminal via the trusted agent of the terminal through the management processor may include: performing an overwrite operation on the root partition via the trusted agent through the management processor in response to a handover confirmation instruction sent by the terminal.

[0110] As an example, after the handover flag is set, the terminal can prompt the user that it is in a handover-pending state through the system's client selection. After the user confirms the handover, the terminal responds to the user's handover confirmation operation by sending a handover confirmation instruction to the image management server. Upon receiving the handover confirmation instruction, the management processor triggers the overwrite operation. In this way, the triggering right of the overwrite operation can be given to the user's confirmation, avoiding the hasty overwriting of the root partition without the user's confirmation, and improving the controllability of the handover process.

[0111] In one embodiment, performing an overwrite operation on the root partition via a trusted agent through a management processor includes: sending an interrupt indication to the application processor of the terminal via the management processor, the interrupt indication being used to instruct the application processor to perform at least one of the following: stopping the services running in the current operating system, synchronizing the file system, and unmounting other partitions except the root partition; taking over the storage controller of the terminal via the trusted agent through the management processor and cutting off the application processor's write access permissions to the physical storage area where the root partition is located; and writing the target operating system image in the cache partition to the root partition through the management processor.

[0112] As an example, the management processor can send an interrupt indication to the terminal via a secure network channel, for instance, a trusted agent can translate this interrupt indication into an interrupt signal for the application processor. Upon receiving the interrupt indication, the daemon on the application processor side sequentially stops all user services running in the current operating system, synchronizes the file system, and unmounts all partitions except the root partition, ensuring data consistency before the overwrite. It is understood that the terminal's services are only sequentially stopped in response to the interrupt indication before the overwrite operation begins; the image download and verification processes prior to this are uninterrupted.

[0113] As an example, the management processor takes over the storage controller via a trusted agent's physical path and cuts off the application processor's write access to the physical storage area where the root partition resides. That is, the trusted agent provides the management processor with control over the storage controller, ensuring that during the overwrite process, only the management processor can perform write operations on the root partition, while any software running on the application processor (including potential malware) cannot perform write operations on the root partition. This isolates the overwrite process from the upper-layer software environment, preventing malware from interfering with or tampering with the overwrite process and improving the security of the overwrite operation.

[0114] As an example, Figure 5 This is a schematic diagram of the overwriting process of the operating system image provided in the embodiments of this application. Figure 5 The image shows the storage status of the mobile terminal's storage medium in three stages: before image download caching, after image download caching and before overwrite operation, and after overwrite operation. The image service and MCPU are located on the image management server of the cloud platform. The image service provides services such as image list query and image distribution to the image management server.

[0115] Before the image is downloaded and cached, such as Figure 5 As shown in the lower left part, the root partition of the mobile terminal stores the first system image, which is the current operating system image.

[0116] After the image is downloaded and cached, but before the overwrite operation is performed, such as Figure 5As shown in the middle section, MCPU sends the image data of the new system image to the mobile terminal via the image service. The new system image is the target operating system image. The image data is written to the cache partition via a trusted agent, forming a new system image cache, which is the target operating system image temporarily stored in the cache partition. At this time, the root partition still stores the first system image. That is, during the download and caching of the new system image, the root partition is unaffected, and the current operating system and its services continue to operate normally.

[0117] After the overwrite operation is executed, as follows Figure 5 As shown on the right, the management processor (MCPU) writes the target operating system image (i.e., the new system image in the new system image cache) from the cache partition to the root partition in a complete and continuous manner via the trusted agent, completely overwriting the original current operating system image (i.e., the first system image). That is, before the overwrite operation, the root partition stores the first system image (i.e., the current operating system image), and the cache partition temporarily stores the new system image (i.e., the target operating system image). After the overwrite operation, the first system image in the root partition is completely overwritten by the new system image, and the image stored in the root partition is updated to the new system image.

[0118] Furthermore, after the mobile terminal restarts, the bootloader loads the new system image from the root partition and initializes the initrd (initial RAM disk), ultimately starting the target operating system and enabling the target operating system to run on the physical hardware of the mobile terminal.

[0119] In one embodiment, the overwrite operation is an atomic operation. An atomic overwrite operation can be understood as either completing completely or producing no effective write result; the root partition will not be in an incomplete intermediate state of partial overwrite.

[0120] In one embodiment, the method further includes: in the event of a power outage or abnormality during the writing of the target operating system image to the root partition, performing a rollback on the root partition through the write protection logic of the management processor.

[0121] As an example, the management processor incorporates write-protection logic. In the event of a power outage or exception during the overwrite process, this logic can roll back the root partition to a safe state. This avoids the problem of the root partition being in an incomplete intermediate state due to an overwrite interruption, preventing the terminal from booting and improving the reliability of the overwrite operation.

[0122] As an example, write protection logic can be configured by the management processor on the trusted agent and / or storage controller side, meaning the write protection logic is executed locally on the terminal. For instance, the write protection logic can record the execution progress of the overwrite operation (such as the offset of data already written). In the event of a power outage during the overwrite process, since the target operating system image is still fully preserved in the cache partition, after the terminal is powered on again, the trusted agent can re-execute the overwrite operation from the cache partition based on the execution progress recorded by the write protection logic until the target operating system image is fully written to the root partition, thereby allowing the root partition to roll back to a safe state. In other words, the safe state can be understood as the state where the root partition fully stores the target operating system image, avoiding the root partition remaining in an incomplete intermediate state of partial overwrite.

[0123] In one embodiment, the method further includes: upon completion of the process of writing the target operating system image to the root partition, performing at least one of the following by the management processor: verifying the integrity of the target operating system image in the root partition, clearing the switch-out flag, and releasing control of the storage controller.

[0124] As an example, after the overwrite is complete, the management processor can read the data written to the root partition and verify its integrity, such as by performing a hash comparison again to confirm that the target operating system image has been completely written to the root partition. Then, the management processor can clear the switch-out flag and release control of the storage controller, restoring the terminal's storage access state.

[0125] Step 440: Trigger the terminal to start the target operating system via the management processor.

[0126] In one embodiment, triggering the terminal to start the target operating system via the management processor includes: sending a reset signal to the terminal's power management unit via the management processor.

[0127] As an example, the management processor can send a reset signal to the terminal's power management unit via a trusted agent. The terminal automatically restarts in response to the reset signal. After restarting, the bootloader loads the newly written target operating system image from the root partition, decompresses the kernel, initializes the initrd (initial RAM disk), and finally boots the target operating system. In this way, the terminal's physical hardware runs the target operating system completely on the physical machine without any additional boot menu selection or manual intervention, achieving a seamless switch.

[0128] In one embodiment, if the target operating system boots successfully, the terminal can clear the target operating system image from the cache partition so that the cache space can be reused when switching again, thereby improving the utilization rate of the terminal's storage resources.

[0129] based on Figure 4The method described allows the terminal to quickly and on-demand retrieve the target operating system image from the cloud and overwrite the root partition when needed, without interrupting the current task during the download and verification process, achieving true multi-operating system real-device operation. Compared to remote virtual container solutions, this embodiment requires no virtualization software support, no continuous network connection, has low network dependence, fully utilizes the terminal's local hardware resources, and avoids the performance loss of cloud virtual containers. Compared to local privacy space solutions, this embodiment achieves true switching of the underlying operating system, meeting the needs of cross-architecture and cross-version system operation.

[0130] Figure 6 This is a second flowchart illustrating a terminal operating system switching method provided in this application. The method is applied to a terminal, which includes a trusted agent. For example... Figure 6 As shown, the method includes steps 610 to 640 as follows.

[0131] Step 610: Send an operating system switch request to the image management server of the cloud platform.

[0132] Among them, the operating system switching request is used to request a switch to the target operating system, and the image management server includes a management processor.

[0133] In one embodiment, before step 610, the method further includes: sending an access request to an image management server; receiving a list of image files sent by the image management server, the list of image files including at least one of the following: image name, image version, image size, and applicable hardware platform of candidate operating system image files, the candidate operating system image files being the operating system image files that match the terminal among multiple operating system image files stored by the image management server; and displaying the list of image files.

[0134] Accordingly, step 610 may include: sending an operating system switching request to the image management server in response to a selection operation for the target operating system.

[0135] As an example, the terminal can display a list of image files in a graphical interface through a system selection client running on the application processor, and in response to the user's selection and confirmation of the target operating system on the interface, send an operating system switching request to the image management server through the system selection client.

[0136] Step 620: Receive the target operating system image information sent by the image management server, obtain the target operating system image based on the target operating system image information, and write the target operating system image to the cache partition.

[0137] The cache partition is separate from the root partition, which stores the terminal's current operating system image. The trusted agent is used to support control over both the cache partition and the root partition.

[0138] In one embodiment, the target operating system image information includes at least one of the following: the download address of the target operating system image, the image size, the hash value, and the digital signature. For a description of the target operating system image information, please refer to the relevant description in step 420, which will not be repeated here.

[0139] In one embodiment, obtaining the target operating system image based on target operating system image information includes: establishing a secure network connection based on a download address, and downloading the target operating system image in a streaming manner through the secure network connection. Writing the target operating system image to a cache partition includes: writing the image data of the downloaded target operating system image to the cache partition through a trusted proxy.

[0140] As an example, streaming download can be understood as follows: the terminal receives image data and simultaneously writes the received image data to a cache partition via a trusted proxy, without waiting for the entire image file to be received before writing it all at once. This reduces the consumption of terminal memory resources and improves the efficiency of image acquisition and temporary storage.

[0141] It should be noted that during the download and writing process, the current operating system and its services continue to operate normally without any impact.

[0142] Step 630: If the target operating system image is successfully written to the cache partition, perform an overwrite operation on the root partition under the control of the management processor through the trusted agent.

[0143] The overwrite operation is used to overwrite the current operating system image in the root partition based on the target operating system image in the cache partition.

[0144] In one embodiment, whether the target operating system image has been successfully written to the cache partition is determined by the management processor based on the written image data in the cache partition. The method further includes: if the written image data fails the management processor's verification, clearing the written image data from the cache partition and re-acquiring the target operating system image. The specific implementation of the verification can be found in the description of step 430, and will not be repeated here.

[0145] In one embodiment, the method further includes: when a switch flag corresponding to the target operating system is set in the terminal, sending a switch confirmation instruction to the image management server in response to a switch confirmation operation.

[0146] As an example, the pending switch flag is set by the management processor after the target operating system image is successfully written to the cache partition. After the pending switch flag is set, the terminal can prompt the user through the system selection client that it is in a pending switch state, and in response to the user's switch confirmation operation, send a switch confirmation instruction to the image management server to trigger the overwrite operation.

[0147] In one embodiment, the terminal further includes an application processor. The method further includes: receiving an interrupt indication sent by a management processor via the application processor; and in response to the interrupt indication, performing at least one of the following via the application processor: stopping services running in the current operating system, synchronizing the file system, and unmounting partitions other than the root partition.

[0148] It should be noted that during the overwrite operation, the current operating system kernel and daemon processes are already loaded into the terminal's RAM and running. Overwriting the root partition does not affect the execution environment already residing in RAM, so the terminal can maintain its basic running state until it restarts during the overwrite process.

[0149] In one embodiment, the terminal further includes a storage controller. The method also includes: providing control of the storage controller to a management processor via a trusted agent, and revoking write access permissions for the application processor to the physical storage region where the root partition resides.

[0150] As an example, a trusted agent can restrict the application processor's write access to the physical storage area where the root partition is located by configuring the storage controller's access permission register, address filtering rules, or write protection commands.

[0151] In this way, during the overwrite process, only the management processor can perform write operations on the root partition through the trusted agent, while the application processor-side software cannot perform write operations on the root partition, thus achieving isolation between the overwrite process and the upper-layer software environment.

[0152] Step 640: Boot the target operating system based on the target operating system image in the root partition.

[0153] In one embodiment, the terminal further includes a power management unit. Step 640 may include: receiving a reset signal sent by the management processor through the power management unit; performing a restart in response to the reset signal; and, upon completion of the restart, loading the target operating system image from the root partition through a bootloader and starting the target operating system.

[0154] As an example, the startup process after a terminal restart can be referred to Figure 3The operating system image loading process is as follows: After the terminal is powered on, the Boot ROM completes basic hardware initialization and loads the Bootloader. After the Bootloader performs hardware configuration such as RAM initialization, it reads the newly written target operating system image from the root partition, loads the operating system kernel image into physical memory, decompresses the kernel, initializes the initrd, and transfers control to the kernel, finally starting the target operating system. Thus, the terminal's physical hardware fully runs the target operating system on the actual device.

[0155] In one embodiment, the method further includes: if the target operating system boots successfully, clearing the target operating system image from the cache partition. This frees up storage space in the cache partition so that it can be reused during subsequent switches.

[0156] The terminal operating system switching device provided in the embodiments of this application is described below. The terminal operating system switching device described below can be referred to in correspondence with the terminal operating system switching method described above.

[0157] Figure 7 This is one of the structural schematic diagrams of the terminal operating system switching device provided in the embodiments of this application. For example... Figure 7 As shown, the terminal operating system switching device includes the following: The receiving module 710 is used to receive the operating system switching request sent by the terminal. The operating system switching request is used to request switching to the target operating system. The sending module 720 is used to send target operating system image information to the terminal, and the target operating system image information is used by the terminal to obtain the target operating system image. The processing module 730 is used to perform an overwrite operation on the root partition of the terminal via the trusted agent of the terminal when it is determined that the target operating system image has been successfully written to the cache partition of the terminal. The cache partition is independent of the root partition, and the root partition stores the current operating system image of the terminal. The trusted agent is used to support control over the cache partition and the root partition. The overwrite operation is used to overwrite the current operating system image in the root partition according to the target operating system image in the cache partition. The processing module 730 is also used to trigger the terminal to start the target operating system.

[0158] In one embodiment, the target operating system image information includes at least one of the following: the download address of the target operating system image, the image size, the hash value, and the digital signature.

[0159] In one embodiment, the processing module 730 is specifically used to: read the written image data in the cache partition, determine the hash value of the written image data, and verify the digital signature of the written image data; if the hash value of the written image data is consistent with the hash value of the target operating system image and the digital signature of the written image data is verified, determine that the target operating system image has been successfully written to the cache partition.

[0160] In one embodiment, the processing module 730 is further configured to clear the written image data in the cache partition and re-trigger the writing of the target operating system image to the cache partition if the hash value of the written image data is inconsistent with the hash value of the target operating system image and / or the digital signature verification of the written image data fails.

[0161] In one embodiment, the processing module 730 is further configured to set a switch flag corresponding to the target operating system in the terminal when it is determined that the target operating system image has been successfully written to the cache partition; the processing module 730 is specifically configured to: perform an overwrite operation on the root partition via a trusted proxy in response to a switch confirmation instruction sent by the terminal.

[0162] In one embodiment, the processing module 730 is specifically configured to: send an interrupt indication to the application processor of the terminal, the interrupt indication being used to instruct the application processor to perform at least one of the following: stop the business running in the current operating system, synchronize the file system, unload other partitions except the root partition; take over the storage controller of the terminal via a trusted agent and cut off the application processor's write access permissions to the physical storage area where the root partition is located; and write the target operating system image in the cache partition to the root partition.

[0163] In one embodiment, the processing module 730 is further configured to perform a rollback on the root partition through write protection logic in the event of a power outage or abnormality during the writing of the target operating system image to the root partition.

[0164] In one embodiment, the processing module 730 is further configured to perform at least one of the following when the process of writing the target operating system image to the root partition is completed: verifying the integrity of the target operating system image in the root partition; clearing the switch-out flag; and releasing control of the storage controller.

[0165] In one embodiment, the receiving module 710 is further configured to receive an access request sent by the terminal; the sending module 720 is further configured to send a list of image files to the terminal, the list of image files including at least one of the following: image name, image version, image size, and applicable hardware platform of the candidate operating system image files.

[0166] In one embodiment, the processing module 730 is specifically used to send a reset signal to the power management unit of the terminal.

[0167] Figure 8 This is a second schematic diagram of a terminal operating system switching device provided in an embodiment of this application. Figure 8 As shown, the terminal operating system switching device includes the following: The sending module 810 is used to send an operating system switching request to the image management server of the cloud platform. The operating system switching request is used to request a switch to the target operating system. The image management server includes a management processor. The receiving module 820 is used to receive target operating system image information sent by the image management server, obtain the target operating system image based on the target operating system image information, and write the target operating system image to the cache partition; the cache partition is independent of the root partition, and the root partition stores the current operating system image of the terminal; The processing module 830 is used to perform an overwrite operation on the root partition under the control of the management processor when the target operating system image is successfully written to the cache partition; the overwrite operation is used to overwrite the current operating system image in the root partition based on the target operating system image in the cache partition. The processing module 830 is also used to boot the target operating system based on the target operating system image in the root partition.

[0168] In one embodiment, the receiving module 820 is further configured to establish a secure network connection based on the download address in the target operating system image information, and download the target operating system image in a streaming manner through the secure network connection, and write the image data of the downloaded target operating system image to a cache partition through a trusted proxy.

[0169] In one embodiment, the processing module 830 is further configured to clear the written image data in the cache partition and re-acquire the target operating system image if the written image data fails the verification of the management processor.

[0170] In one embodiment, the sending module 810 is further configured to send a switching confirmation instruction to the image management server in response to a switching confirmation operation when the switching flag corresponding to the target operating system in the terminal is set.

[0171] In one embodiment, the processing module 830 is further configured to receive an interrupt indication sent by the management processor through the application processor, and in response to the interrupt indication, perform at least one of the following through the application processor: stop the business running in the current operating system, synchronize the file system, and unload other partitions except the root partition.

[0172] In one embodiment, the processing module 830 is further configured to provide control of the storage controller to the management processor through a trusted agent and to revoke the application processor's write access permissions to the physical storage area where the root partition is located.

[0173] In one embodiment, the processing module 830 is further configured to receive a reset signal sent by the management processor through the power management unit, perform a restart in response to the reset signal, and, upon completion of the restart, load the target operating system image from the root partition through the bootloader and start the target operating system.

[0174] In one embodiment, the sending module 810 is further configured to send an access request to the image management server; the receiving module 820 is further configured to receive a list of image files sent by the image management server; and the processing module 830 is further configured to display the list of image files.

[0175] In one embodiment, the processing module 830 is further configured to clear the target operating system image in the cache partition if the target operating system boots successfully.

[0176] Figure 9 This is a schematic diagram of the terminal structure according to an embodiment of this application, with reference to... Figure 9 This application embodiment also provides a terminal, which may include: a memory 910, a transceiver 920, and a processor 930; The memory 910 is used to store computer programs; the transceiver 920 is used to send and receive data under the control of the processor 930; the processor 930 is used to read the computer program in the memory 910 and perform the following operations: Send an operating system switch request to the image management server of the cloud platform; receive the target operating system image information sent by the image management server, obtain the target operating system image based on the target operating system image information, and write the target operating system image to the cache partition; if the target operating system image is successfully written to the cache partition, perform an overwrite operation on the root partition under the control of the management processor through the trusted agent; and start the target operating system based on the target operating system image in the root partition.

[0177] Among them, Figure 9 In this context, the bus architecture can include any number of interconnected buses and bridges, specifically linking various circuits of one or more processors represented by processor 930 and memory represented by memory 910 together. The bus architecture can also link various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein. The bus interface provides an interface. Transceiver 920 can be multiple elements, including transmitters and receivers, providing a unit for communicating with various other devices over a transmission medium. For different user equipment, user interface 940 can also be an interface capable of connecting external or internal devices as needed.

[0178] The processor 930 is responsible for managing the bus architecture and general processing, while the memory 910 can store the data used by the processor 930 during operation.

[0179] The processor 930 executes any of the methods described in the embodiments of this application according to the obtained executable instructions by calling a computer program stored in the memory 910. The processor and the memory may also be physically separated.

[0180] Optionally, the processor 930 is also used to perform any other operation performed by the terminal in the above embodiments.

[0181] Figure 10 This is a schematic diagram of the server structure according to an embodiment of this application, with reference to... Figure 10 This application embodiment also provides a server, which may include: a memory 1010, a transceiver 1020 and a processor 1030; The memory 1010 is used to store computer programs; the transceiver 1020 is used to send and receive data under the control of the processor 1030; the processor 1030 is used to read the computer program in the memory 1010 and perform the following operations: The management processor receives the operating system switch request sent by the terminal; sends the target operating system image information to the terminal; if the target operating system image is successfully written to the terminal's cache partition, the management processor performs an overwrite operation on the terminal's root partition via the terminal's trusted agent; and triggers the terminal to start the target operating system.

[0182] Among them, Figure 10 In this context, the bus architecture may include any number of interconnected buses and bridges, specifically linking various circuits together, represented by one or more processors (processor 1030) and memory (memory 1010). The bus architecture may also link together various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein. The bus interface provides an interface. The transceiver 1020 may be multiple elements, including transmitters and receivers, providing a unit for communicating with various other devices over a transmission medium. The processor 1030 is responsible for managing the bus architecture and general processing, and the memory 1010 may store data used by the processor 1030 during operation.

[0183] Optionally, the processor 1030 is also used to perform any other operation performed by the server in the above embodiments.

[0184] It should be noted that the terminal and server provided in this application embodiment can implement all the method steps implemented in the above method embodiment and can achieve the same technical effect. Therefore, the parts and beneficial effects that are the same as those in the method embodiment will not be described in detail here.

[0185] Figure 11 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 11 As shown, the electronic device may include: a processor 1110, a communication interface 1120, a memory 1130, and a communication bus 1140, wherein the processor 1110, the communication interface 1120, and the memory 1130 communicate with each other via the communication bus 1140. The processor 1110 can call a computer program in the memory 1130 to execute the steps of the methods provided in the above embodiments, such as including: The management processor receives the operating system switching request sent by the terminal; sends the target operating system image information to the terminal through the management processor; if it is determined that the target operating system image has been successfully written to the terminal's cache partition, the management processor performs an overwrite operation on the terminal's root partition through the terminal's trusted agent; and triggers the terminal to start the target operating system through the management processor. Alternatively, a request to switch operating systems is sent to the image management server of the cloud platform; the target operating system image information is received from the image management server, and the target operating system image is obtained based on the target operating system image information and written to the cache partition; if the target operating system image is successfully written to the cache partition, the root partition is overwritten under the control of the management processor through the trusted agent; the target operating system is started based on the target operating system image in the root partition.

[0186] Furthermore, the logical instructions in the aforementioned memory 1130 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0187] On the other hand, embodiments of this application also provide a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can perform the steps of the methods provided in the above embodiments, such as: The management processor receives the operating system switching request sent by the terminal; sends the target operating system image information to the terminal through the management processor; if it is determined that the target operating system image has been successfully written to the terminal's cache partition, the management processor performs an overwrite operation on the terminal's root partition through the terminal's trusted agent; and triggers the terminal to start the target operating system through the management processor. Alternatively, a request to switch operating systems is sent to the image management server of the cloud platform; the target operating system image information is received from the image management server, and the target operating system image is obtained based on the target operating system image information and written to the cache partition; if the target operating system image is successfully written to the cache partition, the root partition is overwritten under the control of the management processor through the trusted agent; the target operating system is started based on the target operating system image in the root partition.

[0188] On the other hand, embodiments of this application also provide a processor-readable storage medium storing a computer program for causing a processor to perform the steps of the methods provided in the above embodiments, such as including: The management processor receives the operating system switching request sent by the terminal; sends the target operating system image information to the terminal through the management processor; if it is determined that the target operating system image has been successfully written to the terminal's cache partition, the management processor performs an overwrite operation on the terminal's root partition through the terminal's trusted agent; and triggers the terminal to start the target operating system through the management processor. Alternatively, a request to switch operating systems is sent to the image management server of the cloud platform; the target operating system image information is received from the image management server, and the target operating system image is obtained based on the target operating system image information and written to the cache partition; if the target operating system image is successfully written to the cache partition, the root partition is overwritten under the control of the management processor through the trusted agent; the target operating system is started based on the target operating system image in the root partition.

[0189] The processor-readable storage medium can be any available medium or data storage device that the processor can access, including but not limited to magnetic memory (e.g., floppy disk, hard disk, magnetic tape, magneto-optical disk (MO)), optical memory (e.g., CD, DVD, BD, HVD), and semiconductor memory (e.g., ROM, EPROM, EEPROM, non-volatile memory (NAND FLASH), solid-state drive (SSD)).

[0190] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0191] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0192] 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 spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A method for switching terminal operating systems, characterized in that, An image management server applied to a cloud platform, the image management server including a management processor; the method includes: The management processor receives an operating system switching request sent by the terminal, the operating system switching request being used to request a switch to the target operating system; The management processor sends target operating system image information to the terminal, and the target operating system image information is used by the terminal to obtain the target operating system image. If it is determined that the target operating system image has been successfully written to the terminal's cache partition, the management processor performs an overwrite operation on the terminal's root partition via the terminal's trusted agent; the cache partition is independent of the root partition, and the root partition stores the terminal's current operating system image; the trusted agent is used to support control over the cache partition and the root partition; the overwrite operation is used to overwrite the current operating system image in the root partition based on the target operating system image in the cache partition; The management processor triggers the terminal to start the target operating system.

2. The method according to claim 1, characterized in that, The target operating system image information includes at least one of the following: The download address for the target operating system image; The size of the target operating system image; The hash value of the target operating system image; The digital signature of the target operating system image.

3. The method according to claim 2, characterized in that, The step of determining that the target operating system image has been successfully written to the terminal's cache partition includes: The management processor reads the written image data from the cache partition, determines the hash value of the written image data, and verifies the digital signature of the written image data. If the hash value of the written image data matches the hash value of the target operating system image, and the digital signature of the written image data passes verification, then the target operating system image is determined to have been successfully written to the cache partition.

4. The method according to claim 3, characterized in that, The method further includes: If the hash value of the written image data is inconsistent with the hash value of the target operating system image, and / or the digital signature verification of the written image data fails, the written image data in the cache partition is cleared, and the writing of the target operating system image to the cache partition is retried.

5. The method according to claim 1, characterized in that, If it is determined that the target operating system image has been successfully written to the terminal's cache partition, the method further includes: The management processor sets a switching flag in the terminal corresponding to the target operating system; The step of performing an overwrite operation on the root partition of the terminal via the trusted agent of the terminal through the management processor includes: In response to the handover confirmation instruction sent by the terminal, the management processor performs an overwrite operation on the root partition via the trusted agent.

6. The method according to claim 5, characterized in that, The process of performing an overwrite operation on the root partition via the trusted agent through the management processor includes: The management processor sends an interrupt indication to the application processor of the terminal, the interrupt indication being used to instruct the application processor to perform at least one of the following: stop the business running in the current operating system, synchronize the file system, or unload other partitions except the root partition; The management processor takes over the terminal's storage controller via the trusted agent and cuts off the application processor's write access to the physical storage area where the root partition is located; The management processor writes the target operating system image from the cache partition to the root partition.

7. The method according to claim 6, characterized in that, The method further includes: In the event of a power outage or abnormality during the writing of the target operating system image to the root partition, the write protection logic of the management processor is used to perform a rollback on the root partition.

8. The method according to claim 6, characterized in that, The method further includes: Upon completion of the process of writing the target operating system image to the root partition, at least one of the following is executed by the management processor: Verify the integrity of the target operating system image in the root partition; Clear the switching flag; Release control over the storage controller.

9. The method according to claim 1, characterized in that, The image management server stores multiple operating system image files; the method further includes: The management processor receives the access request sent by the terminal; The management processor sends a list of image files to the terminal. The list of image files includes at least one of the following: image name, image version, image size, and applicable hardware platform of the candidate operating system image files. The candidate operating system image files are the operating system image files that match the terminal among the plurality of operating system image files.

10. The method according to claim 1, characterized in that, The step of triggering the terminal to start the target operating system through the management processor includes: The management processor sends a reset signal to the power management unit of the terminal.

11. A method for switching terminal operating systems, characterized in that, The method is applied to a terminal, wherein the terminal includes a trusted proxy; the method includes: Send an operating system switching request to the image management server of the cloud platform. The operating system switching request is used to request a switch to the target operating system. The image management server includes a management processor. The system receives target operating system image information sent by the image management server, obtains the target operating system image based on the target operating system image information, and writes the target operating system image into the cache partition; the cache partition is independent of the root partition, and the root partition stores the current operating system image of the terminal; the trusted proxy is used to support control over the cache partition and the root partition; If the target operating system image is successfully written to the cache partition, the trusted agent performs an overwrite operation on the root partition under the control of the management processor; the overwrite operation is used to overwrite the current operating system image in the root partition based on the target operating system image in the cache partition; The target operating system is started based on the target operating system image in the root partition.

12. The method according to claim 11, characterized in that, The target operating system image information includes at least one of the following: The download address for the target operating system image; The size of the target operating system image; The hash value of the target operating system image; The digital signature of the target operating system image.

13. The method according to claim 12, characterized in that, The step of obtaining the target operating system image based on the target operating system image information includes: A secure network connection is established based on the download address, and the target operating system image is downloaded in a streaming manner through the secure network connection; The step of writing the target operating system image to the cache partition includes: The downloaded target operating system image data is written to the cache partition through the trusted proxy.

14. The method according to claim 11, characterized in that, Whether the target operating system image has been successfully written to the cache partition is determined by the management processor based on the written image data in the cache partition; the method further includes: If the written image data fails the verification of the management processor, the written image data in the cache partition is cleared, and the target operating system image is re-acquired.

15. The method according to claim 11, characterized in that, The method further includes: When the switch flag corresponding to the target operating system is set in the terminal, a switch confirmation instruction is sent to the image management server in response to the switch confirmation operation.

16. The method according to claim 11, characterized in that, The terminal further includes an application processor; the method further includes: The application processor receives an interrupt indication sent by the management processor. In response to the interrupt instruction, the application processor performs at least one of the following: stops the business running in the current operating system, synchronizes the file system, or unmounts other partitions except the root partition.

17. The method according to claim 16, characterized in that, The terminal further includes a storage controller; the method further includes: The trusted agent provides control of the storage controller to the management processor and cuts off the application processor's write access to the physical storage area where the root partition is located.

18. The method according to claim 11, characterized in that, The terminal further includes a power management unit; the step of booting the target operating system based on the target operating system image in the root partition includes: The power management unit receives a reset signal sent by the management processor. In response to the reset signal, a restart is performed; Upon successful reboot, the target operating system image is loaded from the root partition by the bootloader, and the target operating system is started.

19. The method according to claim 11, characterized in that, Before sending the operating system switch request to the image management server of the cloud platform, the method further includes: Send an access request to the image management server; The system receives a list of image files sent by the image management server. The list of image files includes at least one of the following: image name, image version, image size, and applicable hardware platform of the candidate operating system image files. The candidate operating system image files are the operating system image files that match the terminal among the multiple operating system image files stored by the image management server. Display the list of image files; Sending the operating system switch request to the image management server of the cloud platform includes: In response to the selection operation for the target operating system, an operating system switching request is sent to the image management server.

20. The method according to claim 11, characterized in that, The method further includes: If the target operating system boots successfully, clear the target operating system image from the cache partition.

21. A terminal operating system switching device, characterized in that, include: The receiving module is used to receive an operating system switching request sent by the terminal, wherein the operating system switching request is used to request switching to the target operating system; The sending module is used to send target operating system image information to the terminal, and the target operating system image information is used by the terminal to obtain the target operating system image. The processing module is configured to, upon determining that the target operating system image has been successfully written to the cache partition of the terminal, perform an overwrite operation on the root partition of the terminal via a trusted proxy of the terminal; the cache partition is independent of the root partition, and the root partition stores the current operating system image of the terminal; the trusted proxy is configured to support control over the cache partition and the root partition; the overwrite operation is configured to overwrite the current operating system image in the root partition based on the target operating system image in the cache partition; The processing module is also used to trigger the terminal to start the target operating system.

22. A terminal operating system switching device, characterized in that, include: The sending module is used to send an operating system switching request to the image management server of the cloud platform. The operating system switching request is used to request a switch to the target operating system. The image management server includes a management processor. The receiving module is used to receive target operating system image information sent by the image management server, obtain the target operating system image based on the target operating system image information, and write the target operating system image into the cache partition; the cache partition is independent of the root partition, and the root partition stores the current operating system image of the terminal; The processing module is configured to perform an overwrite operation on the root partition under the control of the management processor when the target operating system image is successfully written to the cache partition; the overwrite operation is configured to overwrite the current operating system image in the root partition based on the target operating system image in the cache partition; The processing module is also used to start the target operating system based on the target operating system image in the root partition.

23. An electronic device comprising a processor and a memory storing a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the terminal operating system switching method according to any one of claims 1 to 10, or implements the steps of the terminal operating system switching method according to any one of claims 11 to 20.

24. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the terminal operating system switching method as described in any one of claims 1 to 10, or implements the steps of the terminal operating system switching method as described in any one of claims 11 to 20.

25. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the terminal operating system switching method according to any one of claims 1 to 10, or implements the steps of the terminal operating system switching method according to any one of claims 11 to 20.