An overlay-based vehicle-mounted operating system restoration method and device

By configuring the random storage image file of the vehicle operating system in overlay mode, the problem of system failure recovery caused by software testing or upgrade of autonomous driving system is solved, realizing convenient system restoration and saving of modifications, and improving system stability.

CN115509625BActive Publication Date: 2026-11-27GUANGZHOU WERIDE TECH LTD CO
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211363208.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-02
Publication Date
2026-11-27
Estimated Expiration
2042-11-02

AI Technical Summary

Technical Problem

During the software testing or upgrade of autonomous driving systems, it is difficult to recover from system failures or negative impacts, and the necessity of saving and making each system modification effective is not met.

Method used

The system uses overlay mode to configure the random storage image file of the vehicle operating system. By determining whether to retain or clear system modifications, it merges or rolls back to the preset rollback partition to restore the system.

Benefits of technology

Modifications made during the development and testing of the isolated system can be easily restored to the initial state of the vehicle operating system, and system modifications can be saved for the next test, thereby improving system stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115509625B_ABST
    Figure CN115509625B_ABST
Patent Text Reader

Abstract

The application discloses an overlay-based vehicle-mounted operating system restoring method and device, and aims at solving the technical problem of how to restore the vehicle-mounted operating system when software testing or upgrading causes system failure or other negative effects. The application comprises the following steps: configuring a random storage mirror file of the vehicle-mounted operating system; starting the vehicle-mounted operating system in an overlay mode according to the random storage mirror file; when the vehicle-mounted operating system triggers software testing, judging whether to keep system modification for the vehicle-mounted operating system; if yes, merging a modification file into a preset rollback partition; rolling back according to data in the rollback partition; if no, clearing the modification file.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of system restoration technology, and in particular to a method and apparatus for restoring an in-vehicle operating system based on overlay. Background Technology

[0002] An automatic driving system (onboard operating system) refers to a train operation system where the driver's work is fully automated and highly centralized. Automatic driving systems possess functions such as automatic train wake-up and start-up, automatic entry and exit from the depot, automatic cleaning, automatic driving, automatic stopping, automatic door opening and closing, and automatic fault recovery. They also have multiple operating modes, including normal operation, degraded operation, and operation interruption. Automatic driving systems employ advanced communication, computer, network, and control technologies to achieve real-time and continuous control of the train. Using modern communication methods, directly interacting with the train, they enable two-way data communication between the train and the ground, with high transmission rates and large information volumes. This allows subsequent train tracking and the control center to promptly obtain the exact location of the preceding train, making operation management more flexible.

[0003] In real-world scenarios, before an autonomous driving system is officially launched, it needs to undergo extensive development and testing to iterate on the system environment and algorithms, thereby optimizing the autonomous driving system.

[0004] However, each software test of an autonomous driving system impacts its stability. Therefore, system recovery is crucial when a software test or upgrade causes system failure or other negative effects. Furthermore, for multiple consecutive software tests and upgrades, saving and applying each system change is essential. Summary of the Invention

[0005] This invention provides a method and apparatus for restoring an in-vehicle operating system based on overlay, which solves the technical problem of how to restore the in-vehicle operating system when software testing or upgrades cause system failures or other negative impacts.

[0006] This invention provides a method for restoring an in-vehicle operating system based on an overlay, comprising:

[0007] Configure the random storage image file of the vehicle operating system;

[0008] The vehicle operating system is started in overlay mode based on the randomly stored image file;

[0009] When the vehicle operating system triggers a software test, it determines whether to retain system modifications to the vehicle operating system.

[0010] If so, merge the modified files into the preset rollback partition;

[0011] Perform a rollback based on the data in the rollback partition;

[0012] If not, clear the modified file.

[0013] Optionally, the step of configuring the random storage image file of the vehicle operating system includes:

[0014] Check whether the partitions of the vehicle operating system meet the preset requirements;

[0015] If so, retrieve the configuration script;

[0016] The initial image file is updated according to the configuration script to obtain a randomly stored image file.

[0017] Optionally, the step of booting the vehicle operating system in overlay mode based on the random storage image file includes:

[0018] Determine if the overlay parameter exists in the preset startup items;

[0019] If it exists, obtain the specified system partition information from the random storage image file;

