Dual-system mirror file processing method and device, electronic equipment and storage medium

By saving the image file status information and switching to the real-time operating system when the operating system malfunctions, the problem of lost transmission progress caused by Linux system failures is solved, and efficient image file transmission is achieved.

CN122309194APending Publication Date: 2026-06-30SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
Filing Date
2026-03-30
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

In existing technologies, virtual media services rely on BMC's Linux system. When the Linux system restarts due to upgrades or failures, the image file transfer progress is lost, resulting in low transfer efficiency.

Method used

When an abnormality is detected in the current operating system, the file status information and device status information of the image file are obtained and saved to shared memory. The system then switches to the real-time operating system and restores the transmission path based on the real-time operating system to achieve breakpoint resumption.

Benefits of technology

It enables uninterrupted and resumeable transmission of image files, avoiding retransmissions, shortening transmission time, and improving transmission efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122309194A_ABST
    Figure CN122309194A_ABST
Patent Text Reader

Abstract

This invention relates to the field of computer technology and discloses a method, apparatus, electronic device, and storage medium for processing dual-system image files. When the current operating system malfunctions, the method immediately saves the file status information and device status information of the image file being transmitted to shared memory, acquires and responds to a first system switch command, switches from the current operating system to a real-time operating system, retrieves the file status information and device status information from shared memory based on the real-time operating system, establishes a target transmission path, and sends a transmission recovery request to the client based on the file status information and the target transmission path. This allows the client to continue transmitting the image file to the real-time operating system based on the file status information. By having the real-time operating system take over and restore the data before the malfunction when the current operating system malfunctions, uninterrupted file transmission and breakpoint resumption are achieved, avoiding retransmissions caused by lost transmission progress, shortening transmission time, and improving file transmission efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and specifically to a method, apparatus, electronic device, and storage medium for processing dual-system image files. Background Technology

[0002] Virtual media is one of the core functions of remote server management. It allows administrators to remotely mount image files through the Baseboard Management Controller (BMC) to achieve contactless operation and maintenance. The client transmits image data to the BMC virtual media service through a specified protocol. The BMC virtual media service writes the received data into the internal Network Block Device (NBD). The BMC Linux kernel module binds the NBD device to the Universal Serial Bus Logical Unit Number (USB LUN). The server operating system recognizes the simulated USB LUN and completes the image mounting.

[0003] In related technologies, virtual media services rely on a Linux system running on BMC. When the Linux system restarts due to upgrades or failures, the service is completely interrupted, resulting in the loss of transmission progress. Consequently, after restarting, the transmission needs to start from the beginning, increasing the transmission time of the image file and reducing the transmission efficiency. Summary of the Invention

[0004] This application provides a method, apparatus, electronic device, and storage medium for processing dual-system image files, in order to at least solve the problem in the related art where image file transfer progress is lost when the system malfunctions, resulting in low file transfer efficiency.

[0005] This application provides a method for processing dual-system image files, including: If an abnormality is detected in the current operating system, obtain the corresponding file status information and device status information for any image file being sent by any client; The metadata, file status, and device status information represented by the image file are saved to shared memory; both the current operating system and the real-time operating system have access to the shared memory. If the file status information and device status information are successfully saved, a first system switching instruction is obtained; wherein, the first system switching instruction is used to switch from the current operating system to the real-time operating system; In response to the first system switching command, the system switches from the current operating system to the real-time operating system based on the entry address of the real-time operating system. Based on a real-time operating system, file status information and device status information are obtained in shared memory; Establish the target transmission path based on the device status information; Based on the file status information and the target transmission path, a transmission recovery request is sent to the client so that the client can continue to send the image file to the real-time operating system according to the file status information.

[0006] This application also provides a dual-system image file processing device, including: The first acquisition module is used to acquire the corresponding file status information and device status information for any image file being sent by any client when an abnormality is detected in the current operating system. The storage module is used to save the metadata information, file status information, and device status information represented by the image file to shared memory; both the current operating system and the real-time operating system have access permissions to the shared memory. The second acquisition module is used to acquire the first system switching instruction when the file status information and device status information are successfully saved; wherein, the first system switching instruction is used to switch from the current operating system to the real-time operating system; The switching module is used to respond to the first system switching command and switch from the current operating system to the real-time operating system according to the entry address of the real-time operating system. The third acquisition module is used to acquire file status information and device status information in shared memory based on the real-time operating system. The module is used to establish the target transmission path based on device status information; The recovery module is used to send a transmission recovery request to the client based on the file status information and the target transmission path, so that the client can continue to send the image file to the real-time operating system according to the file status information.

[0007] This application also provides an electronic device, including: a memory for storing a computer program; and a processor for implementing the steps of any of the above-described dual-system image file processing methods when executing the computer program.

[0008] This application also provides a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, it implements the steps of any of the above-described dual-system image file processing methods.

