Rail transit equipment OTA upgrading method based on Linux system, storage medium and device

By optimizing the generation and application process of OTA upgrade packages, including establishing baseline versions, generating and optimizing differential files, and modifying OTA compilation scripts, the problem of large size and slow upgrade speed in the existing OTA upgrade solution is solved, and efficient and cost-saving OTA upgrade effect is achieved.

CN120029653APending Publication Date: 2025-05-23SUNNIWELL AIOT TECH LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510131112.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-06
Publication Date
2025-05-23

AI Technical Summary

Technical Problem

When existing OTA upgrade solutions deal with large-scale distributed devices or devices with large file systems, the upgrade package is large in size, slow in upgrade speed, and severe bandwidth consumption, which cannot meet the needs of high-efficiency upgrades.

Method used

By establishing a baseline version, identifying changes in buildroot partition file, generating and optimizing buildroot differential files, storing the differential files in the OEM partition, and modifying the OTA compilation script to remove the packaged buildroot image action, compiling SDK to obtain the OTA upgrade package, and automatically upgrade using the generated OTA upgrade package.

Benefits of technology

It reduces the amount of data transmission, improves the upgrade speed, reduces bandwidth consumption and storage requirements, improves the reliability and efficiency of system upgrades, and achieves the efficiency and cost saving of OTA upgrades.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120029653A_ABST
    Figure CN120029653A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a rail transit equipment OTA upgrading method based on a Linux system, a storage medium and a device. The method comprises: establishing a baseline version; compiling the current version; comparing the current version with the baseline version, identifying the change of a build-root partition file, and generating a build-root difference file; the build root difference file is stored in an OEM partition; modifying the OTA compiling script, removing the action of packaging the build root mirror image, and compiling the sdk to obtain an OTA upgrade package; and carrying out OTA upgrading on the equipment by utilizing the generated OTA upgrading package, and synchronizing a difference file to the OEM partition of the equipment after upgrading. By optimizing the generation and application process of the OTA upgrade package, the data transmission quantity is reduced, the upgrade speed is increased, the bandwidth consumption and storage requirements are reduced, and the reliability and efficiency of system upgrade are improved. The OTA upgrading is more efficient, the cost is saved, the stability of the system is enhanced, and the method has a good application prospect in the application fields of rail transit equipment and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of electrical digital data processing, in particular to the technical field of electrical digital data processing in the field of rail transit, and specifically relates to a rail transit equipment OTA upgrade method, storage medium and device based on a Linux system. Background Art

[0002] Usually, when chip manufacturers build Linux system images, the buildroot partition as a build system itself is too large, resulting in a large image package generated each time the upgrade is performed. In the subsequent secondary development process, even a small change requires recompiling and upgrading the entire partition, and as the system complexity increases, the size of the upgrade package will further expand. Rail transit equipment often has limited bandwidth and poor network environment. In this case, the size of the upgrade package will directly affect the equipment upgrade efficiency and user experience.

[0003] With the rapid development of embedded devices and IoT technology, OTA (Over-The-Air) upgrades have become an important means of device maintenance and updates. Through OTA upgrades, device manufacturers can remotely update software, fix vulnerabilities, add new features, or optimize system performance without physically touching the device. OTA upgrades not only improve the convenience of the device, but also save manual maintenance costs.

[0004] Chinese patent document CN106528249A discloses a storage method, device and terminal for an upgrade package, which stores the upgrade package in an unencrypted partition and directly decrypts the OTA upgrade package based on the storage location for OTA upgrade. However, this method only optimizes the decryption process and lacks processing of the upgrade package itself. When the size of the OTA upgrade package itself is too large, the optimization effect will also deteriorate, and it may even be impossible to implement when the size of the upgrade package is larger than the size of the unencrypted space.

[0005] In summary, the existing OTA upgrade solutions have some shortcomings, especially when dealing with large-scale distributed devices or devices with large file systems, they still face many challenges. With the increase in the number of devices and the increase in the frequency of upgrades, the traditional OTA upgrade method has large OTA upgrade packages, slow upgrade speed, serious bandwidth consumption, and low bandwidth consumption, which cannot meet the needs of high-efficiency upgrades for devices. Summary of the invention

