Differential upgrading method and device for root file system of embedded system, medium and equipment

By creating a pre-upgrade directory and registering a partition file system in an embedded system, upgrading the image according to the configuration file, and generating differential configuration files, the differential package size and complexity problems in the differential upgrade of the root file system of the embedded system are solved, and efficient Low-cost upgrade process.

CN118916046APending Publication Date: 2024-11-08XIAN WANXIANG ELECTRONICS TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411162968.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-23
Publication Date
2024-11-08

AI Technical Summary

Technical Problem

In the prior art, there is a complex binary image file differential algorithm for differential upgrade of embedded system root file system. The differential package size may be larger than the target image file, and multiple differential packages need to be made according to different versions, resulting in low upgrade efficiency and High cost.

Method used

Create a pre-upgrade directory in the root file system, transfer the upgrade package and decompress it, register the partition file system, upgrade the image according to the configuration files of non-root file systems and root file systems, generate different configuration files, copy and compress the upgrade package, and realize the root Differential upgrade of file system.

Benefits of technology

This method realizes efficient differential upgrade of the root file system, reduces the size and upgrade cost of differential packages, simplifies the upgrade process, and avoids the complexity of multi-version differential packages.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118916046A_ABST
    Figure CN118916046A_ABST
Patent Text Reader

Abstract

The invention relates to a differential upgrading method and device for a root file system of an embedded system, a medium and equipment. Comprising the following steps: creating a pre-upgrade directory at a mounting point in a root file system, transmitting an upgrade package to the pre-upgrade directory, and decompressing the upgrade package; wherein the upgrade package comprises a non-root file system mirror image, a differential upgrade file of a root file system and a configuration file; executing a restart upgrading command; registering a partition file system of the root file system, and respectively reading a non-root file system mirror image, a differential upgrading file of the root file system and a configuration file from the decompressed upgrading package; according to the upgrading initial address of the non-root file system mirror image in the configuration file of the non-root file system and the corresponding mirror image file name, upgrading the non-root file system mirror image; and upgrading the root file system according to the file path of the differential upgrading file of the root file system in the differential configuration file and the executed action, and restarting the embedded system after the upgrading is completed. By means of the method, differential upgrading of the root file system can be achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] With the rapid development of embedded product equipment, the root file system adopts the read-write mode in the early stage of software development of embedded products and even in the final factory software of the product. The read-write mode of the root file system generally adopts the ext4 format. The advantage of using the ext4 file format is that it is convenient for R&D personnel to debug and quickly modify faults, and it is convenient for testers to integrate test tools and develop test programs. The read-write mode of the root file system also has great advantages in the test iteration of the demander, such as being able to quickly modify executable files or configuration files, verify the repair of faults, etc. For the verification of a certain fault, it can be quickly verified by replacing individual files. However, for the upgrade of all the repair versions that can modify the fault in the fault version, it is generally necessary to fully upgrade the root file system image to prevent omissions and errors.

[0003] To address this problem, the existing differential algorithm may require differential processing of the binary file of the image, and the differential effect may also vary. Sometimes, the size of the differential package and the upgrade image file is almost the same. There is also a very serious problem with binary differential packages. Different differential packages need to be made into different differential packages corresponding to different versions. When there are many versions, the differential package may only provide upgrades for some versions, and then finally upgrade to the latest version through step-by-step or skip-level upgrades, or even some versions cannot be upgraded. It may also involve the phenomenon that the differential package and the corresponding pre-upgrade version are restored to a new binary image file for upgrading. For the upgrade method of the root file system, differential upgrade is generally not used. The reasons for not using differential upgrade may be: 1. The differential algorithm of the binary image file is relatively complex, and generally requires the use of a professional commercial differential algorithm solution. 2. The differential package file of the binary image file is closely related to the differential algorithm and version. The size of the differential package may be larger or equivalent to the target image file. In this case, the advantage of differential upgrade has been lost, and additional commercial budget needs to be paid. 3. Differential upgrade packages need to be produced according to different versions. You may need to produce too many differential packages, or only meet the upgrade of some versions.

[0004] Therefore, it is necessary to provide a new technical solution to improve one or more problems existing in the above solutions.

[0005] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present application, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention

[0006] The purpose of the present application is to provide a method, apparatus, medium and device for differentially upgrading a root file system of an embedded system, thereby overcoming one or more problems caused by limitations and defects of related technologies at least to a certain extent.