[0009] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the above-described dual-system image file processing methods.

[0010] This application achieves uninterrupted file transfer and resumeable data transfer when the current operating system malfunctions. It immediately saves the file status and device status information of the image file being transferred to shared memory, retrieves and responds to the first system switch command, switches from the current operating system to the real-time operating system, retrieves the file status and device status information from shared memory based on the real-time operating system, establishes a target transfer path, and sends a transfer recovery request to the client based on the file status information. This allows the client to continue sending the image file to the real-time operating system based on the file status information. By using the real-time operating system to take over and restore the data before the malfunction when the current operating system malfunctions, it achieves uninterrupted file transfer and resumeable data transfer, avoids retransmissions caused by lost transfer progress, shortens transfer time, and improves file transfer efficiency. Attached Figure Description

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

[0012] Figure 1 This is a schematic diagram of the structure of the dual-system image file processing system on which the embodiments of this application are based; Figure 2 A flowchart illustrating the dual-system image file processing method provided in this application embodiment; Figure 3 A schematic diagram illustrating an exemplary dual-system image file processing structure provided for embodiments of this application; Figure 4 A flowchart illustrating an exemplary dual-system image file processing method provided in this application embodiment; Figure 5 This is a schematic diagram of the structure of the dual-system image file processing device provided in the embodiments of this application; Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0013] The technical solutions of the embodiments 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, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.

[0014] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.

[0015] Virtual media is one of the core functions of remote server management, allowing administrators to remotely mount image files and redirect storage devices through the baseboard management controller, enabling contactless operation and maintenance. With the popularization of cloud computing and edge computing, and the continuous expansion of data center scale, higher requirements are placed on the real-time performance and high availability of virtual media.

[0016] Existing virtual media technology requires, first, communication between the client and BMC. The client transmits image data to the BMC virtual media service via a specified protocol, such as a proprietary TCP-based protocol. Next, NBD device mapping occurs, where the BMC virtual media service writes the received data to its internal NBD device. USB LUN emulation is then performed, binding the NBD device to the USB LUN via the BMC Linux kernel module. Finally, server mounting occurs, where the server operating system recognizes the emulated USB LUN device and completes the image mounting process. The data link is: Image file -> Client -> TCP -> BMC virtual media service -> NBD -> USB LUN -> Server.

[0017] However, it suffers from the following drawbacks: Single-system dependency: The virtual media service runs entirely on BMC's Linux system. When Linux restarts due to upgrades or failures, the service is completely interrupted; Risk of state loss: Incomplete mount operations or transfer progress during restart cannot be saved, requiring the client to re-initiate requests. For example, when transferring a large image file, if BMC unexpectedly restarts midway, the client must start the transfer from the beginning, significantly increasing time costs; Insufficient real-time performance: In traditional solutions, the startup and switching of the virtual media service rely on the complete startup process of the Linux system, which cannot meet the requirements of high real-time scenarios.

[0018] To address the aforementioned technical problems, this application provides a method, apparatus, electronic device, and storage medium for processing dual-system image files. The method includes: upon detecting an anomaly in the current operating system, acquiring corresponding file status information and device status information for an image file being sent by any client; saving the metadata information, file status information, and device status information represented by the image file to shared memory; wherein both the current operating system and the real-time operating system have access permissions to the shared memory; upon successful saving of the file status information and device status information, acquiring a first system switching instruction; wherein the first system switching instruction is used to switch from the current operating system to the real-time operating system; responding to the first system switching instruction, switching from the current operating system to the real-time operating system according to the entry address of the real-time operating system; acquiring the file status information and device status information from the shared memory based on the real-time operating system; establishing a target transmission path based on the device status information; and sending a transmission recovery request to the client based on the file status information and the target transmission path, so that the client continues to send the image file to the real-time operating system according to the file status information.

[0019] The method provided by the above scheme, when the current operating system malfunctions, immediately saves the file status information and device status information of the image file being sent to shared memory, obtains and responds to the first system switch command, switches from the current operating system to the real-time operating system, obtains the file status information and device status information from shared memory based on the real-time operating system, establishes the target transmission path, and sends a transmission recovery request to the client according to the file status information and the target transmission path. This allows the client to continue sending the image file to the real-time operating system according to the file status information. By using the real-time operating system to take over and restore the data before the malfunction when the current operating system malfunctions, the method achieves uninterrupted file transmission and breakpoint resumption, avoids retransmission caused by loss of transmission progress, shortens transmission time, and improves file transmission efficiency.

[0020] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0021] The specific application environment architecture or specific hardware architecture on which the dual-system image file processing method depends is described here.

[0022] First, the structure of the dual-system image file processing system upon which this application is based will be described: The dual-system image file processing method, apparatus, electronic device, and storage medium provided in this application are suitable for transmitting image files during system switching. Figure 1The diagram shown illustrates the structure of a dual-system image file processing system based on an embodiment of this application. It mainly includes an image file to be transferred, a data acquisition device, and a dual-system image file processing device. The data acquisition device is used to acquire file status information and device status information of the image file. The dual-system image file processing device is used to implement the continued transfer of the image file during system switching, based on the dual-system image file method provided in this embodiment.