[0006] In view of this, on the one hand, some embodiments disclose a rail transit equipment OTA upgrade method based on a Linux system, including: Establish a baseline version; Compile the current version; Compare the current version with the baseline version, identify the changes in the buildroot partition files, and generate a buildroot difference file; Store the buildroot difference file in the OEM partition; Modify the OTA compilation script, remove the action of packaging the buildroot image, and compile the SDK to obtain an OTA upgrade package; Use the generated OTA upgrade package to perform OTA upgrade on the device, and synchronize the difference file to the OEM partition of the device after the upgrade.

[0007] Furthermore, for the OTA upgrade method of rail transit equipment based on the Linux system disclosed in some embodiments, establishing a baseline version includes: When the system is first deployed, use buildroot to generate a complete system image; Record the baseline metadata of each file in the system image to establish a baseline version.

[0008] For the OTA upgrade method of rail transit equipment based on the Linux system disclosed in some embodiments, after generating the buildroot difference file, optimize it to obtain a compressed package of the buildroot difference file, and store the compressed package of the buildroot difference file in the OEM partition.

[0009] For the OTA upgrade method of rail transit equipment based on the Linux system disclosed in some embodiments, the optimization of the buildroot difference file includes: Compress the buildroot difference file to reduce the file size; Generate a hash value SHA256 for the buildroot difference file as the unique identifier of the buildroot difference file to avoid file duplication and reduce the file size.

[0010] For the OTA upgrade method of rail transit equipment based on the Linux system disclosed in some embodiments, after the OTA upgrade is completed, it further includes further processing of the difference file, specifically including: When the device boots up, the self-start script runs; the script file is pre-saved in the system startup directory; Check whether there is a difference file in the OEM partition; If there is no difference file, stop the script from running; If there is a difference file, read the baseline metadata and decompress the difference file, and verify the difference file using the file hash value; Apply the difference file to the system partition according to the type of the difference file.

[0011] Some embodiments disclose a rail transit equipment OTA upgrade method based on a Linux system, and applying a difference file to a system partition according to the difference file type specifically includes: Determine the difference file type; the difference file type includes newly added files, deleted files or modified files; For newly added files, copy them to the target path of the buildroot partition; For deleting files, delete the corresponding files in the buildroot partition; For modified files, replace the corresponding files in the buildroot partition.

[0012] In some embodiments of the rail transit equipment OTA upgrade method based on the Linux system disclosed, after the difference file is applied to the system partition, the file hash value is used to perform file verification again.

[0013] Some embodiments disclose a rail transit equipment OTA upgrade method based on a Linux system, which records the update process and results after applying the difference file to the system partition.

[0014] On the other hand, some embodiments disclose a storage medium in which a computer program is stored. When the computer program is read and executed, the rail transit equipment OTA upgrade method based on the Linux system disclosed in the embodiment of the present invention is executed.

[0015] On the other hand, some embodiments disclose a device, which is a rail transit equipment based on a Linux system. The rail transit equipment includes a memory and a processor. A computer program is stored in the memory. When the computer program is read and executed by the processor, the OTA upgrade method for rail transit equipment based on a Linux system disclosed in an embodiment of the present invention is executed.

[0016] The OTA upgrade method for rail transit equipment based on the Linux system disclosed in the embodiment of the present invention reduces the amount of data transmission, improves the upgrade speed, reduces bandwidth consumption and storage requirements, and improves the reliability and efficiency of system upgrades by optimizing the generation and application process of the OTA upgrade package. OTA upgrades are more efficient, save costs, and enhance the stability and flexibility of the system, and have good application prospects in application fields such as rail transit equipment. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 This is a flow chart of the OTA upgrade method for rail transit equipment based on the Linux system in Example 1; Figure 2 The present invention is a flowchart of the operation of the startup script of the rail transit equipment OTS upgrade method based on the Linux system. DETAILED DESCRIPTION