[0007] According to a first aspect of an embodiment of the present application, a method for differentially upgrading a root file system of an embedded system is provided, the method comprising:

[0008] Create a pre-upgrade directory at the mount point in the root file system, transfer the upgrade package to the pre-upgrade directory, and decompress it; wherein the upgrade package includes a non-root file system image, a differential upgrade file of the root file system, and a configuration file, the configuration file includes a configuration file of the non-root file system and a differential configuration file of the root file system, the configuration file of the non-root file system includes an upgrade start address of the non-root file system image and a corresponding image file name, and the differential configuration file of the root file system includes a file path of the differential upgrade file of the root file system and an executed action;

[0009] Execute the restart upgrade command;

[0010] Registering the partition file system of the root file system, and reading the non-root file system image, the differential upgrade file of the root file system and the configuration file from the decompressed upgrade package respectively;

[0011] Upgrading the non-root file system image according to the upgrade start address of the non-root file system image and the corresponding image file name in the configuration file of the non-root file system;

[0012] The root file system is upgraded according to the file path of the differential upgrade file of the root file system in the differential configuration file of the root file system and the executed action, and the embedded system is restarted after the upgrade is completed.

[0013] In an embodiment of the present application, the upgrade package is generated by the following steps:

[0014] Generate a difference configuration file based on recursive comparison between version files of the root file system;

[0015] Copy the differential upgrade file and the differential configuration file to the pre-upgrade file directory;

[0016] And, copying the non-root file system image and the corresponding configuration file to the pre-upgrade file directory;

[0017] The pre-upgrade file directory is compressed to generate the upgrade package.

[0018] In an embodiment of the present application, the recursive comparison between the version files of the root file system is performed to generate a difference configuration file, and the difference upgrade file and the difference configuration file are copied to the pre-upgrade file directory, including:

[0019] Recursively compare the new version target directory of the root file system with the previous version target directory to generate adjacent version configuration files;

[0020] Compare the adjacent version configuration file with the last full version configuration file to generate a new full version configuration file;

[0021] Determining whether to preset only the new full-version configuration file;

[0022] If so, copy the differential upgrade file and the new full-version configuration file to the pre-upgrade file directory.

[0023] In an embodiment of the present application, the determining whether to only preset the new full-version configuration file includes:

[0024] If not, generate a difference configuration file between the pre-upgrade version and all previous versions;

[0025] The differential upgrade file and all the difference configuration files in the new full-version configuration file are copied to the pre-upgrade file directory.

[0026] In an embodiment of the present application, the file path of the differential upgrade file of the root file system in the configuration file and the action to be performed, upgrading the root file system, and restarting the embedded system after the upgrade is completed, include:

[0027] Writing the pre-added differential upgrade file in the root file system into the currently registered partition file system, and deleting the pre-deleted differential upgrade file in the root file system;

[0028] Alternatively, a differential upgrade file pre-added in the root file system is created, and a differential upgrade file pre-deleted in the root file system is deleted.

[0029] According to a second aspect of an embodiment of the present application, there is provided an embedded system root file system differential upgrade device, the device comprising:

[0030] A creation module, used to create a pre-upgrade directory at a mount point in a root file system, transfer an upgrade package to the pre-upgrade directory, and decompress it; wherein the upgrade package includes a non-root file system image, a differential upgrade file of the root file system, and a configuration file; the configuration file includes a configuration file of the non-root file system and a differential configuration file of the root file system; the configuration file of the non-root file system includes an upgrade start address of the non-root file system image and a corresponding image file name; the differential configuration file of the root file system includes a file path of the differential upgrade file of the root file system and an executed action;

[0031] Restart upgrade module, used to execute restart upgrade command;

[0032] A registration and reading module, used for registering the partition file system of the root file system, and reading the non-root file system image, the differential upgrade file of the root file system and the configuration file from the decompressed upgrade package respectively;

[0033] A first upgrade module, configured to upgrade the non-root file system image according to the upgrade start address of the non-root file system image and the corresponding image file name in the configuration file of the non-root file system;

[0034] The second upgrade module is used to upgrade the root file system according to the file path of the differential upgrade file of the root file system in the differential configuration file of the root file system and the executed action, and restart the embedded system after the upgrade is completed.