[0023] This application provides a method for processing dual-system image files, enabling the continued transfer of image files during system switching. The execution subject of this application is an electronic device, such as a server, desktop computer, laptop computer, tablet computer, or other electronic devices suitable for processing dual-system image files.

[0024] like Figure 2 The diagram shown is a flowchart illustrating a dual-system image file processing method provided in an embodiment of this application. The method includes: Step 201: If an abnormality is detected in the current operating system, obtain the corresponding file status information and device status information for any image file being sent by any client.

[0025] Specifically, the kernel typically runs a Linux system, meaning the current operating system can be Linux. Abnormalities in the current operating system include system upgrades or system failures. File status information indicates the progress of the image file being sent, allowing the real-time operating system to be aware of the file's transmission status. Device status information indicates the transmission path of the image file, including the network transmission devices and the receiving server.

[0026] Step 202: Save the metadata information, file status information and device status information represented by the image file to shared memory; wherein, both the current operating system and the real-time operating system have access to the shared memory.

[0027] Accordingly, by acquiring file status information and device status information, data is provided for the subsequent recovery of the real-time operating system. Preloading and shared memory technologies reduce service switching time.

[0028] Step 203: If the file status information and device status information are successfully saved, obtain the first system switching instruction; wherein, the first system switching instruction is used to switch from the current operating system to the real-time operating system.

[0029] Step 204: In response to the first system switching instruction, switch from the current operating system to the real-time operating system according to the entry address of the real-time operating system.

[0030] Specifically, the real-time operating system can be an RTOS. After successfully saving file and device state information, non-kernel programs are shut down. A hardware register-triggered operating system switching mechanism is used, achieving seamless switching between Linux and the RTOS through dedicated registers built into the BMC chip. Specifically, the first system switch instruction is sent via the write mode control register, the hardware automatically saves the CPU context, refreshes the memory management unit state, and jumps to the RTOS boot entry address. This process is entirely implemented by hardware logic and does not rely on software intervention.

[0031] Correspondingly, by switching to a more responsive real-time operating system in the event of an anomaly in the current operating system, the continued reception of image files and the response to server commands are achieved, avoiding interruption of image file transmission due to anomalies in the current operating system. At the same time, the use of a real-time operating system can achieve millisecond-level switching and can respond to commands quickly, ensuring the continuity of image file transmission.

[0032] Step 205: Based on the real-time operating system, obtain file status information and device status information in shared memory.

[0033] Step 206: Establish the target transmission path based on the device status information.

[0034] Specifically, after the RTOS boots, it first loads the NBD driver module, retrieves device and file status information from shared memory, and restores the device status and transfer progress. For any image file, based on the device status information, it binds the corresponding NBD device and USB LUN device paths and establishes the corresponding target transfer path.

[0035] Step 207: Based on the file status information and the target transmission path, send a transmission recovery request to the client so that the client can continue to send the image file to the real-time operating system according to the file status information.

[0036] Specifically, by transmitting a recovery request, the client can continue sending the image file from where it left off before the freeze, thus enabling breakpoint resume. The client protocol is extended to add a resume instruction code, such as 0xEE, and support the breakpoint resume flag and automatic session recovery mechanism.

[0037] Correspondingly, seamless state synchronization is achieved by switching from the current operating system to the real-time operating system. The real-time synchronization of the mount status, transmission progress and client sessions between Linux and RTOS ensures that users are unaware of and can switch without loss.

[0038] Based on the above embodiments, as an implementable approach, in one embodiment, when an abnormality in the current operating system is detected, for any image file being sent by a client, the corresponding file status information and device status information are obtained, including: Step 2011: If an abnormality is detected in the current operating system, for any image file being sent by a client, determine the file status information based on the file's starting address and transmission offset. Step 2012: Obtain the device number of the network transmission device for the image file, the transmission standard information of the network transmission device, and the device number of the server receiving end; wherein, the client sends the image file to the server receiving end through the network transmission device; Step 2013: Determine the device status information based on the device number of the network transmission device, the transmission standard information, and the device number of the server receiving end.

[0039] Specifically, the network transmission device includes an NBD device, and the server receiving end includes a USB controller. The image file is sent in the form of data blocks through the network transmission device and the server receiving end to the image file storage area on the server. The transmission standard information of the network transmission device includes the size of the data blocks to be transmitted.

[0040] When an abnormality is detected in the current operating system, for any image file being sent by a client, the corresponding unique identifier is determined, the state of the corresponding NBD device is immediately frozen, and a mapping relationship is established between the NBD device number, the current network transmission data block size, protocol information, and the USB LUN device number and the unique identifier of the image file, and they are all stored in shared memory.