[0020] Determine whether the vehicle operating system has a system partition corresponding to the specified system partition information;

[0021] If they exist, create the first directory and the second directory in the memory file system of the vehicle operating system;

[0022] Obtain the root partition of the vehicle operating system and mount the root partition in read-only mode to the first directory, and mount the system partition to the second directory;

[0023] Create an overlay file system working directory;

[0024] Using the first directory as the image layer and the overlay file system working directory as the container layer, an overlay file system is generated and mounted to the root directory of the vehicle operating system. When the mounting is successful, it indicates that the vehicle operating system is started in overlay mode.

[0025] Optionally, the step of merging the modified files into the preset rollback partition includes:

[0026] The files in the image layer of the overlay file system and the modified files in the container layer are merged to obtain the merged file;

[0027] Export the merged file to a preset rollback partition;

[0028] Change the root directory location of the vehicle operating system to the rollback partition;

[0029] Restart the vehicle operating system and determine whether the vehicle operating system starts from the rollback partition;

[0030] If so, change the root directory location of the vehicle operating system to the overlay file system;

[0031] Restart the vehicle operating system and determine whether the vehicle operating system is started in overlay mode;

[0032] If so, the merge is successful, and a rollback flag file is created.

[0033] Optionally, the step of rolling back based on the data in the rollback partition includes:

[0034] Determine if the rollback flag file exists;

[0035] If it exists, change the root directory location of the vehicle operating system to the rollback partition and restart the vehicle operating system;

[0036] Determine whether the vehicle operating system starts from the rollback partition;

[0037] If so, change the root directory of the vehicle operating system to the overlay system and restart the vehicle operating system;

[0038] Determine whether the vehicle operating system is started in overlay mode;

[0039] If so, mark the rollback as successful and clear the rollback permission flag file.

[0040] Optionally, it also includes:

[0041] If the vehicle operating system is not started in overlay mode, then the overlay mode startup is marked as failed, and the rollback is marked as successful, and the rollback permission flag file is cleared.

[0042] Optionally, the step of clearing the modified file includes:

[0043] Remove the modified file from the container layer.

[0044] The present invention also provides an overlay-based vehicle operating system restoration device, comprising:

[0045] A random storage image file configuration module is used to configure the random storage image file of the vehicle operating system;

[0046] A startup module is used to start the vehicle operating system in overlay mode based on the randomly stored image file.

[0047] The retention judgment module is used to determine whether to retain system modifications to the vehicle operating system when the vehicle operating system triggers software testing.

[0048] The merge module is used to merge modified files into a preset rollback partition if necessary.

[0049] The rollback module is used to roll back the data in the rollback partition.

[0050] The clearing module is used to clear the modified file if no.

[0051] The present invention also provides an electronic device, the device comprising a processor and a memory:

[0052] The memory is used to store program code and transmit the program code to the processor;

[0053] The processor is used to execute the overlay-based vehicle operating system restoration method as described above, according to the instructions in the program code.

[0054] The present invention also provides a computer-readable storage medium for storing program code for executing the overlay-based vehicle operating system restoration method as described in any of the preceding claims.

[0055] As can be seen from the above technical solutions, the present invention has the following advantages: The present invention provides a method for restoring an in-vehicle operating system based on overlay, including: configuring a random storage image file of the in-vehicle operating system; starting the in-vehicle operating system in overlay mode according to the random storage image file; when the in-vehicle operating system triggers software testing, determining whether to retain system modifications to the operating system; if so, merging the modified files into a preset rollback partition and rolling back according to the data in the rollback partition; if not, clearing the modified files. The present invention records modifications to the in-vehicle operating system through overlay, thereby isolating modifications made to the in-vehicle operating system during system development and testing, and conveniently clearing system modifications, restoring the in-vehicle system to its initial state before system testing. Furthermore, the present invention can also save system modifications to the in-vehicle operating system through overlay for use in subsequent continuous testing. Attached Figure Description

[0056] To more clearly illustrate the technical solutions in the embodiments of the present invention 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 only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0057] Figure 1 A flowchart illustrating the steps of an overlay-based vehicle operating system restoration method provided in this embodiment of the invention;

[0058] Figure 2 A flowchart illustrating the steps of an overlay-based vehicle operating system restoration method according to another embodiment of the present invention;