[0035] In an embodiment of the present application, the creation module includes:

[0036] A comparison generation module, used for generating a difference configuration file based on recursive comparison between version files of the root file system;

[0037] A first copy module, used for copying the differential upgrade file and the differential configuration file to a pre-upgrade file directory;

[0038] and, a second copy module, for copying the non-root file system image and the corresponding configuration file to the pre-upgrade file directory;

[0039] A compression module is used to compress the pre-upgrade file directory to generate the upgrade package.

[0040] In an embodiment of the present application, the device further includes:

[0041] A first comparison submodule is used to recursively compare the new version target directory of the root file system with the previous version target directory to generate adjacent version configuration files;

[0042] A second comparison submodule is used to compare the adjacent version configuration file with the last full version configuration file to generate a new full version configuration file;

[0043] A judging module, used for judging whether to preset only the new full-version configuration file;

[0044] The first judgment submodule is used to copy the differential upgrade file and the new full-version configuration file to the pre-upgrade file directory if yes.

[0045] According to a third aspect of the embodiments of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the steps of the embedded system root file system differential upgrade method described in any one of the above embodiments are implemented.

[0046] According to a fourth aspect of an embodiment of the present application, there is provided an electronic device, including:

[0047] Processor; and

[0048] A memory, configured to store executable instructions of the processor;

[0049] The processor is configured to execute the steps of the embedded system root file system differential upgrade method in any one of the above embodiments by executing the executable instructions.

[0050] The technical solution provided by the embodiments of the present application may have the following beneficial effects:

[0051] In one embodiment of the present application, through the above method, by creating a pre-upgrade directory at the mount point in the root file system, transferring the upgrade package to the pre-upgrade directory, executing the restart upgrade command, registering the partition file system of the root file system, reading the non-file system image, the differential upgrade file and the configuration file of the root file system from the decompressed upgrade package respectively, upgrading the root file system according to the file path of the differential upgrade file in the differential configuration file of the root file system and the executed action, and restarting the embedded system after the upgrade is completed. Through this method, the differential upgrade of the root file system can be realized.

[0052] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0054] Figure 1 A flowchart schematically showing the steps of differential upgrade of the root file system of an embedded system in an exemplary embodiment of the present application;

[0055] Figure 2 A schematic diagram schematically illustrates the composition of a program product in an exemplary embodiment of the present application;

[0056] Figure 3 A flowchart schematically showing the steps of generating an upgrade package in an exemplary embodiment of the present application;

[0057] Figure 4 A flowchart schematically showing the processing steps of a configuration file in an exemplary embodiment of the present application;

[0058] Figure 5 A block diagram schematically shows a differential upgrade device for a root file system of an embedded system in an exemplary embodiment of the present application;

[0059] Figure 6 A schematic diagram of an electronic device in an exemplary embodiment of the present application is schematically shown. DETAILED DESCRIPTION

[0060] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more comprehensive and complete and fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.

[0061] In addition, the accompanying drawings are only schematic illustrations of the present application and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.

[0062] This example implementation first provides a method for differentially upgrading the root file system of an embedded system. Figure 1As shown in , the method includes: steps S101 to S104.

[0063] Step S101: Create a pre-upgrade directory at a mount point in the root file system, transfer the upgrade package to the pre-upgrade directory, and decompress it; wherein the upgrade package includes a non-root file system image, a differential upgrade file and a configuration file of the root file system, the configuration file includes a configuration file of the non-root file system and a differential configuration file of the root file system, the configuration file of the non-root file system includes an upgrade start address of the non-root file system image and a corresponding image file name, and the differential configuration file of the root file system includes a file path of a differential upgrade file of the root file system and an executed action.

[0064] Step S102: Execute the restart upgrade command.

[0065] Step S103: register the partition file system of the root file system, and read the non-root file system image, the differential upgrade file of the root file system and the configuration file from the decompressed upgrade package.

[0066] Step S104: Upgrading the non-root file system image according to the upgrade start address of the non-root file system image and the corresponding image file name in the configuration file of the non-root file system.

[0067] Step S105: upgrading the root file system according to the file path of the differential upgrade file of the root file system in the differential configuration file of the root file system and the executed action, and restarting the embedded system after the upgrade is completed.