[0041] For any given image file, the transmission progress is determined using the file's starting address and transmission offset. This allows the switched real-time operating system to send the current transmission progress to the client, which then continues sending the image file's data content based on this progress. The transmission offset is determined by the current transmission progress; it is the data block following the last data block transmitted by the current operating system.

[0042] Accordingly, the device number of the network transmission device is determined. The device number of the server receiving end stores the transmission path of the image file, laying the foundation for subsequent resume transmission. By storing the starting address and transmission offset of the image file, the loss of transmission progress due to system upgrades is avoided, allowing the real-time operating system to know the current transmission progress, thereby realizing the resumption of file transmission at breakpoints.

[0043] Based on the above embodiments, as an implementable approach, in one embodiment, the metadata information, file status information, and device status information represented by the image file are saved to shared memory, including: Step 2021: Send the metadata information of the image file to the shared memory cache. Step 2022: Send the file status information of the image file to the status area of ​​shared memory; Step 2023: Send the device status information of the image file to the configuration area of ​​shared memory.

[0044] Shared memory includes a state area, a configuration area, and a cache area.

[0045] Specifically, the shared memory includes a configuration area, a status area, and a cache area. The configuration area caches device status information, including static parameters such as the device number of the network transmission device corresponding to any image file, the corresponding transmission standard information, and the device of the receiving server. The status area stores the file status information of the image file, including its starting address and transmission offset, the status of the corresponding mounted device, and the unique identifier of the image file. The cache area stores the metadata information of the image file, including the FAT table, inodes, etc.

[0046] For example, such as Figure 3 The diagram shown is an exemplary structural diagram of dual-system image file processing provided in this application embodiment. The client sends the image file to the current operating system. Core 0 includes a Linux system and an RTOS system. Cores 1-n always run the Linux system. Under normal circumstances, both cores 0 and 1-n use the Linux system to process the image file. When the Linux system needs to be updated, the Linux system on cores 0-n stops using the Linux system, and core 0 switches to the RTOS system to process the image file. The RTOS system only provides lightweight NBD services, while the Linux system provides standard NBD services, including advanced functions such as data verification and compression. Both the Linux system and the RTOS system have access to shared memory, which includes a configuration area, a cache area, and a status area. The image file is sent to the NBD device through the client, then to the USB LUN, and finally to the image file storage area of ​​the server through the USB LUN.

[0047] Accordingly, by storing file status information and device status information in shared memory, the system can restore the most recently valid state in abnormal scenarios, maintain the integrity and consistency of the session context, and avoid reconstruction overhead.

[0048] Based on the above embodiments, as an implementable approach, in one embodiment, establishing a target transmission path according to device status information includes: Step 2061: For any image file, determine the target network transmission device based on the device number of the network transmission device represented by the device status information; Step 2062: Determine the target server receiver based on the device number of the server receiver as represented by the device status information; Step 2063: Establish the target transmission path based on the target network transmission device and the target server receiver.

[0049] Specifically, for any image file, the corresponding target network transmission device is determined based on the device number of the network transmission device, and the corresponding target server receiving end is determined based on the device number of the server receiving end. The corresponding target network transmission device and server receiving end are bound together, so that the image file is transmitted in the real-time operating system through the network transmission device and server receiving end, that is, the file is transferred through the target transmission path.

[0050] Correspondingly, by establishing a target transmission path, the transmission path of the image file transmission is restored, avoiding transmission failures caused by different transmission paths, and also avoiding the need to manually establish the transmission path, thus reducing the complexity of the operation.

[0051] Based on the above embodiments, as an implementable approach, in one embodiment, a transmission recovery request is sent to the client according to file status information and the target transmission path, so that the client continues to send the image file to the real-time operating system according to the file status information, including: Step 2071: For any image file, restore the transmitted portion of the image file in the real-time operating system based on metadata information and file status information; Step 2072: If the recovery is complete, a transmission recovery request is sent to the client based on the file status information and the target transmission path, so that the client can continue to send the untransmitted part of the image file to the real-time operating system based on the file status information; wherein, the image file includes the transmitted part and the untransmitted part.

[0052] Specifically, in one embodiment, the untransmitted portion of the image file sent by the client is obtained, and the real-time operating system sends the untransmitted portion of the image file to the server image file storage area according to the target transmission path.

[0053] Specifically, the RTOS, based on metadata and file status information, restores the transferred portion of the image file within the real-time operating system. Upon successful restoration, it sends the file transfer progress (file status information) and the target transfer path to the client via a transfer recovery request, instructing the client to resume data transfer from the breakpoint. In other words, the client sends the untransferred portion of the image file to the RTOS based on the file status information. Upon receiving the image file from the client, the RTOS sends the untransferred portion to the server's image file storage area according to the target transfer path. The RTOS independently handles all server read / write requests, responding to SCSI query commands through pre-loaded metadata. The USB LUN device remains online, and the server operating system is unaware of the switching process.