[0059] Figure 3 A flowchart illustrating the startup of an in-vehicle operating system in overlay mode, provided as an embodiment of the present invention;

[0060] Figure 4 A schematic diagram illustrating the merging process of modifications to an in-vehicle operating system, provided as an embodiment of the present invention;

[0061] Figure 5 This is a schematic diagram of a rollback process for modifications made to an in-vehicle operating system, provided by an embodiment of the present invention.

[0062] Figure 6 This is a structural block diagram of an overlay-based vehicle operating system restoration device provided in an embodiment of the present invention. Detailed Implementation

[0063] This invention provides an overlay-based method and apparatus for restoring an in-vehicle operating system, which addresses the technical problem of how to restore the in-vehicle operating system when software testing or upgrades cause system failures or other negative impacts.

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

[0065] Please see Figure 1 , Figure 1 This is a flowchart illustrating the steps of an overlay-based vehicle operating system restoration method provided in an embodiment of the present invention.

[0066] The present invention provides a method for restoring an in-vehicle operating system based on an overlay, which may specifically include the following steps:

[0067] Step 101: Configure the random storage image file of the vehicle operating system;

[0068] In this embodiment of the invention, the randomly stored image file, which may be an initrd.img file, is used to record how the vehicle operating system starts in overlay mode.

[0069] In practice, the initrd.img file can be pre-configured as needed.

[0070] Step 102: Boot the vehicle operating system in overlay mode based on the random storage image file;

[0071] An overlay virtualizes a network on a basic network, enabling network operation without significant modifications to the underlying network and allowing separation from other network services. This invention's overlay constructs a file system on the vehicle operating system for recording, saving, and rolling back modifications made to the vehicle operating system.

[0072] After obtaining the random access image file, the vehicle operating system can be booted in overlay mode. This invention uses an overlay to record modifications made to the vehicle operating system, thereby isolating modifications made to the vehicle operating system during system development and testing. When it is necessary to restore the vehicle operating system, simply delete the modifications recorded on the overlay to restore the vehicle operating system to its state before the modifications occurred.

[0073] Step 103: When the vehicle operating system triggers software testing, determine whether to retain system modifications for the vehicle operating system.

[0074] Step 104: If yes, merge the modified files into the preset rollback partition;

[0075] Step 105: Roll back based on the data in the rollback partition;

[0076] Step 106: If not, clear the modified files.

[0077] Rollback refers to the act of restoring a program or data to its previous correct state when a program or data processing error occurs.

[0078] In real-world scenarios, autonomous driving systems require extensive development and testing before official deployment, involving iterative improvements to the system environment and algorithms to optimize the system. However, each software test impacts the stability of the autonomous driving system. Therefore, when the in-vehicle operating system triggers software testing, the decision to retain modifications to the operating system can be based on whether the testing causes system malfunctions or other negative impacts. If the software testing does not cause system malfunctions or other negative impacts, the system modifications to the in-vehicle operating system can be retained, and the modified files can be merged into a pre-defined rollback partition for subsequent rollback operations. If the software testing causes system malfunctions or other negative impacts, the system modifications can be cleared. Specifically, modified files in the overlay can be cleared.

[0079] This invention uses an overlay to record modifications made to the vehicle operating system, thereby isolating modifications made to the vehicle operating system during system development and testing. It also allows for easy clearing of system modifications, restoring the vehicle system to its initial state before testing. Furthermore, this invention can also use the overlay to save system modifications to the vehicle operating system for subsequent continuous testing.

[0080] Please see Figure 2 , Figure 2 A flowchart illustrating the steps of an overlay-based vehicle operating system restoration method according to another embodiment of the present invention. Specifically, it may include the following steps:

[0081] Step 201: Check whether the partitions of the vehicle operating system meet the preset requirements;

[0082] Step 202: If yes, obtain the configuration script;

[0083] Step 203: Update the initial image file according to the configuration script to obtain a random storage image file;

[0084] In this embodiment of the invention, an initial image file can be preset, and then the partition of the vehicle operating system can be checked to see if it meets the preset requirements. If so, a pre-configured script can be used to update the initial image file to obtain a random storage image file.

[0085] In practical implementation, a prerequisite requirement could be the presence of three partitions in the vehicle operating system, which serve as different partitions for the overlay. When the vehicle operating system has three partitions, a pre-configured script for generating the overlay can be used to update the initial image file (such as the initial initrd.img), thereby generating a random access image file that defines the overlay generation logic.