[0068] In one embodiment of the present application, through the above method, by creating a pre-upgrade directory at the mount point in the root file system, transferring the upgrade package to the pre-upgrade directory, executing the restart upgrade command, registering the partition file system of the root file system, reading the non-file system image, the differential upgrade file and the configuration file of the root file system from the decompressed upgrade package respectively, upgrading the root file system according to the file path of the differential upgrade file in the differential configuration file of the root file system and the executed action, and restarting the embedded system after the upgrade is completed. Through this method, the differential upgrade of the root file system can be realized.

[0069] Next, we will refer to Figures 2 to 4 Each step of the above method in this example implementation is described in more detail.

[0070] Before describing the differential upgrade method of the root file system of the embedded system, the program product of the embedded system is described first.

[0071] Embedded systems generally have SPL (Second Program Loader), U-Boot (boot loader for embedded systems), Kernel, rootfs (root file system) and other images. SPL boots U-Boot, U-Boot starts the kernel program and passes parameters, starts the file system and process, among which the rootfs root file system image is generally the largest because it requires pre-installed application layer programs. The file system includes non-root file system and root file system. Among them, non-root file system includes SPL, U-Boot and Kernel. The root file system includes rootfs.

[0072] like Figure 2 As shown, the program product of the embedded system includes a U-Boot upgrade program, a pre-upgrade image, a pre-upgrade root file system differential upgrade file and a configuration file. The U-Boot upgrade program is used to register the partition file system of the root file system, and is responsible for reading and writing non-root file system images, file system differential upgrade files and configuration files, and completing the upgrade of non-root file system images and root file systems. The pre-upgrade image is used for U-Boot to upgrade non-root file system images, such as SPL, U-Boot, Kernel and other non-root file system images. The pre-upgrade root file system differential upgrade file is used for U-Boot to upgrade the root file system.

[0073] In step S101, a pre-upgrade directory is created at the root file system mount point under the file system, and the pre-upgrade directory is used to place the upgrade package. Since the upgrade package generally includes a non-root file system image, a differential upgrade file of the root file system, and a configuration file, the configuration file includes a configuration file of the non-root file system and a differential configuration file of the root file system. Therefore, the pre-upgrade directory contains a non-root file system image, a differential upgrade file of the root file system, a configuration file of the non-root file system, and a differential configuration file of the root file system. The way to place the upgrade package includes but is not limited to the OTA upgrade method through the network upgrade client, and other methods include adb, ftp, ssh, scp, USB disk and other methods. The former is generally a common method after the product is shipped, and adb, ssh, scp, and USB disk are generally methods that can be used in the development stage.

[0074] After the upgrade package is transferred to the pre-upgrade directory (such as the / update directory), the upgrade package is decompressed to the current / update directory. The generation of the upgrade package will be described in the following embodiment.

[0075] In step S102, after the upgrade package is transferred to the pre-upgrade package, the embedded system issues an upgrade command, and the embedded system enters the upgrade process after restarting. That is, the non-root file system image and the root file system are upgraded. After the embedded system restarts, the kernel receives the parameter update after reboot and writes the value of a register to mark the upgrade. After the embedded system restarts, U-Boot reads the upgrade mark.

[0076] In step S103, the reboot mode instruction is used to specify the download version mode during the reboot, the kernel writes the register value to the specified position, and the register value is determined when U-Boot starts. The mode here generally includes loader (download), fastboot (fast boot), recovery (overwrite), update (update), etc. This article uses rebootupdate (reboot update) to enter the differential upgrade mode of the non-root file system image and the root file system. If it is in download mode, initialize the memory and storage device, find the root file system partition number according to the partition name, and register the ext4 type partition file system. After the partition file system is successfully registered, read the configuration file from the upgrade package. Since the configuration file includes the configuration file of the non-root file system and the differential configuration file of the root file system, the configuration file of the non-root file system and the differential configuration file of the root file system are read from the upgrade package. According to the configuration file, upgrade the non-root file system image according to the position, read the differential upgrade file configuration file, upgrade the corresponding differential file, and restart after the upgrade is completed.

[0077] It should be noted that when registering the partition file system of the root file system, there is a possibility of registration failure. If the registration fails, the embedded system starts normally. Of course, after the registration is successful, the configuration file is read normally.