[0054] Correspondingly, by transmitting recovery requests, automatic resume transmission on the client side is achieved, eliminating manual intervention and reducing the complexity of operation and maintenance.

[0055] Based on the above embodiments, as an implementable approach, in one embodiment, the method further includes: Step 301: With the current operating system restored to normal, obtain the corresponding file status information and device status information for any image file being sent by any client; Step 302: Save the metadata information, file status information, and device status information represented by the image file to shared memory; Step 303: If the file status information and device status information are successfully saved, obtain the second system switching instruction; wherein, the second system switching instruction is used to switch from the real-time operating system to the current operating system; Step 304: In response to the second system switching instruction, switch from the real-time operating system to the current operating system according to the entry address of the current operating system; Step 305: Based on the current operating system, obtain file status information and device status information in shared memory; Step 306: Establish the target transmission path based on the device status information; Step 307: Based on the file status information and the target transmission path, send a transmission recovery request to the client so that the client can continue to send the image file to the current operating system according to the file status information.

[0056] Specifically, after the Linux system completes the upgrade or fault repair, it sends a recovery ready signal to the RTOS. The RTOS writes back parameters such as the transmission progress and device status updated during operation to the shared memory. If the file status information and device status information are successfully saved, a reverse switch is triggered through the mode control register to obtain the second system switch instruction. The hardware automatically saves the RTOS execution context and restores the Linux running environment. The Linux system reloads the standard NBD module, obtains the latest device status information and file status information from the shared memory, restores the corresponding target transmission path for any image file, and gradually restores advanced functions such as data verification and compression while maintaining the existing connection, ultimately achieving full service capability takeover.

[0057] Accordingly, by switching back from the real-time operating system to the current operating system, the closed-loop and complete system fault recovery process is achieved.

[0058] Specifically, in one embodiment, the core functions of the Linux system include complete NBD device management, creation of the / dev / nbdx device, implementation of a full block device interface, data verification via SHA-256, data compression via LZ4 real-time compression, freezing of the current device I / O state before system switching, and writing current mount parameters, transfer offsets, and other state data to shared memory via a synchronization interface, such as sync(), to ensure the RTOS can quickly resume service. It also preloads image metadata values ​​into a shared memory cache. The RTOS system includes a lightweight NBD device that only implements the read / write core functions, can maintain TCP client connections, handle all read / write requests, directly respond to SCSI commands from the USB LUN, and maintain transfer offsets using CPU atomic instructions.

[0059] Accordingly, atomic instructions ensure the consistency of data accessed by both systems, guarantee the synchronization of critical states, and thus keep the transmission progress complete and accurate, with no risk of data loss.

[0060] For example, such as Figure 4The diagram illustrates an exemplary dual-system image file processing method provided in this application. The real-time operating system (RTOS) is referred to as the Linux system. When maintenance or upgrades are required, the current operating system is determined to be abnormal, and its state is immediately frozen. File and device status information is acquired and saved to shared memory. If the saving is successful, a first system switch instruction is obtained, switching from the current operating system to the RTOS. The RTOS acquires the file and device status information from shared memory, establishes a target transmission path based on the device status information, and sends a transmission recovery request to the client, enabling the client to continue sending image files to the RTOS. After the Linux system completes the upgrade or fault repair, it sends a recovery-ready signal to the RTOS. The RTOS writes back parameters such as the updated transmission progress and session state to shared memory and triggers a reverse switch via the mode control register. The hardware automatically saves the RTOS execution context, restores the Linux operating environment, and the Linux system reloads the standard NBD module, acquiring the latest device status from shared memory. While maintaining the existing connection, advanced functions such as data verification and compression are gradually restored, ultimately achieving a complete service.

[0061] Specifically, in one embodiment, when core 0 boots, it first runs the RTOS system, loads a lightweight TCP service module, and listens for client connection requests. It initializes the shared memory region and reserves space for NBD device parameter configuration. The remaining cores boot Linux, and then the client software initiates a TCP connection request, establishing a communication session with the BMC via a dedicated protocol. At this time, core 0 is still in RTOS running mode, directly handling the connection process. Once Linux boots successfully, the trigger mode control register switches core 0 to the Linux system. After core 0 saves the RTOS execution context, it loads the Linux kernel and initializes the standard virtual media service module, including the NBD device driver and USB LUN module. The Linux system receives image data blocks transmitted by the client, writes them to the internally created NBD device, and simultaneously binds the NBD device to the USB LUN, presenting it as a removable storage device in the server operating system. The server operating system automatically recognizes the USB storage device, and the administrator can perform image mounting operations. Throughout this process, the client continuously transmits image data blocks on demand.