[0086] Furthermore, in this embodiment of the invention, a GRUB boot entry and a default boot entry can also be defined. These are used to determine whether to use a random storage image file to boot the vehicle operating system in overlay mode.

[0087] Step 204: Boot the vehicle operating system in overlay mode based on the random storage image file;

[0088] After obtaining the random storage image file, the vehicle operating system can be booted in overlay mode.

[0089] In one example, the steps of booting the in-vehicle operating system in overlay mode based on a random storage image file may include the following sub-steps:

[0090] S41, Determine whether the overlay parameter exists in the preset startup items;

[0091] S42, if it exists, retrieve the specified system partition information from the random access image file;

[0092] S43, determine whether the vehicle operating system has a system partition corresponding to the specified system partition information;

[0093] S44, if it exists, create the first directory and the second directory in the memory file system of the vehicle operating system;

[0094] S45, obtain the root partition of the vehicle operating system, mount the root partition in read-only mode to the first directory, and mount the specified system partition to the second directory;

[0095] S46, Create the working directory for the overlay file system;

[0096] S47: Using the first directory as the image layer and the overlay file system working directory as the container layer, an overlay file system is generated and mounted to the root directory of the vehicle operating system. When the mounting is successful, it indicates that the vehicle operating system is started in overlay mode.

[0097] like Figure 3 As shown, Figure 3 This is a flowchart illustrating how to start an in-vehicle operating system in overlay mode, as provided in an embodiment of the present invention.

[0098] like Figure 3As shown, the process begins by determining whether the Linux boot parameters in the GRUB boot entry specify an overlay boot for the operating system. If not, the vehicle operating system boots normally. If so, the specified system partition information is retrieved from the random access image file. Next, it's determined whether the system partition specified by the specified system partition information exists within the vehicle operating system. If it does, a first directory (e.g., " / ro") and a second directory (e.g., "diff") are created within the vehicle operating system's memory file system (e.g., the root file system). The root partition of the vehicle operating system is then mounted read-only to the first directory, and the system partition specified in the random access image file is mounted to the second directory. Next, an overlay file system working directory (e.g., " / diff / upper") is created. Using the first directory as the image layer (lower layer) and the overlay file system working directory as the container layer (upper layer), the overlay file system is generated. After generating the overlay file system, it is mounted to the root directory of the vehicle operating system. Successful mounting indicates that the vehicle operating system has been successfully booted in overlay mode. When mounting fails, it indicates that the vehicle operating system failed to start in overlay mode. In this case, start the vehicle operating system in the normal way.

[0099] Step 205: When the vehicle operating system triggers software testing, determine whether to retain system modifications for the vehicle operating system.

[0100] Step 206: If yes, merge the modified files into the preset rollback partition;

[0101] In this embodiment of the invention, when it is necessary to retain system modifications to the vehicle operating system, the modifications to the vehicle system can be merged into the rollback partition.

[0102] In one example, the step of merging modified files into a preset rollback partition may include the following sub-steps:

[0103] S61, merge the files in the image layer of the overlay file system and the modified files in the container layer to obtain the merged file;

[0104] S62, export the merged file to the preset rollback partition;

[0105] S63 changes the root directory location of the vehicle operating system to the rollback partition;

[0106] S64, restart the vehicle operating system, and determine whether the vehicle operating system starts from the rollback partition;

[0107] If it is an S65, change the root directory of the vehicle operating system to the overlay file system.

[0108] S66, restart the vehicle operating system and determine whether the vehicle operating system is started in overlay mode;

[0109] S67, if so, indicates successful merge and creates a rollback flag file.

[0110] like Figure 4 As shown, when it's necessary to retain system modifications to the vehicle operating system, the first step is to determine if the vehicle operating system boots in overlay mode. If not, there's no need to merge the modifications. If so, merge the files in the lower layer and the modified files in the upper layer of the overlay file system, and then export the merged file to the preset rollback partition " / backup". Next, modify the `mount` entry in `etc / fstab` under the " / backup" directory, change the root directory of the vehicle operating system to the rollback partition " / backup", and update the GRUB boot entry, setting the default boot entry and the fallback boot entry. Then, restart the vehicle operating system and determine if it boots from " / backup". If not, the merge failed, and the merge operation ends. If so, set overlay mode as the default boot entry, that is, change the root directory of the vehicle operating system to the overlay file system, and restart the vehicle operating system. When the vehicle operating system restarts in overlay mode, the merge is successful. At this point, a rollback flag file can be created for subsequent rollback operations. If the vehicle operating system fails to boot successfully in overlay mode, then mark the overlay mode boot as failed, mark the merge as successful, create a rollback flag file, and combine it with the merge operation.