[0018] The word "embodiment" used herein as an "exemplary" does not necessarily mean that any embodiment described is superior or better than other embodiments. Performance index tests in the embodiments of the present invention are performed using conventional test methods in the art unless otherwise specified. It should be understood that the terms described in the embodiments of the present invention are only used to describe specific implementation methods and are not intended to limit the contents disclosed in the embodiments of the present invention.

[0019] Unless otherwise specified, the technical and scientific terms used herein have the same meanings as commonly understood by ordinary technicians in the technical field to which the embodiments of the present invention belong; other experimental methods and technical means not specifically specified in the embodiments of the present invention refer to experimental methods and technical means commonly used by ordinary technicians in the field.

[0020] The terms "substantially" and "approximately" used herein are used to describe small fluctuations. For example, they can refer to less than or equal to ±5%, such as less than or equal to ±2%, such as less than or equal to ±1%, such as less than or equal to ±0.5%, such as less than or equal to ±0.2%, such as less than or equal to ±0.1%, such as less than or equal to ±0.05%. The numerical data represented or presented in the range format herein are used only for convenience and brevity, and therefore should be flexibly interpreted as not only including the values ​​clearly listed as the limits of the range, but also including all independent values ​​or sub-ranges contained in the range. For example, the numerical range of "1-5%" should be interpreted as including not only the clearly listed values ​​of 1% to 5%, but also the independent values ​​and sub-ranges within the range shown. Therefore, independent values ​​such as 2%, 3.5% and 4% and sub-ranges such as 1%-3%, 2%-4% and 3%-5% are included in this numerical range. This principle also applies to the range of only one numerical value. In addition, such an explanation applies regardless of the width of the range or the characteristics.

[0021] In this document, including in the claims, transitional words such as "comprises," "includes," "with," "having," "containing," "involving," "accommodating," etc. are understood to be open-ended, i.e., meaning "including but not limited to." Only the transitional words "consisting of" and "composed of" are closed transitional words.

[0022] In order to better illustrate the present invention, numerous specific details are provided in the specific examples below. It should be understood by those skilled in the art that the present invention can be implemented without certain specific details. In the embodiments, some methods, means, instruments, equipment, etc. well known to those skilled in the art are not described in detail in order to highlight the gist of the present invention.

[0023] Under the premise of no conflict, the technical features disclosed in the embodiments of the present invention may be arbitrarily combined, and the resulting technical solutions belong to the contents disclosed in the embodiments of the present invention.

[0024] In some implementations, the OTA upgrade method for rail transit equipment based on the Linux system includes generating an OTA upgrade file and using the generated OTA file to automatically upgrade the system; the OTA upgrade method specifically includes: Establish a baseline version; usually, when the system is deployed for the first time, use buildroot to generate a complete system image; record the baseline metadata of each file in the system image and establish a baseline version; usually, the system image includes the kernel image, root file system, system configuration, etc.; the recorded baseline metadata includes the path, hash value, size and permissions of each file, etc. These metadata are recorded to ensure that the subsequent incremental updates can be accurately compared with the baseline version and the incremental update content can be accurately identified; Compile the current version; usually the compiled current version is the updated new system version; Compare the current version with the baseline version, identify changes in buildroot partition files, and generate buildroot difference files; usually, the rysnc tool can be used to compare the current version of the Linux system with the baseline version to identify changed files, such as new files, modified files, or deleted files; and record file changes, and generate incremental update logs for all changed files and their paths to facilitate subsequent generation of difference files and file verification; further use the incremental update algorithm to generate difference files to ensure that only the differences between the baseline version and the current version are transmitted; when generating difference files, large files can also be divided into small files to reduce the size of difference files; Usually, the difference file can be further optimized to improve the transmission efficiency. On the one hand, the buildroot difference file can be compressed to reduce the file size. On the other hand, a hash value SHA256 is generated for the buildroot difference file as the unique identifier of the buildroot difference file to ensure the uniqueness of the difference file in file verification to avoid file duplication. That is, the hash value can be used for verification to remove duplicate files and further reduce the file size. The optimized difference file is compressed, and the resulting buildroot difference file compressed package can be further stored in the OEM partition. Usually, all files contained in the difference file correspond to a unique hash value identifier. Store the buildroot difference files in the OEM partition; Modify the OTA compilation script, remove the buildroot image packaging action, and compile the SDK to obtain the OTA upgrade package. Usually, when compiling and generating the OTA upgrade package, the buildroot partition image is not packaged, only the difference files are packaged, and the generated OTA upgrade package is stored in the OEM partition. This can greatly reduce the size of the OTA upgrade package and improve the transmission efficiency of the subsequent OTS upgrade package. In embedded devices with limited bandwidth and storage, such as rail transit equipment, it can save a lot of bandwidth and transmission time, and improve the OTA upgrade efficiency. When an OTA update is detected, the system downloads the OTA upgrade package from the server and performs file verification. If the OTA upgrade package is complete, the upgrade process is entered to complete the upgrade. After the upgrade is completed, the difference files are synchronously stored in the corresponding directory of the OEM partition.