[0062] Specifically, in one embodiment, during the server operating system installation process, when the BMC system detects a Linux kernel upgrade event, or when the administrator confirms the start of the maintenance process, the Linux system, upon receiving the maintenance instruction, immediately suspends all ongoing I / O operations. The system writes key parameters such as the current transfer offset and client session ID to the shared memory state area via atomic operations. Non-core service processes are shut down, and preparation for environment switching is made by triggering a hardware-level switch by writing to the mode control register. The CPU automatically saves the Linux execution context to a dedicated storage area, refreshes the memory management unit state, and jumps to the RTOS boot entry address. The entire switching process is completed by hardware logic and takes very little time. After the RTOS starts, it first loads the simplified NBD service module and restores the device state and transfer progress from shared memory. The USB LUN device mapping is rebuilt, and a resume instruction containing the current offset is sent to the client. Upon receiving the instruction, the client automatically resumes data transfer from the breakpoint. The RTOS independently handles all server-side read / write requests, receives data blocks transmitted by the client, writes them to the NBD device, responds to server SCSI instructions, and maintains the online status of the USB device. The server operating system continuously identifies the storage device, and the installation process remains unaffected. After the Linux system completes the upgrade, the RTOS writes the updated transfer status back to shared memory. This triggers a reverse switch register, and kernel 0 restores the Linux operating environment. The Linux system reloads standard service modules, gradually enabling advanced features such as data verification and compression, ultimately taking full control of the services.

[0063] Specifically, in one embodiment, the system monitors CPU load, memory usage, I / O wait queue depth, and network session stability. When the CPU load continuously exceeds a preset load threshold and is accompanied by a significant increase in I / O latency, the system is determined to be in an overload critical state, which may lead to system crash or restart. An early warning is generated, and the system switching process is actively triggered to avoid system crash due to system overload, which could result in the loss of file transfer progress and thus achieve early warning.

[0064] The dual-system image file processing method provided in this application includes: when an abnormality is detected in the current operating system, obtaining corresponding file status information and device status information for an image file being sent by any client; saving the metadata information, file status information, and device status information represented by the image file to shared memory; wherein both the current operating system and the real-time operating system have access permissions to the shared memory; if the file status information and device status information are successfully saved, obtaining a first system switching instruction; wherein the first system switching instruction is used to switch from the current operating system to the real-time operating system; in response to the first system switching instruction, switching from the current operating system to the real-time operating system according to the entry address of the real-time operating system; obtaining the file status information and device status information in the shared memory based on the real-time operating system; establishing a target transmission path according to the device status information; and sending a transmission recovery request to the client according to the file status information and the target transmission path, so that the client continues to send the image file to the real-time operating system according to the file status information.

[0065] The method provided by the above scheme, when the current operating system malfunctions, immediately saves the file status information and device status information of the image file being sent to shared memory, obtains and responds to the first system switch command, switches from the current operating system to the real-time operating system, obtains the file status information and device status information from shared memory based on the real-time operating system, establishes the target transmission path, and sends a transmission recovery request to the client according to the file status information and the target transmission path. This allows the client to continue sending the image file to the real-time operating system according to the file status information. By using the real-time operating system to take over and restore the data before the malfunction when the current operating system malfunctions, the method achieves uninterrupted file transmission and breakpoint resumption, avoids retransmission caused by loss of transmission progress, shortens transmission time, and improves file transmission efficiency.

[0066] Furthermore, by acquiring file and device status information, data is provided for subsequent recovery of the real-time operating system. Preloading and shared memory technologies reduce service switching time. By switching to the more responsive real-time operating system in the event of an anomaly in the current operating system, continued reception of image files and response to server commands are achieved, preventing interruptions in image file transmission due to current operating system anomalies. Simultaneously, the use of a real-time operating system allows for millisecond-level switching and rapid command response, ensuring the continuity of image file transmission. Seamless state synchronization is achieved through the switch from the current operating system to the real-time operating system. Real-time synchronization of mount status, transmission progress, and client sessions between Linux and RTOS ensures a seamless and lossless switch for the user. By determining the device number of the network transmission device and the device number of the server receiving end, the transmission path of the image file is stored, laying the foundation for subsequent resumption of transmission. By storing the starting address and transmission offset of the image file, transmission progress loss due to system upgrades is avoided, allowing the real-time operating system to know the current transmission progress and thus enabling breakpoint resumption of file transmission. By storing file and device status information in shared memory, the system recovers the most recent valid state in abnormal scenarios, maintaining the integrity and consistency of the session context and avoiding reconstruction overhead. Establishing a target transmission path enables recovery of the transmission path for mirror file transfers, preventing transmission failures due to differing transmission paths and eliminating the need for manual path creation, thus reducing operational complexity. Automatic client-side resume transmission is achieved via transmission recovery requests, eliminating manual intervention and reducing operational complexity. Switching back from the real-time operating system to the current operating system ensures a closed-loop and complete system fault recovery process. Atomic instructions ensure data consistency between the two systems, guaranteeing the synchronization of critical states and maintaining accurate and complete transmission progress with no risk of data loss.