[0111] Step 207: Roll back based on the data in the rollback partition;

[0112] In this embodiment of the invention, the step of rolling back based on data in the rollback partition may include the following sub-steps:

[0113] S71, determine if a rollback flag file exists;

[0114] S72, if it exists, change the root directory of the vehicle operating system to the rollback partition and restart the vehicle operating system;

[0115] S73 determines whether the vehicle operating system is booting from the rollback partition;

[0116] S74, if so, change the root directory of the vehicle operating system to the overlay system and restart the vehicle operating system;

[0117] S75 determines whether the vehicle operating system is started in overlay mode;

[0118] S76, if so, mark the rollback as successful and clear the rollback permission flag file;

[0119] S77: If the vehicle operating system is not started in overlay mode, then mark the overlay mode startup as failed and mark the rollback as successful, and clear the rollback permission flag file.

[0120] like Figure 5 As shown, if the rollback flag file does not exist in the rollback partition, no rollback operation is performed. If the rollback flag file exists in the rollback partition, the root directory of the vehicle operating system is changed to the rollback partition, then the GRUB boot entry is updated, the default boot entry and fallback boot entry are set, and the vehicle operating system is restarted. If the vehicle operating system does not restart from the rollback partition " / backup", it indicates that the rollback has failed; if the vehicle operating system restarts from the rollback partition " / backup", the GRUB boot entry is updated, then the overlay mode is set as the default boot entry, and the vehicle operating system is restarted. If the vehicle operating system boots from overlay mode upon restart, it indicates that the rollback has succeeded, and the rollback flag file can be cleared at this point. If the vehicle operating system does not boot from overlay mode, the overlay mode boot is marked as failed, and the rollback is marked as successful, the rollback flag file is cleared, and the rollback operation ends.

[0121] Step 208: If not, clear the modified files.

[0122] In this embodiment of the invention, when it is not necessary to retain system modifications to the vehicle operating system, the modified files can be cleared from the overlay container layer upper, and the vehicle operating system can be restored to its state before the modifications were made.

[0123] This invention uses an overlay to record modifications made to the vehicle operating system, thereby isolating modifications made to the vehicle operating system during system development and testing. It also allows for easy clearing of system modifications, restoring the vehicle system to its initial state before testing. Furthermore, this invention can also use the overlay to save system modifications to the vehicle operating system for subsequent continuous testing.

[0124] Please see Figure 6 , Figure 6 This is a structural block diagram of an overlay-based vehicle operating system restoration device provided in an embodiment of the present invention.

[0125] This invention provides an overlay-based vehicle operating system restoration device, comprising:

[0126] Random storage image file configuration module 601 is used to configure the random storage image file of the vehicle operating system;

[0127] The boot module 602 is used to boot the vehicle operating system in overlay mode based on the random storage image file;

[0128] The retention judgment module 603 is used to determine whether to retain system modifications to the vehicle operating system when the vehicle operating system triggers software testing.

[0129] Merge module 604 is used to merge modified files into a preset rollback partition if necessary.

[0130] Rollback module 605 is used to roll back based on the data in the rollback partition;

[0131] Clear module 606 is used to clear modified files if no changes are made.

[0132] In this embodiment of the invention, the random storage image file configuration module 601 includes:

[0133] The inspection submodule is used to check whether the partitions of the vehicle operating system meet the preset requirements;

[0134] The configuration script retrieves the submodule, which is used to retrieve the configuration script if necessary.

[0135] The random storage image file generation submodule is used to update the initial image file according to the configuration script to obtain the random storage image file.

[0136] In this embodiment of the invention, the startup module 602 includes:

[0137] The overlay parameter determination submodule is used to determine whether the overlay parameter exists in the preset startup item;