[0025] Some embodiments disclose a rail transit equipment OTA upgrade method based on a Linux system, wherein the method for automatically upgrading using a generated OTA upgrade package specifically includes: When the device is powered on, the startup script runs. Usually, the script file is saved in the system startup directory in advance, for example, / etc / init.d / apply_ota_update.sh. Check if there are any difference files in the OEM partition; If there is no difference file, stop the script; If there are difference files, the baseline metadata is read and the difference files are decompressed, and the difference files are verified using the file hash value. Usually, all files are verified one by one to ensure that all files contained in the difference files are complete and valid. According to the type of the difference file, apply the difference file to the system partition. Usually, you need to determine the type of the difference file and then apply it according to the different types; generally, the difference file types include new files, deleted files or modified files; for new files, copy the new files to the target path of the buildroot partition; for deleted files, delete the corresponding files in the buildroot partition; for modified files, replace the files corresponding to the modified files in the buildroot partition.

[0026] Some embodiments disclose a rail transit equipment OTA upgrade method based on a Linux system. After the difference file is applied to the system partition, the file hash value is used to perform file verification again to ensure that the integrity of the file is maintained during the transmission and upgrade process.

[0027] Some embodiments disclose a rail transit equipment OTA upgrade method based on a Linux system, which records the update process and results after applying the difference file to the system partition to facilitate subsequent inspection and verification of the update.

[0028] Some embodiments disclose a storage medium in which a computer program is stored. When the computer program is read and executed, the rail transit equipment OTA upgrade method based on the Linux system disclosed in the embodiment of the present invention is executed.

[0029] Some embodiments disclose a device, which is a rail transit equipment based on a Linux system. The rail transit equipment includes a memory and a processor. A computer program is stored in the memory. When the computer program is read and executed by the processor, the OTA upgrade method for rail transit equipment based on a Linux system disclosed in an embodiment of the present invention is executed.

[0030] The technical details are further illustrated below in conjunction with embodiments.

[0031] Example 1 The OTA upgrade method for rail transit equipment based on Linux system disclosed in Example 1 is as follows: Figure 1 As shown, specifically including: Establish a baseline version and record the baseline version metadata; Compile the current version; Identify file changes between the baseline version and the current version of the buildroot partition; Generate buildroot difference files; Compression and deduplication reduce the size of buildroot difference files; Optimize the difference files and obtain the difference file compression package; Store the difference file compressed package in the OEM partition; Modify the OTA compilation script and remove the action of packaging the buildroot image; Compile the SDK to get the OTA upgrade package; Use the generated OTA upgrade package to perform OTA upgrade on the device, and synchronize the difference files to the device OEM partition after the upgrade.

[0032] Example 2 Example 2 discloses a rail transit equipment OTA upgrade method based on a Linux system, such as Figure 2 As shown in the figure, the script running process specifically includes: When the device is turned on, the script starts automatically; Check whether there is a difference file in the OEM partition. If not, stop the script. If yes, read the metadata and decompress the difference file. The file integrity is further verified by the hash value. If not, the script is stopped and the error is reported and printed in the log. If yes, the difference file type is determined. If the difference file is a newly added file, copy it to the target path of the buildroot partition; If the difference file is a deleted file, delete the corresponding file in the buildroot partition; If the difference file replaces the file, then replace the corresponding file in the buildroot partition; Update verification, calculate the hash value of each file and compare it with the metadata to ensure error-free file transfer and application process.