[0067] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.

[0068] The embodiments of this application also provide a dual-system image file processing apparatus for executing the dual-system image file processing method provided in the above embodiments.

[0069] like Figure 5The diagram shown is a structural schematic of a dual-system image file processing device provided in an embodiment of this application. The dual-system image file processing device 50 includes: a first acquisition module 501, a saving module 502, a second acquisition module 503, a switching module 504, a third acquisition module 505, a creation module 506, and a recovery module 507.

[0070] The system comprises the following modules: a first acquisition module, used to acquire file status information and device status information for any image file being sent by a client when an anomaly is detected in the current operating system; a saving module, used to save the metadata information, file status information, and device status information represented by the image file to shared memory; wherein both the current operating system and the real-time operating system have access permissions to the shared memory; a second acquisition module, used to acquire a first system switching instruction when the file status information and device status information are successfully saved; wherein the first system switching instruction is used to switch from the current operating system to the real-time operating system; a switching module, used to switch from the current operating system to the real-time operating system in response to the first system switching instruction, based on the entry address of the real-time operating system; a third acquisition module, used to acquire file status information and device status information from the shared memory based on the real-time operating system; an establishment module, used to establish a target transmission path based on the device status information; and a recovery module, used to send a transmission recovery request to the client based on the file status information and the target transmission path, so that the client can continue to send the image file to the real-time operating system based on the file status information.

[0071] Specifically, in one embodiment, the first acquisition module is further configured to: If an abnormality is detected in the current operating system, for any image file being sent by a client, the file status information is determined based on the file's starting address and transmission offset; the device number of the network transmission device, the transmission standard information of the network transmission device, and the device number of the server receiving end are obtained; wherein, the client sends the image file to the server receiving end through the network transmission device; the device status information is determined based on the device number of the network transmission device, the transmission standard information, and the device number of the server receiving end.

[0072] Specifically, in one embodiment, the storage module is further configured to: The image file's metadata information is sent to the shared memory's cache area; the image file's file status information is sent to the shared memory's status area; and the image file's device status information is sent to the shared memory's configuration area. The shared memory includes the status area, configuration area, and cache area.

[0073] Specifically, in one embodiment, the establishment module is further configured to: For any image file, determine the target network transmission device based on the device number of the network transmission device represented by the device status information; determine the target server receiver based on the device number of the server receiver represented by the device status information; and establish the target transmission path based on the target network transmission device and the target server receiver.

[0074] Specifically, in one embodiment, the recovery module is further configured to: For any image file, the transmitted portion of the image file is restored in the real-time operating system based on metadata and file status information. Once the restoration is complete, a transmission recovery request is sent to the client based on the file status information and the target transmission path, so that the client can continue to send the untransmitted portion of the image file to the real-time operating system based on the file status information. The image file includes both the transmitted and untransmitted portions.

[0075] Specifically, in one embodiment, the dual-system image file processing apparatus further includes: The fourth acquisition module is used to acquire the untransmitted portion of the image file sent by the client. The real-time operating system sends the untransmitted portion of the image file to the server image file storage area according to the target transmission path.

[0076] Specifically, in one embodiment, the dual-system image file processing apparatus further includes: The fifth acquisition module is used to acquire the corresponding file status information and device status information for any image file being sent by any client, provided that the current operating system has returned to normal. The information storage module is used to save the metadata information, file status information and device status information represented by the image file to shared memory; The sixth acquisition module is used to acquire the second system switching instruction after the file status information and device status information have been successfully saved; wherein the second system switching instruction is used to switch from the real-time operating system to the current operating system; The system switching module is used to respond to the second system switching command and switch from the real-time operating system to the current operating system according to the entry address of the current operating system; The seventh acquisition module is used to acquire file status information and device status information in shared memory based on the current operating system. The path establishment module is used to establish the target transmission path based on device status information; The transmission recovery module is used to send a transmission recovery request to the client based on the file status information and the target transmission path, so that the client can continue to send the image file to the current operating system according to the file status information.

[0077] For a description of the features in the embodiment corresponding to the dual-system image file processing device, please refer to the relevant description in the embodiment corresponding to the dual-system image file processing method, which will not be repeated here.

[0078] Embodiments of this application also provide an electronic device, such as... Figure 6 The diagram shown is a schematic diagram of the structure of an electronic device provided in an embodiment of this application, including a processor 10 and a memory 20. The memory 20 stores a computer program, and the processor 10 is configured to run the computer program to execute the steps in any of the above-described dual-system image file processing method embodiments.

[0079] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above embodiments of the dual-system image file processing method when running.

[0080] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.

[0081] The embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above embodiments of the dual-system image file processing method.

[0082] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above embodiments of the dual-system image file processing method.