[0078] In step S104, when upgrading the non-root file system, the non-root file system image, such as SPL, U-Boot, and Kernel image, is read from the upgrade package and written to the storage medium started by the embedded system according to the upgrade start address. The storage medium includes flash, eMMC, and SD card, thereby completing the upgrade of the non-root file system.

[0079] In step S105, when upgrading the root file system, the differential upgrade file of the root file system (such as rootfs) is read from the upgrade package and written into the currently registered partition system file, and the root file system is upgraded according to the file path of the differential upgrade file and the executed action, thereby completing the upgrade of the root file system. Finally, after the non-root file system and the root file system are upgraded, the embedded system is restarted.

[0080] It should be noted that the specific method of upgrading the root file system according to the file path of the differential upgrade file of the root file system in the differential configuration file of the root file system and the executed action and restarting the embedded system after the upgrade is completed is described in the following embodiment and will not be repeated here.

[0081] In one embodiment, reference Figure 3 , the upgrade package is generated by the following steps;

[0082] Generate a difference configuration file based on recursive comparison between version files of the root file system;

[0083] Copy the differential upgrade file and differential configuration file to the pre-upgrade file directory;

[0084] And, copy the non-root file system image and the corresponding configuration files to the pre-upgrade file directory;

[0085] Compress the pre-upgrade file directory to generate an upgrade package.

[0086] It is understandable that U-Boot integrates a differential upgrade solution for the root file system in the baseline version of the embedded system. The baseline version is a relatively stable version, that is, the subsequent root file system modifications may be less, or it is the first version that can stably use the differential upgrade solution, and there are no special restrictions on whether other images and root file systems are frequently modified. When a new version of the root file system is released, execute a script or program to generate a differential configuration file for the differential upgrade file of the root file system for differential upgrade. Copy the newly added files in the differential configuration file (i.e., differential upgrade files) to the pre-upgrade file directory, copy the modified non-root file system image to the pre-upgrade file directory, compress the pre-upgrade file directory, and generate an upgrade package.

[0087] In one embodiment, reference Figure 4 , generate differential configuration files based on recursive comparison between version files of the root file system, copy differential upgrade files and differential configuration files to the pre-upgrade file directory, including:

[0088] Recursively compare the new version target directory of the root file system with the previous version target directory to generate adjacent version configuration files;

[0089] Compare the adjacent version configuration file with the last full version configuration file to generate a new full version configuration file;

[0090] Determine whether to preset only new full-version configuration files;

[0091] If yes, copy the differential upgrade file and the new full version configuration file to the pre-upgrade file directory.

[0092] In one embodiment, determining whether to only pre-set a new full-version configuration file includes:

[0093] If not, generate a difference configuration file between the pre-upgrade version and all previous versions;

[0094] Copy the differential upgrade file and all difference configuration files in the new full version configuration file to the pre-upgrade file directory.

[0095] It is understandable that the new version of the root file system uses the pre-compressed directory compiled by Buildroot (build root), which is generally the target directory, that is, the target directory. When the new version of the root file system is compared with the previous version, the file content is different, that is, the file that needs to be added (that is, the differential upgrade file). For the unchanged modules, the only difference in the time and the compilation server related information can be filtered out, except for the file that identifies the software version information. The actions executed by all rule files are addition and deletion. Newly added files can be marked as add file in the difference configuration file, and deleted files or soft links can be marked as rm file; new soft links can be marked as link dest_file link_file. Among them, file, dest_file, link_file are file paths, based on target, and do not contain the path name of target. Here is an exemplary description: the root file system baseline version V0, the second version V1, the generated adjacent version configuration file V10', the third version V2, V2 is compared with V1 to generate the adjacent version configuration file V21', V21' is compared with V1, that is, it can be understood that the adjacent version configuration files marked above are first added, and then the duplicates are deleted to generate V2, and so on. The full version configuration file Vx' corresponding to a certain version Vx is the operation of Vx(x-1)' and Vx-1 generated by comparing version Vx with Vx-1. The full version configuration file Vx' corresponds to version Vx. Of course, corresponding difference configuration files can also be generated for different versions, such as V20', which is the difference configuration file between version V2 and baseline version V0, and V31' and V32' respectively correspond to the difference configuration files between version V3 and version V1 and version V2. Although the intermediate configuration files are accurately upgraded, additional management is required. By obtaining the version information of the pre-upgrade version, the correct difference configuration file is selected. When making the upgrade package, all difference configuration files from version Vx0' to Vx(x-1)' need to be made and preset.