[0033] The OTA upgrade method for rail transit equipment based on the Linux system disclosed in the embodiment of the present invention reduces the amount of data transmission, improves the upgrade speed, reduces bandwidth consumption and storage requirements, and improves the reliability and efficiency of system upgrades by optimizing the generation and application process of the OTA upgrade package. OTA upgrades are more efficient, save costs, and enhance the stability and flexibility of the system. It has good application prospects in application fields such as embedded devices with limited bandwidth and storage, rail transit equipment, etc.

[0034] The technical solutions disclosed in the embodiments of the present invention and the technical details disclosed in the embodiments are merely illustrative of the inventive concept of the present invention and do not constitute a limitation on the technical solutions of the embodiments of the present invention. Any conventional changes, replacements or combinations of the technical details disclosed in the embodiments of the present invention have the same inventive concept as the present invention and are within the protection scope of the claims of the present invention.

Claims

1. A rail transit equipment OTA upgrade method based on Linux system, characterized in that: include: Establish a baseline version; Compile the current version; Compare the current version with the baseline version, identify changes in buildroot partition files, and generate buildroot difference files; Store the buildroot difference files in the OEM partition; Modify the OTA compilation script, remove the buildroot image packaging action, and compile the SDK to obtain the OTA upgrade package; Use the generated OTA upgrade package to perform OTA upgrade on the device, and synchronize the difference files to the device OEM partition after the upgrade.

2. The OTA upgrade method for rail transit equipment based on Linux system according to claim 1 is characterized in that: Creating a baseline version includes: When deploying the system for the first time, use buildroot to generate a complete system image. Record the baseline metadata of each file in the system image and establish a baseline version.

3. The OTA upgrade method for rail transit equipment based on Linux system according to claim 1 is characterized in that: After the buildroot difference file is generated, it is optimized to obtain a compressed package of the buildroot difference file, and the compressed package of the buildroot difference file is stored in the OEM partition.

4. The OTA upgrade method for rail transit equipment based on Linux system according to claim 3 is characterized in that: Improvements to buildroot difference files include: Compress buildroot difference files to reduce file size; Generate a hash value SHA256 for the buildroot difference file as the unique identifier of the buildroot difference file to avoid file duplication and reduce file size.

5. The rail transit equipment OTA upgrade method based on Linux system according to claim 1 is characterized in that: After the OTA upgrade is completed, the difference files are further processed, including: When the device is turned on, the auto-start script runs; the script file is pre-saved in the system startup directory; Check if there are any difference files in the OEM partition; If there is no difference file, stop the script; If there are difference files, read the baseline metadata and decompress the difference files, and use the file hash value to verify the difference files; Depending on the type of the differential file, apply the differential file to the system partition.

6. The OTA upgrade method for rail transit equipment based on Linux system according to claim 5 is characterized in that: Applying the difference file to the system partition according to the difference file type specifically includes: Determine the difference file type; the difference file type includes newly added files, deleted files or modified files; For newly added files, copy them to the target path of the buildroot partition; For deleting files, delete the corresponding files in the buildroot partition; For modified files, replace the corresponding files in the buildroot partition.

7. The rail transit equipment OTA upgrade method based on Linux system according to claim 5 is characterized in that: After the difference file is applied to the system partition, the file hash value is used to perform file verification again.

8. The OTA upgrade method for rail transit equipment based on Linux system according to claim 5 is characterized in that: After applying the difference file to the system partition, record the update process and results.

9. A storage medium, characterized in that The storage medium stores a computer program, and when the computer program is read and executed, the Linux system-based rail transit equipment OTA upgrade method according to any one of claims 1 to 8 is executed.

10. The device, characterized in that The device is a rail transit equipment based on the Linux system, and the rail transit equipment includes a memory and a processor. The memory stores a computer program, and when the computer program is read and executed by the processor, the OTA upgrade method for rail transit equipment based on the Linux system according to any one of claims 1 to 8 is executed.

Citation Information

Patent Citations

  • Storage method and device of upgrade package, and terminal

    CN106528249A