[0083] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0084] The foregoing has provided a detailed description of a dual-system image file processing method, apparatus, electronic device, and storage medium provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only intended to aid in understanding the method and core ideas of this application. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of this application.

Claims

1. A method for processing dual-system image files, characterized in that, The method includes: If an abnormality is detected in the current operating system, obtain the corresponding file status information and device status information for any image file being sent by any client; The metadata information represented by the image file, the file status information, and the device status information are saved to shared memory; wherein both the current operating system and the real-time operating system have access to the shared memory; If the file status information and device status information are successfully saved, a first system switching instruction is obtained; wherein, the first system switching instruction is used to switch from the current operating system to the real-time operating system; In response to the first system switching command, the system switches from the current operating system to the real-time operating system according to the entry address of the real-time operating system. Based on a real-time operating system, the file status information and device status information are obtained in shared memory; Establish the target transmission path based on the device status information; Based on the file status information and the target transmission path, a transmission recovery request is sent to the client so that the client can continue to send the image file to the real-time operating system according to the file status information.

2. The dual-system image file processing method according to claim 1, characterized in that, In the event of a detected operating system anomaly, the method for obtaining corresponding file status information and device status information for any image file being sent by a client includes: If an abnormality is detected in the current operating system, for any image file being sent by a client, determine the file status information based on the file's starting address and transmission offset. The device number of the network transmission device, the transmission standard information of the network transmission device, and the device number of the server receiving end are obtained; wherein, the client sends the image file to the server receiving end through the network transmission device; The device status information is determined based on the device number of the network transmission device, the transmission standard information, and the device number of the server receiving end.

3. The dual-system image file processing method according to claim 1, characterized in that, The step of saving the metadata information represented by the image file, the file status information, and the device status information to shared memory includes: The metadata information of the image file is sent to the shared memory cache. Send the file status information of the image file to the status area of ​​the shared memory; The device status information of the image file is sent to the configuration area of ​​the shared memory; The shared memory includes a state area, a configuration area, and a cache area.

4. The dual-system image file processing method according to claim 2, characterized in that, The step of establishing a target transmission path based on the device status information includes: For any image file, the target network transmission device is determined based on the device number of the network transmission device represented by the device status information. The target server receiver is determined based on the device number of the server receiver as represented by the device status information. Establish the target transmission path based on the target network transmission device and the target server receiving end.

5. The dual-system image file processing method according to claim 1, characterized in that, The step of sending a transmission recovery request to the client based on the file status information and the target transmission path, so that the client can continue to send the image file to the real-time operating system based on the file status information, includes: For any image file, the transmitted portion of the image file is restored in the real-time operating system based on the metadata information and file status information; Upon successful recovery, a transmission recovery request is sent to the client based on the file status information and the target transmission path, enabling the client to continue sending the untransmitted portion of the image file to the real-time operating system according to the file status information; wherein, the image file includes the transmitted portion and the untransmitted portion.

6. The dual-system image file processing method according to claim 5, characterized in that, The method further includes: The untransmitted portion of the image file sent by the client is obtained, and the real-time operating system sends the untransmitted portion of the image file to the server image file storage area according to the target transmission path.

7. The dual-system image file processing method according to claim 1, characterized in that, The method further includes: Once the current operating system returns to normal, for any image file being sent by a client, obtain the corresponding file status information and device status information. The metadata information represented by the image file, the file status information, and the device status information are saved to shared memory; If the file status information and device status information are successfully saved, a second system switching instruction is obtained; wherein, the second system switching instruction is used to switch from the real-time operating system to the current operating system; In response to the second system switching command, the system switches from the real-time operating system to the current operating system based on the entry address of the current operating system. Based on the current operating system, the file status information and device status information are obtained from shared memory; Establish the target transmission path based on the device status information; Based on the file status information and the target transmission path, a transmission recovery request is sent to the client so that the client can continue to send the image file to the current operating system according to the file status information.

8. A dual-system image file processing device, characterized in that, The device includes: The first acquisition module is used to acquire the corresponding file status information and device status information for any image file being sent by any client when an abnormality is detected in the current operating system. A storage module is used to save the metadata information, file status information, and device status information represented by the image file to shared memory; wherein both the current operating system and the real-time operating system have access permissions to the shared memory; The second acquisition module is used to acquire a first system switching instruction when the file status information and device status information are successfully saved; wherein, the first system switching instruction is used to switch from the current operating system to the real-time operating system; The switching module is used to switch from the current operating system to the real-time operating system in response to the first system switching command, based on the entry address of the real-time operating system. The third acquisition module is used to acquire the file status information and device status information in shared memory based on the real-time operating system. A module is established to establish a target transmission path based on the device status information; The recovery module is used to send a transmission recovery request to the client based on the file status information and the target transmission path, so that the client can continue to send the image file to the real-time operating system based on the file status information.

9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the dual-system image file processing method as described in any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, it implements the steps of the dual-system image file processing method as described in any one of claims 1 to 7.