[0096] In one embodiment, the root file system is upgraded according to the file path of the differential upgrade file of the root file system in the differential configuration file of the root file system and the executed action, and the embedded system is restarted after the upgrade is completed, including:

[0097] Write the pre-added differential upgrade file in the root file system to the currently registered partition file system, and delete the pre-deleted differential upgrade file in the root file system;

[0098] Alternatively, create the differential upgrade file that was pre-added in the root file system, and delete the differential upgrade file that was pre-deleted in the root file system.

[0099] It is understandable that when upgrading the root file system, the file path of the differential upgrade file in the differential configuration file of the root file system is read from the decompressed upgrade package, the pre-added differential upgrade file is written into the currently registered partition file system, and the pre-deleted differential upgrade file in the root file system is deleted. Alternatively, the pre-added differential upgrade file of the root file system is created, the pre-deleted differential upgrade file of the root file system is deleted, and the embedded system is restarted after the upgrade is successful, and the upgrade is completed.

[0100] It should be noted that in "creating the differential upgrade file pre-added in the root file system and deleting the differential upgrade file pre-deleted in the root file system", the differential upgrade file here is a differential soft link file.

[0101] It should be noted that, although the steps of the method in the present application are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step for execution, and / or one step may be decomposed into multiple steps for execution, etc. In addition, it is also easy to understand that these steps may be, for example, executed synchronously or asynchronously in multiple modules / processes / threads.

[0102] Furthermore, in this exemplary embodiment, a differential upgrade device for the root file system of an embedded system is also provided. Figure 5As shown in , the device 200 may include a creation module 201, a restart upgrade module 202, a registration reading module 203, a first upgrade module 204, and a second upgrade module 205. Among them: the creation module 201 is used to create a pre-upgrade directory at the mount point in the root file system, transfer the upgrade package to the pre-upgrade directory, and decompress it; wherein the upgrade package includes a non-root file system image, a differential upgrade file and a configuration file of the root file system, the configuration file includes a configuration file of the non-root file system and a differential configuration file of the root file system, the configuration file of the non-root file system includes an upgrade start address of the non-root file system image and a corresponding image file name, and the differential configuration file of the root file system includes a file path of the differential upgrade file of the root file system and an executed action; the restart upgrade module 202 is used to execute the restart upgrade command; the registration and reading module 203 is used to register the partition file system of the root file system, and read the non-root file system image, the differential upgrade file and the configuration file of the root file system from the decompressed upgrade package respectively; the first upgrade module 204 is used to upgrade the non-root file system image according to the upgrade start address of the non-root file system image and the corresponding image file name in the configuration file of the non-root file system; the second upgrade module 205 is used to upgrade the root file system according to the file path of the differential upgrade file of the root file system in the differential configuration file of the root file system and the executed action, and restart the embedded system after the upgrade is completed.

[0103] In one embodiment, the creation module includes:

[0104] The comparison generation module is used to generate a difference configuration file based on the recursive comparison between the version files of the root file system;

[0105] The first copy module is used to copy the differential upgrade file and the differential configuration file to the pre-upgrade file directory;

[0106] and, a second copy module, for copying the non-root file system image and the corresponding configuration file to the pre-upgrade file directory;

[0107] The compression module is used to compress the pre-upgrade file directory to generate an upgrade package.

[0108] In one embodiment, the apparatus further comprises:

[0109] The first comparison submodule is used to recursively compare the new version target directory of the root file system with the previous version target directory to generate adjacent version configuration files;

[0110] The second comparison submodule is used to compare the adjacent version configuration file with the previous full version configuration file to generate a new full version configuration file;

[0111] A judgment module, used to judge whether only a new full-version configuration file is preset;

[0112] The first judgment submodule is used to copy the differential upgrade file and the new full version configuration file to the pre-upgrade file directory if yes.

[0113] In one embodiment, the apparatus further comprises:

[0114] The second judgment submodule is used to generate a difference configuration file between the pre-upgrade version and all previous versions if no;

[0115] Copy the differential upgrade file and all difference configuration files in the new full version configuration file to the pre-upgrade file directory.

[0116] In one embodiment, the apparatus further comprises:

[0117] The write-delete module is used to write the differential upgrade file pre-added in the root file system to the currently registered partition file system and delete the differential upgrade file pre-deleted in the root file system;

[0118] Alternatively, a deletion module is created to create a differential upgrade file pre-added in the root file system and delete a differential upgrade file pre-deleted in the root file system.

[0119] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0120] It should be noted that although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the implementation mode of the present application, the features and functions of two or more modules or units described above can be concretized in one module or unit. Conversely, the features and functions of a module or unit described above can be further divided into multiple modules or units for concretization. The components displayed as modules or units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the present application scheme. Those of ordinary skill in the art can understand and implement it without paying creative work.

[0121] In an exemplary embodiment of the present application, a computer-readable storage medium is also provided, on which a computer program is stored, and when the program is included in a processor for execution, the steps of the method for differentially upgrading the root file system of an embedded system described in any of the above embodiments can be implemented. In some possible implementations, various aspects of the present invention can also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps of various exemplary embodiments of the present invention described in the above embedded system root file system differential upgrade method section of this specification.

[0122] refer to Figure 2 As shown, a program product 300 for implementing the above method according to an embodiment of the present invention is described, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.

[0123] The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0124] The computer readable storage medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The readable storage medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by an instruction execution system, an apparatus, or a device or used in combination with it. The program code contained on the readable storage medium may be transmitted with any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the above.

[0125] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).

[0126] In an exemplary embodiment of the present application, an electronic device is further provided, which may include a processor and a memory for storing executable instructions of the processor, wherein the processor is configured to execute the steps of the embedded system root file system differential upgrade method described in any of the above embodiments by executing the executable instructions.

[0127] It will be appreciated by those skilled in the art that various aspects of the present invention may be implemented as a system, method or program product. Therefore, various aspects of the present invention may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as a "circuit", "module" or "system".

[0128] Refer to the following Figure 6 The electronic device 600 according to this embodiment of the present invention is described. Figure 6 The electronic device 600 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0129] like Figure 6 As shown, the electronic device 600 is in the form of a general computing device. The components of the electronic device 600 may include, but are not limited to: at least one processing unit 610, at least one storage unit 620, a bus 630 connecting different system components (including the storage unit 620 and the processing unit 610), a display unit 640, etc.

[0130] The storage unit stores program codes, which can be executed by the processing unit 610, so that the processing unit 610 executes the steps according to various exemplary embodiments of the present invention described in the above embedded system root file system differential upgrade method section of this specification. For example, the processing unit 610 can execute the following steps: Figure 1 Follow the steps shown in .

[0131] The storage unit 620 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 6201 and / or a cache memory unit 6202 , and may further include a read-only memory unit (ROM) 6203 .

[0132] The storage unit 620 may also include a program / utility 6204 having a set (at least one) of program modules 6205, such program modules 6205 including but not limited to: an operating system, one or more application programs, other program modules and program data, each of which or some combination may include the implementation of a network environment.

[0133] Bus 630 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0134] The electronic device 600 may also communicate with one or more external devices 700 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 600, and / or communicate with any device that enables the electronic device 600 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 650. Furthermore, the electronic device 600 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 660. The network adapter 660 may communicate with other modules of the electronic device 600 via a bus 630. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0135] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation method of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server or a network device, etc.) to execute the above-mentioned embedded system root file system differential upgrade method according to the implementation method of the present application.

[0136] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary technical means in the art that are not disclosed in the present application.

Claims

1. A method for differentially upgrading a root file system of an embedded system, characterized in that: The method includes: Create a pre-upgrade directory at the mount point in the root file system, transfer the upgrade package to the pre-upgrade directory, and decompress it; wherein the upgrade package includes a non-root file system image, a differential upgrade file of the root file system, and a configuration file, the configuration file includes a configuration file of the non-root file system and a differential configuration file of the root file system, the configuration file of the non-root file system includes an upgrade start address of the non-root file system image and a corresponding image file name, and the differential configuration file of the root file system includes a file path of the differential upgrade file of the root file system and an executed action; Execute the restart upgrade command; Registering the partition file system of the root file system, and reading the non-root file system image, the differential upgrade file of the root file system and the configuration file from the decompressed upgrade package respectively; Upgrading the non-root file system image according to the upgrade start address of the non-root file system image and the corresponding image file name in the configuration file of the non-root file system; The root file system is upgraded according to the file path of the differential upgrade file of the root file system in the differential configuration file of the root file system and the executed action, and the embedded system is restarted after the upgrade is completed.