[0138] The specified system partition information retrieval submodule is used to retrieve the specified system partition information from the random storage image file if it exists.

[0139] The system partition determination submodule is used to determine whether the vehicle operating system has a system partition corresponding to the specified system partition information;

[0140] The first and second directories create submodules, which, if they exist, are used to create the first and second directories in the memory file system of the vehicle operating system.

[0141] The mount submodule is used to obtain the root partition of the vehicle operating system, mount the root partition in read-only mode to the first directory, and mount the system partition to the second directory;

[0142] The overlay file system working directory creation submodule is used to create the overlay file system working directory.

[0143] The overlay file system generation submodule is used to generate an overlay file system using the first directory as the image layer and the overlay file system working directory as the container layer. The overlay file system is then mounted to the root directory of the vehicle operating system. When the mounting is successful, it indicates that the vehicle operating system is started in overlay mode.

[0144] In this embodiment of the invention, the merging module 604 includes:

[0145] The merge file generation submodule is used to merge files in the image layer of the overlay file system and modified files in the container layer to obtain a merged file;

[0146] The export submodule is used to export the merged files to a preset rollback partition;

[0147] The first root directory location change submodule is used to change the root directory location of the vehicle operating system to the rollback partition.

[0148] The first boot judgment submodule is used to restart the vehicle operating system and determine whether the vehicle operating system starts from the rollback partition.

[0149] The second root directory location change submodule is used to change the root directory location of the vehicle operating system to the overlay file system if necessary.

[0150] The second startup judgment submodule is used to restart the vehicle operating system and determine whether the vehicle operating system is started in overlay mode.

[0151] A submodule is created to indicate that the merge was successful and to create a rollback flag file if the merge is successful.

[0152] In this embodiment of the invention, the rollback module 605 includes:

[0153] The rollback flag file determination submodule is used to determine whether a rollback flag file exists.

[0154] The third root directory location change submodule is used to change the root directory location of the vehicle operating system to the rollback partition and restart the vehicle operating system if it exists.

[0155] The third startup judgment submodule is used to determine whether the vehicle operating system starts from the rollback partition.

[0156] The fourth root directory location change submodule is used to change the root directory location of the vehicle operating system to the overlay system and restart the vehicle operating system if necessary.

[0157] The fourth startup determination submodule is used to determine whether the vehicle operating system is started in overlay mode;

[0158] The first rollback flag file clearing submodule is used to mark a successful rollback and clear the rollback flag file if the rollback is successful.

[0159] In this embodiment of the invention, the rollback module 605 further includes:

[0160] The second rollback flag file clearing submodule is used to mark overlay mode startup failure and rollback success if the vehicle operating system is not started in overlay mode, and clear the rollback flag file.

[0161] In this embodiment of the invention, the clearing module 606 includes:

[0162] The cleanup submodule is used to remove modified files from the container layer.

[0163] This invention also provides an electronic device, which includes a processor and a memory:

[0164] The memory is used to store program code and transfer the program code to the processor;

[0165] The processor is used to execute the overlay-based vehicle operating system restoration method of this invention according to the instructions in the program code.

[0166] This invention also provides a computer-readable storage medium for storing program code, which is used to execute the overlay-based vehicle operating system restoration method of this invention.

[0167] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0168] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0169] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, apparatus, or computer program products. Therefore, embodiments of the present invention can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of the present invention can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0170] Embodiments of the present invention are described with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0171] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0172] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0173] Although preferred embodiments of the present invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present invention.

[0174] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device 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 terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.

[0175] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention 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 the present invention.

Claims

1. A method for restoring an in-vehicle operating system based on overlay, characterized in that, include: Configure the random storage image file of the vehicle operating system; The vehicle operating system is started in overlay mode based on the randomly stored image file; When the vehicle operating system triggers a software test, it determines whether to retain system modifications to the vehicle operating system. If so, merge the modified files into the preset rollback partition; Perform a rollback based on the data in the rollback partition; If not, clear the modified file; The step of merging the modified files into the preset rollback partition includes: Merge files in the image layer of the overlay file system and modified files in the container layer to obtain a merged file; Export the merged file to a preset rollback partition; Change the root directory location of the vehicle operating system to the rollback partition; Restart the vehicle operating system and determine whether the vehicle operating system starts from the rollback partition; If so, change the root directory location of the vehicle operating system to the overlay file system; Restart the vehicle operating system and determine whether the vehicle operating system is started in overlay mode; If so, the merge is successful, and a rollback flag file is created; The step of rolling back based on the data in the rollback partition includes: Determine if the rollback permission flag file exists; If it exists, change the root directory location of the vehicle operating system to the rollback partition and restart the vehicle operating system; Determine whether the vehicle operating system starts from the rollback partition; If so, change the root directory of the vehicle operating system to the overlay file system and restart the vehicle operating system; Determine whether the vehicle operating system is started in overlay mode; If so, mark the rollback as successful and clear the rollback permission flag file.