2. The embedded system root file system differential upgrade method according to claim 1, characterized in that: The upgrade package is generated by the following steps: Generate a difference configuration file based on recursive comparison between version files of the root file system; Copy the differential upgrade file and the differential configuration file to the pre-upgrade file directory; And, copying the non-root file system image and the corresponding configuration file to the pre-upgrade file directory; The pre-upgrade file directory is compressed to generate the upgrade package.

3. The embedded system root file system differential upgrade method according to claim 2, characterized in that: The recursive comparison between the version files of the root file system to generate a difference configuration file, and copying the difference upgrade file and the difference configuration file to the pre-upgrade file directory includes: Recursively compare the new version target directory of the root file system with the previous version target directory to generate adjacent version configuration files; Compare the adjacent version configuration file with the last full version configuration file to generate a new full version configuration file; Determining whether to preset only the new full-version configuration file; If so, copy the differential upgrade file and the new full-version configuration file to the pre-upgrade file directory.

4. The method for differentially upgrading the root file system of an embedded system according to claim 3, characterized in that: The determining whether to only preset the new full-version configuration file includes: If not, generate a difference configuration file between the pre-upgrade version and all previous versions; The differential upgrade file and all the difference configuration files in the new full-version configuration file are copied to the pre-upgrade file directory.

5. The embedded system root file system differential upgrade method according to claim 4, characterized in that: The step of upgrading the root file system according to the file path of the differential upgrade file of the root file system in the differential configuration file of the root file system and the executed action, and restarting the embedded system after the upgrade is completed, comprises: Writing the pre-added differential upgrade file in the root file system into the currently registered partition file system, and deleting the pre-deleted differential upgrade file in the root file system; Alternatively, a differential upgrade file pre-added in the root file system is created, and a differential upgrade file pre-deleted in the root file system is deleted.

6. A differential upgrade device for an embedded system root file system, characterized in that: The device includes: A creation module, used to create a pre-upgrade directory at a mount point in a root file system, transfer an upgrade package to the pre-upgrade directory, and decompress it; wherein the upgrade package includes a non-root file system image, a differential upgrade file of the root file system, and a configuration file; the configuration file includes a configuration file of the non-root file system and a differential configuration file of the root file system; the configuration file of the non-root file system includes an upgrade start address of the non-root file system image and a corresponding image file name; the differential configuration file of the root file system includes a file path of the differential upgrade file of the root file system and an executed action; Restart upgrade module, used to execute restart upgrade command; A registration and reading module, used for registering the partition file system of the root file system, and reading the non-root file system image, the differential upgrade file of the root file system and the configuration file from the decompressed upgrade package respectively; A first upgrade module, configured to upgrade the non-root file system image according to the upgrade start address of the non-root file system image and the corresponding image file name in the configuration file of the non-root file system; The second upgrade module is used to upgrade the root file system according to the file path of the differential upgrade file of the root file system in the differential configuration file of the root file system and the executed action, and restart the embedded system after the upgrade is completed.

7. The embedded system root file system differential upgrade device according to claim 6, characterized in that: The creation module includes: A comparison generation module, used for generating a difference configuration file based on recursive comparison between version files of the root file system; A first copy module, used for copying the differential upgrade file and the differential configuration file to a pre-upgrade file directory; and, a second copy module, for copying the non-root file system image and the corresponding configuration file to the pre-upgrade file directory; A compression module is used to compress the pre-upgrade file directory to generate the upgrade package.

8. The embedded system root file system differential upgrade device according to claim 7, characterized in that: The device also includes: A first comparison submodule is used to recursively compare the new version target directory of the root file system with the previous version target directory to generate adjacent version configuration files; A second comparison submodule is used to compare the adjacent version configuration file with the last full version configuration file to generate a new full version configuration file; A judging module, used for judging whether to preset only the new full-version configuration file; The first judgment submodule is used to copy the differential upgrade file and the new full-version configuration file to the pre-upgrade file directory if yes.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the embedded system root file system differential upgrade method according to any one of claims 1 to 5 are implemented.

10. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to execute the steps of the embedded system root file system differential upgrade method according to any one of claims 1 to 5 by executing the executable instructions.