2. The method according to claim 1, characterized in that, The step of configuring the random storage image file of the vehicle operating system includes: Check whether the partitions of the vehicle operating system meet the preset requirements; If so, retrieve the configuration script; The initial image file is updated according to the configuration script to obtain a randomly stored image file.

3. The method according to claim 2, characterized in that, The step of booting the vehicle operating system in overlay mode based on the random storage image file includes: Determine if the overlay parameter exists in the preset startup items; If it exists, obtain the specified system partition information from the random storage image file; Determine whether the vehicle operating system has a system partition corresponding to the specified system partition information; If they exist, create the first directory and the second directory in the memory file system of the vehicle operating system; Obtain the root partition of the vehicle operating system and mount the root partition in read-only mode to the first directory, and mount the system partition to the second directory; Create an overlay file system working directory; Using the first directory as the image layer and the overlay file system working directory as the container layer, an overlay file system is generated and mounted to the root directory of the vehicle operating system. When the mounting is successful, it indicates that the vehicle operating system is started in overlay mode.

4. The method according to claim 1, characterized in that, Also includes: If the vehicle operating system is not started in overlay mode, then the overlay mode startup is marked as failed, and the rollback is marked as successful, and the rollback permission flag file is cleared.

5. The method according to any one of claims 3-4, characterized in that, The step of clearing the modified file includes: Remove the modified file from the container layer.

6. A vehicle operating system restoration device based on overlay, characterized in that, include: A random storage image file configuration module is used to configure the random storage image file of the vehicle operating system; A startup module is used to start the vehicle operating system in overlay mode based on the randomly stored image file. The retention judgment module is used to determine whether to retain system modifications to the vehicle operating system when the vehicle operating system triggers software testing. The merge module is used to merge modified files into a preset rollback partition if necessary. The rollback module is used to roll back the data in the rollback partition. The clearing module is used to clear the modified file if no; The merging module includes: The merge file generation submodule is used to merge files in the image layer of the overlay file system and modified files in the container layer to obtain a merged file; The export submodule is used to export the merged files to a preset rollback partition; The first root directory location change submodule is used to change the root directory location of the vehicle operating system to the rollback partition. The first boot judgment submodule is used to restart the vehicle operating system and determine whether the vehicle operating system starts from the rollback partition. The second root directory location change submodule is used to change the root directory location of the vehicle operating system to the overlay file system if necessary. The second startup judgment submodule is used to restart the vehicle operating system and determine whether the vehicle operating system is started in overlay mode. The rollback flag file creates a submodule that indicates a successful merge if the merge is successful and creates the rollback flag file. The rollback module includes: The rollback flag file determination submodule is used to determine whether a rollback flag file exists; The third root directory location change submodule is used to change the root directory location of the vehicle operating system to the rollback partition and restart the vehicle operating system if it exists. The third startup judgment submodule is used to determine whether the vehicle operating system starts from the rollback partition; The fourth root directory location change submodule is used to change the root directory location of the vehicle operating system to the overlay file system and restart the vehicle operating system if necessary. The fourth startup determination submodule is used to determine whether the vehicle operating system is started in overlay mode; The first rollback flag file clearing submodule is used to mark a successful rollback and clear the rollback flag file if the rollback is successful.

7. An electronic device, characterized in that, The device includes a processor and a memory: The memory is used to store program code and transmit the program code to the processor; The processor is used to execute the overlay-based vehicle operating system restoration method according to any one of the instructions in the program code.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store program code for executing the overlay-based vehicle operating system restoration method according to any one of claims 1-5.

Citation Information

Patent Citations

  • Operating system snapshot implementation method based on Overlay file system

    CN107590272A