Firmware upgrade file processing method, device, server and storage medium

By generating an entry image and generating a kernel symbol table based on the image file, the problem of inconsistency between the firmware upgrade package and the terminal firmware system parameters is solved, and the success rate of firmware upgrade is improved.

CN114637523BActive Publication Date: 2024-10-18BEIJING HITEVISION AIXUE EDUCATION TECH CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202210132069.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-14
Publication Date
2024-10-18
Estimated Expiration
2042-02-14

AI Technical Summary

Technical Problem

The terminal firmware upgrade fails because the system parameters in the firmware upgrade package are inconsistent with the system parameters of the terminal flash package.

Method used

By obtaining the configuration file, reading the preset entries, generating the entry image, and generating the kernel symbol table based on the image file, compiling and packaging the intermediate package to ensure that the firmware upgrade package and the terminal firmware are consistent in the preset entries.

Benefits of technology

It improves the success rate of terminal firmware upgrade, avoids changes in preset entries during the compilation process, and ensures the consistency of system parameters between the firmware upgrade package and the terminal firmware.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114637523B_ABST
    Figure CN114637523B_ABST
Patent Text Reader

Abstract

The present application discloses a firmware upgrade file processing method, device, server and storage medium. The firmware upgrade file processing method includes: obtaining a configuration file; reading a preset entry in the configuration file, generating an entry image corresponding to the preset entry; compiling the configuration file, generating an intermediate package, the intermediate package including a kernel symbol table generated based on the entry image; packaging the intermediate package to obtain a firmware upgrade package, the firmware upgrade package is used for firmware upgrade. The embodiment of the present application helps to ensure that the firmware upgrade package is consistent with the terminal firmware to be upgraded in terms of the preset entry, thereby improving the success rate of the terminal firmware upgrade.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of electronic technology, and in particular to a firmware upgrade file processing method, device, server and storage medium. Background Art

[0002] With the development of Over The Air (OTA) technology, the firmware upgrade of various terminals is becoming more and more convenient. When the terminal is upgraded based on OTA technology, it often downloads the firmware upgrade package from the server.

[0003] In the related art, the system parameters in the firmware upgrade package (such as the system directory image) may be inconsistent with the system parameters in the terminal's flash package (such as a bin file), thereby causing the terminal firmware upgrade to fail. Summary of the invention

[0004] The embodiments of the present application provide a firmware upgrade file processing method, device, server and storage medium to solve the problem of terminal firmware upgrade failure caused by inconsistency between coefficient parameters of the firmware upgrade package and system parameters of the terminal flash package.

[0005] In a first aspect, an embodiment of the present application provides a method for processing a firmware upgrade file, the method comprising:

[0006] Get the configuration file;

[0007] Read the preset entries in the configuration file and generate entry images corresponding to the preset entries;

[0008] Compile the configuration file and generate an intermediate package, which includes a kernel symbol table generated based on the entry image;

[0009] Pack the intermediate package to get the firmware upgrade package.

[0010] In a second aspect, an embodiment of the present application provides a firmware upgrade file processing device, the device comprising:

[0011] A first acquisition module, used to acquire a configuration file;

[0012] A read generation module is used to read preset entries in a configuration file and generate entry images corresponding to the preset entries;

[0013] A compilation module is used to compile configuration files and generate an intermediate package, which includes a kernel symbol table generated based on the entry image;

[0014] The packaging module is used to package the intermediate package to obtain the firmware upgrade package.

[0015] In a third aspect, an embodiment of the present application provides a server, the server comprising: a processor and a memory storing computer program instructions;

[0016] When the processor executes the computer program instructions, the firmware upgrade file processing method shown in the first aspect is implemented.

[0017] In a fourth aspect, an embodiment of the present application provides a computer storage medium having computer program instructions stored thereon, and when the computer program instructions are executed by a processor, the firmware upgrade file processing method shown in the first aspect is implemented.

[0018] In a fifth aspect, an embodiment of the present application provides a computer program product. When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the firmware upgrade file processing method shown in the first aspect.

[0019] The firmware upgrade file processing method provided in the embodiment of the present application obtains a configuration file, reads a preset entry in the configuration file, generates an entry image corresponding to the preset entry, compiles the configuration file, generates an intermediate package, and the intermediate package includes a kernel symbol table generated based on the entry image, packages the intermediate package, and obtains a firmware upgrade package. In the embodiment of the present application, by reading the configuration file, generating an entry image file corresponding to the preset entry, and generating a kernel symbol table based on the image file, it is possible to avoid changes in the preset entries and the like in the compiled intermediate package, thereby helping to ensure that the firmware upgrade package is consistent with the terminal firmware to be upgraded in the preset entries, and improve the success rate of the terminal firmware upgrade. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0021] Figure 1 It is an example diagram of a framework for implementing the firmware upgrade file processing method of an embodiment of the present application;

[0022] Figure 2 It is a flowchart of a firmware upgrade file processing method provided in an embodiment of the present application;

[0023] Figure 3 It is a schematic diagram of the working principle of the firmware entry module and related modules;

[0024] Figure 4 It is a schematic diagram of the working principle of the firmware management module;

[0025] Figure 5 It is a schematic diagram of the working principle of the large screen upgrade module and related modules;

[0026] Figure 6This is a schematic diagram of the working principle of the version upgrade query module;

[0027] Figure 7 It is a schematic diagram of the working principle of the firmware differential version calculation module and related modules;

[0028] Figure 8 It is a comparison diagram of the firmware upgrade file processing method in this application and the Android system differential upgrade process in conventional technology;

[0029] Fig. 9 It is a structural schematic diagram of a firmware upgrade file processing device provided in an embodiment of the present application;

[0030] Fig.10 It is a schematic diagram of the structure of the server provided in the embodiment of the present application. DETAILED DESCRIPTION

[0031] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.

[0032] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0033] In order to solve the problems of the prior art, the embodiments of the present application provide a method, device, server and storage medium for processing firmware upgrade files. The following first introduces the framework of the firmware upgrade file processing method provided by the embodiments of the present application.

[0034] like Figure 1As shown, the framework may include a server 110 and a terminal 120, the server 110 and the terminal 120 are connected in communication, the server 110 may generate or enter a firmware upgrade package for terminal firmware upgrade, and may send the firmware upgrade package to the terminal 120 based on OTA technology. The terminal 120 may be, for example, a mobile terminal, a large-screen display device, a personal computer, or a wearable device, etc., which is not specifically limited here.

[0035] Figure 2 FIG. 1 is a flow chart showing a method for processing a firmware upgrade file provided by an embodiment of the present application. Figure 2 As shown, the method includes:

[0036] Step 201, obtaining a configuration file;

[0037] Step 202, read the preset entry in the configuration file, and generate an entry image corresponding to the preset entry;

[0038] Step 203, compile the configuration file to generate an intermediate package, the intermediate package includes a kernel symbol table generated based on the entry image;

[0039] Step 204: Pack the intermediate package to obtain a firmware upgrade package.

[0040] The firmware upgrade file processing method provided in the embodiment of the present application can be applied to a server or various electronic devices. To simplify the description, the following mainly describes the application of the firmware upgrade file processing method in a server as an example.

[0041] In some examples, the configuration file in step 201 may refer to a code file for obtaining a firmware upgrade package. For example, in combination with some examples, the configuration file may include a build_image.py file for image generation, an ota_from_target_files file for OTA packaging, and a makefile file for automatic compilation, etc.

[0042] Of course, the above are some exemplary descriptions of the configuration file. In actual applications, the configuration file may also include other files used to generate the firmware upgrade package, which are not listed one by one here.

[0043] In step 202, the server may read preset entries in the configuration file, and these preset entries may be entries used for generating a kernel symbol table.

[0044] In some examples, the kernel symbol table may be system.map. To simplify the description, the following mainly uses the kernel symbol table being system.map as an example for explanation.

[0045] The inventors discovered during research and development that in related technologies, after obtaining the configuration file, the configuration file is usually compiled directly. In the system.map obtained by this compilation method, entries such as the block list (block_list) and the storage type (fs_type) have changed.

[0046] System.map can be used to image the system directory image (system.img) in the firmware upgrade package, that is, the system.img in the firmware upgrade package corresponds to system.map. If some entries in system.img change, the system.img in the firmware upgrade package may be different from the system.img of the bin file in the terminal to be upgraded, which may cause the terminal firmware upgrade to fail.

[0047] In this embodiment, the preset entries may also refer to entries that may change during the process of compiling the configuration file according to the compilation method in the related art (ie, directly compiling the configuration file). The server may read these preset entries in advance and generate entry images corresponding to the preset entries.

[0048] In some examples, the code in the build_image.py file may be modified so that when the code is read, the server can execute the steps of generating the entry image.

[0049] In step 203, the server may compile the configuration file to generate an intermediate package, and the intermediate package may include system.map generated based on the above entry image.

[0050] Generally speaking, system.map can be generated when compiling the kernel, which can be used to record information such as a list of symbols in the kernel (such as functions, global variables, etc.) and the virtual location of the symbols in memory.

[0051] The implementation of compiling the kernel to generate system.map can be achieved through existing technologies. In this embodiment, the server can use the entry mirror in the process of generating system.map.

[0052] Specifically, when the configuration file is compiled based on the prior art, the preset entries in the configuration file may change, and in this embodiment, after the compilation stage that causes the preset entry to change, the changed preset entry can be replaced with the entry mirror. In this way, the compiled intermediate package can include system.map generated based on the entry mirror.

[0053] In step 204, the server may package the intermediate package to obtain a firmware upgrade package.

[0054] In combination with some application scenarios, the intermediate package can be a bin type or an OTA type intermediate package, which is not specifically limited here. On the basis of generating the intermediate package, the server usually needs to further package the intermediate package to obtain, for example, a zip or other type of firmware upgrade package for firmware upgrade.

[0055] Generally speaking, during the packaging process, the system.map of the intermediate package can be incorporated into the firmware upgrade package, and the system.img corresponding to the system.map can be generated in the firmware upgrade package.

[0056] It is easy to understand that in actual applications, when setting up a configuration file, the preset entries therein can usually be consistent with the preset entries in the terminal firmware. The system.map is generated based on the entry image, which avoids changes in the preset entries during the compilation process. Correspondingly, since there is a corresponding relationship between system.img and system.map, the preset entries in the firmware upgrade package can also be consistent with the preset entries in the terminal firmware. In this way, it can effectively further ensure that the firmware upgrade package is consistent with the system.img in the terminal firmware, so that the terminal can perform firmware upgrades normally when receiving the firmware upgrade package.

[0057] The firmware upgrade package obtained in this step may be a full upgrade package, a differential upgrade package, or both, which is not specifically limited here.

[0058] The firmware upgrade file processing method provided in the embodiment of the present application obtains a configuration file, reads a preset entry in the configuration file, generates an entry image corresponding to the preset entry, compiles the configuration file, generates an intermediate package, and the intermediate package includes a kernel symbol table generated based on the entry image, packages the intermediate package, and obtains a firmware upgrade package. In the embodiment of the present application, by reading the configuration file, generating an entry image file corresponding to the preset entry, and generating a kernel symbol table based on the image file, it is possible to avoid changes in the preset entries and the like in the compiled intermediate package, thereby helping to ensure that the firmware upgrade package is consistent with the terminal firmware to be upgraded in the preset entries, and improve the success rate of the terminal firmware upgrade.

[0059] In some embodiments, the above-mentioned preset entries include the above-mentioned block_list and fs_type, and these two preset entries are likely to change during the process of compiling the configuration file. In this embodiment, an entry mirror is generated for block_list and fs_type, so that when generating the kernel symbol table, the entry mirror is used to replace the preset entries with a high probability of change, thereby helping to ensure that the subsequently obtained firmware upgrade package is consistent with the terminal firmware to be upgraded in terms of the preset entries.

[0060] In some implementations, by setting the ota_from_target_files file, the boot.img file can be completely updated each time the intermediate package is packaged. On the one hand, the boot.img file comparison process can be saved. On the other hand, it can also effectively avoid the failure of terminal firmware upgrade due to abnormalities in the boot.img file during the packaging stage.

[0061] Optionally, the firmware upgrade package includes a first full upgrade package;

[0062] After packaging the intermediate package to obtain the firmware upgrade package, the method further includes:

[0063] Receiving a first firmware upgrade request sent by a first terminal;

[0064] In response to the first firmware upgrade request, a first full upgrade package is sent to the first terminal.

[0065] As shown in the above embodiments, the firmware upgrade package obtained by packaging may be a full upgrade package or a differential upgrade package.

[0066] In this embodiment, the first full upgrade package may be a full upgrade package included in the firmware upgrade package. In some application examples, when the server packages the intermediate package, it may generate a fixed first full upgrade package.

[0067] The first full upgrade package usually includes complete data required for upgrading the firmware version, and the first full upgrade package can be downloaded and installed by the terminal.

[0068] Generally speaking, there is a certain correspondence between the firmware upgrade package and the terminal. For example, for a mobile terminal and a large-screen display device, the firmware upgrade packages of the two are usually different; for large-screen display devices of different models, the firmware upgrade packages may also be different.

[0069] For ease of explanation, in this embodiment, the first full upgrade package may correspond to the first terminal, that is, the first terminal may perform a firmware upgrade based on the first full upgrade package.

[0070] In combination with some application scenarios, the first terminal can query whether there is a firmware upgrade package available for upgrading in the server, and when the server has a firmware upgrade package available for upgrading, the first terminal can automatically send a first firmware upgrade request to the server. Alternatively, the first terminal can send the first firmware upgrade request to the server when receiving a preset operation of upgrading controlled by the user.

[0071] As shown above, the server may package the intermediate package to obtain the first full upgrade package. Accordingly, upon receiving the first firmware upgrade request sent by the first terminal, the server may send the first full upgrade package to the first terminal.

[0072] Of course, in actual applications, when receiving the first firmware upgrade request, the server may also send the download address of the first full upgrade package to the first terminal, and the first terminal may further download the first full upgrade package according to the download address.

[0073] In general, the first terminal can obtain the first full upgrade package based on communication with the server. From the perspective of the server, it can be considered that the server sends the first full upgrade package to the first terminal.

[0074] In this embodiment, the firmware upgrade package includes a first full upgrade package. When the server receives the first firmware upgrade request sent by the first terminal, it sends the first full upgrade package to the first terminal, which helps the first terminal to at least reliably upgrade the firmware based on the full upgrade package.

[0075] Optionally, the firmware upgrade package further includes a differential reference package, and the first firmware upgrade request carries the first firmware version;

[0076] After receiving the first firmware upgrade request sent by the first terminal, the method further includes:

[0077] Acquire a first firmware file corresponding to the first firmware version;

[0078] Generate a first differential upgrade package according to the differential reference package and the first firmware file;

[0079] When a second firmware upgrade request carrying the first firmware version is received from the second terminal, a first differential upgrade package is sent to the second terminal.

[0080] In this embodiment, the firmware upgrade package may include a first full upgrade package and a differential reference package. The first full upgrade package has been described in the previous embodiment and will not be described again here.

[0081] The differential reference package can be a data package used to make a differential upgrade package. To a certain extent, the content of the differential reference package and the first full upgrade package can be roughly similar. The first full upgrade package can be directly sent to the terminal for firmware upgrade, and the differential reference package can be used to differentiate with the historical version of the firmware to obtain a differential upgrade package.

[0082] In this embodiment, after receiving the first firmware upgrade request sent by the first terminal, the server can send the first full upgrade package to the first terminal and generate a first differential upgrade package according to the firmware version of the first terminal. The generation process of the first differential upgrade package is described in detail below.

[0083] The first firmware upgrade request sent by the first terminal may carry a first firmware version, and the first firmware version may be a version of the current firmware of the first terminal.

[0084] After receiving the first firmware version, the server may obtain a first firmware file corresponding to the first firmware version.

[0085] In some application scenarios, the server may store firmware files corresponding to various firmware versions. These firmware files may be flash packages generated during the production process of historical firmware upgrade packages, or full upgrade packages generated.

[0086] Correspondingly, when the server receives the first firmware version, it can obtain the firmware file corresponding to the first firmware version, that is, the first firmware file mentioned above.

[0087] As shown above, the first differential reference package can be used to differentiate from the historical version of the firmware, and specifically in this embodiment, the server can generate a first differential upgrade package based on the first differential reference package and the first firmware file. As for the specific generation process of the differential upgrade package, it can be implemented by existing technologies and will not be described here.

[0088] It is easy to understand that in actual applications, there may be multiple terminals that need to perform firmware upgrades, and these terminals can all send a firmware upgrade request carrying a firmware version to the server.

[0089] In an application scenario, when a server generates a firmware upgrade package, multiple terminals may successively send firmware upgrade requests to the server. These terminals may include a first terminal and a second terminal, and the current firmware versions of the first terminal and the second terminal may be the same.

[0090] For example, each firmware version can be represented by a version number. The version number of the firmware upgrade package generated by the server can be recorded as v3, while the version numbers of the terminal firmware of the first terminal and the second terminal are both v1.1 (corresponding to the first firmware version).

[0091] When the server releases a firmware upgrade package of version v3, the first terminal may first send a first firmware upgrade request to the server, and the first firmware upgrade request carries the version number v1.1. In response to the first firmware upgrade request of the first terminal, the server may send a first full upgrade package of version v3 to the first terminal.

[0092] At the same time, from the server's perspective, when receiving the first firmware upgrade request carrying the version number v1.1, the server can be aware that there is currently a demand for upgrading the v1.1 firmware version. In order to save the firmware download traffic of subsequent terminals with the v1.1 firmware version, the server can further generate a differential upgrade package that matches the v1.1 firmware version (corresponding to the first differential upgrade package mentioned above).

[0093] The second terminal may send a second firmware upgrade request carrying version number v1.1 to the server after the first terminal. When the server receives the second firmware upgrade request sent by the second terminal, it may have generated a differential upgrade package corresponding to the v1.1 firmware version, so the differential upgrade package may be sent to the second terminal.

[0094] In practical applications, each firmware version may also be represented by the release time of the firmware version. Accordingly, the first firmware version carried in each firmware upgrade request may refer to the release time of the first firmware version.

[0095] In general, the first terminal and the second terminal may have successively sent firmware upgrade requests carrying the same firmware version to the server. In this embodiment, when the server receives the first firmware upgrade request sent by the first terminal, it generates a first differential upgrade package that matches the first firmware version, so that when the server receives the second firmware upgrade request carrying the first firmware version sent by the second terminal again, it sends the first differential upgrade package with a smaller required download traffic to the second terminal, thereby reducing the download traffic of the firmware upgrade package and improving the firmware upgrade efficiency of the second terminal.

[0096] At the same time, after receiving the first firmware upgrade request sent by the first terminal, the server can determine that there is currently a firmware upgrade requirement for the first firmware version. At this time, generating a first differential upgrade package can avoid the server directly generating matching differential upgrade packages for all historical firmware versions, thereby helping to reduce the waste of computing resources.

[0097] Optionally, before obtaining the first firmware file corresponding to the first firmware version, the method further includes:

[0098] Obtain target firmware version information, where the target firmware version information includes information about a firmware version between a first firmware version and a second firmware version, where the second firmware version is a firmware version corresponding to the firmware upgrade package;

[0099] Obtaining a first firmware file corresponding to a first firmware version includes:

[0100] When the target firmware version information does not contain a forced update firmware version, a first firmware file corresponding to the first firmware version is acquired.

[0101] In combination with the above example, the first firmware version may be the version of the firmware in the first terminal, with the version number v1.1 mentioned above, and the second firmware version may be the version corresponding to the firmware upgrade package, with the version number v3 mentioned above.

[0102] It is easy to understand that there may be one or more firmware versions between the v1.1 firmware version and the v3 firmware version. In this embodiment, the information of the one or more firmware versions, ie, the above-mentioned target firmware version information, can be obtained.

[0103] In some examples, the target firmware version information may specifically include the firmware version and its type, wherein the type of the firmware version may refer to whether the firmware version is forced to be updated.

[0104] For example, based on the target firmware version information obtained, the server can determine that between the v1.1 firmware version and the v3 firmware version, there are v1.2 firmware version and v2 firmware version, and both the v1.2 firmware version and the v2 firmware version are not mandatory firmware versions. At this time, the server can further obtain the first firmware file corresponding to the v1.1 firmware version, and generate a first differential upgrade package based on the first firmware file and the differential reference package.

[0105] It is easy to understand that when there is no mandatory firmware version to be updated between the first firmware version and the second firmware version, upgrading based on the differential package can generally ensure the stability of the upgraded firmware version.

[0106] Accordingly, in this embodiment, a first differential upgrade package can be generated based on the first firmware file and the differential reference package. When the server receives a second firmware upgrade request carrying the first firmware version sent by the second terminal, the first differential upgrade package can be sent to the second terminal so that the second terminal can upgrade the firmware version to the second firmware version by differential upgrade. In this way, the download traffic of the firmware upgrade package can be reduced while ensuring the stability of the firmware after the second terminal is upgraded, thereby improving the efficiency of the firmware upgrade.

[0107] Optionally, after obtaining the target firmware version information, the method further includes:

[0108] When the target firmware version information contains a forced update firmware version, obtaining a second firmware file, where the second firmware file is a firmware file corresponding to the forced update firmware version closest to the second firmware version;

[0109] generating a second differential upgrade package according to the differential reference package and the second firmware file;

[0110] When a second firmware upgrade request carrying the first firmware version is received from the second terminal, a second differential upgrade package and a second full upgrade package corresponding to the second firmware file are sent to the second terminal.

[0111] Also in combination with the above example, the version number of the first firmware version is v1.1, the version number of the second firmware version is v3, and there are two firmware versions v1.2 and v2 between the v1.1 firmware version and the v3 firmware version.

[0112] If the target firmware version information indicates that the v1.2 firmware version is not a mandatory update firmware version, but the v2 firmware version is a mandatory update firmware version, then the v2 firmware version can be considered as the mandatory update firmware version closest to the second firmware version, and accordingly, the firmware file corresponding to the v2 firmware version is the second firmware file.

[0113] As in the above embodiment, the server may store firmware files corresponding to various firmware versions, and the second firmware file may be considered as a firmware file corresponding to a historical firmware version. Accordingly, the second firmware file may be acquired by the server.

[0114] The server can generate a second differential upgrade package based on the second firmware file and the differential reference package. As for the specific method of generating the differential upgrade package, it will not be described here.

[0115] In this embodiment, when the server receives the second firmware upgrade request carrying the first firmware version sent by the second terminal, the server can send the second differential upgrade package and the second full upgrade package corresponding to the second firmware file to the second terminal.

[0116] In combination with the above example, from the perspective of the second terminal, you can first upgrade from v1.1 firmware version to v2, a mandatory update firmware version, based on the second full upgrade package, and then upgrade from v2 firmware version to v3 firmware version based on the second differential upgrade package.

[0117] Of course, in actual applications, there may be multiple mandatory update firmware versions between the first firmware version and the second firmware version. For example, the above-mentioned two firmware versions v1.2 and v2 are both mandatory update firmware versions.

[0118] In this case, the server can determine the forced update firmware version closest to the v3 firmware version from these forced update firmware versions, that is, the v2 firmware version mentioned above. The server can then further obtain the second firmware file corresponding to the v2 firmware version, and generate a second differential upgrade package, etc., which will not be repeated here.

[0119] For forced firmware version updates, the server can usually provide the relevant full upgrade package to the terminal for upgrading. Since each full upgrade package includes complete data for firmware upgrading, in this embodiment, the server can send the second firmware file corresponding to the forced update firmware version closest to the second firmware version to the second terminal, so that the firmware of the second terminal can be upgraded to a relatively stable version; at the same time, the second differential upgrade package generated based on the second firmware file and the differential reference package can have a relatively small data volume, which helps to improve the firmware upgrade efficiency of the second terminal.

[0120] Optionally, compile the configuration file to generate an intermediate package, including:

[0121] Compile the configuration file to obtain the kernel symbol table including the compiled preset entries;

[0122] Replace the compiled preset entry with the entry image to obtain the kernel symbol table generated based on the entry image.

[0123] In some examples, the process of compiling the configuration file can be divided into two stages. In the first stage, the server can compile the configuration file in a conventional manner. In this stage, the above-mentioned preset items can be compiled and may be changed. In the second stage, the compiled preset items can be replaced with item images, which can be the same as the preset items in the original configuration file.

[0124] Accordingly, the kernel symbol table finally obtained by compiling the configuration file may be a kernel symbol table including the above-mentioned entry image. From another perspective, it can be considered that the kernel symbol table is generated based on the entry image.

[0125] Generally, when making a configuration file, the preset entries therein may be matched in advance with the preset entries in the terminal's firmware. In this embodiment, by replacing the compiled preset entries with the entry images, it is helpful to make the preset entries in the kernel symbol table match the preset entries in the terminal's firmware, thereby helping to achieve a successful upgrade of the terminal's firmware.

[0126] Optionally, generating a first differential upgrade package according to the differential reference package and the first firmware file includes:

[0127] Create a container;

[0128] A first differential upgrade package is generated in the container according to the differential reference package and the first firmware file.

[0129] As shown above, the first firmware file may be a firmware file corresponding to the firmware version in the first terminal. In practical applications, there may be multiple terminals that need to perform firmware upgrades, and the firmware versions in these terminals may be different. Accordingly, the server may need to generate differential upgrade packages based on the differential baseline package and the firmware files corresponding to multiple historical firmware versions.

[0130] In order to improve the efficiency of the server in generating the differential upgrade package, in this embodiment, the first differential upgrade package may be generated based on the container technology.

[0131] For example, the server can create multiple docker containers, and one docker container can generate a differential upgrade package based on a differential baseline package and a firmware file of a historical firmware version. The generation of differential upgrade packages in multiple docker containers can be performed synchronously.

[0132] It is easy to understand that, in this embodiment, the first firmware file can be considered as a firmware file of a historical firmware version, and accordingly, it can also be input into one of the Docker containers together with the differential benchmark package to generate the first differential upgrade package.

[0133] Of course, in this embodiment, the type of container is not limited to the Docker container, and may also be a container of a type such as a Linux container, which will not be exemplified one by one here.

[0134] In this embodiment, the first differential upgrade package is generated based on the container technology, which helps to improve the overall generation efficiency of the differential upgrade package in the server.

[0135] Optionally, compile the configuration file to generate an intermediate package, including:

[0136] Obtain compilation parameters, including preset intermediate package type;

[0137] According to the compilation parameters, the configuration file is compiled to generate an intermediate package whose type matches the preset intermediate package type.

[0138] In some examples, before compiling the configuration file, the compilation parameters may be set, for example, two compilation parameters, get-bin and get-ota, may be added. The two compilation parameters may correspond to the bin intermediate package type and the ota intermediate package type, respectively.

[0139] After compiling the configuration file according to the compilation parameters, a bin type intermediate package and an ota type intermediate package can be generated.

[0140] In actual applications, the above compilation parameters can be set as needed. For example, only get-bin can be added, or only get-ota can be added, or other compilation parameters for generating other types of intermediate packages can be added.

[0141] In this embodiment, compiling the configuration file based on the compilation parameters including the preset intermediate package type helps to flexibly obtain the corresponding type of intermediate package as needed, thereby expanding the scope of application of the firmware upgrade file processing method.

[0142] The firmware upgrade file processing method provided by the embodiment of the present application is described below in conjunction with a specific application example. In this specific application example, the terminal may be a large-screen display device, and the server and the terminal may communicate.

[0143] The server may include a firmware entry module, a firmware management module, a version upgrade query module, a firmware differential version calculation module, a firmware differential module, and a factory firmware differential package generation module. The large-screen display device may include a large-screen upgrade module. The functions of these modules are described in detail below.

[0144] The firmware input module can input the firmware information and the full upgrade package of the firmware when a new version of the firmware is obtained.

[0145] For example, Figure 3 As shown in the figure, combined with an application scenario, after obtaining the official version of the firmware, the server-side user can log in to the firmware upgrade system, manually enter the firmware information, and upload the full upgrade package. The firmware information may include the firmware name, version number, internal model, internal identification code, upgrade attributes, whether to force an update, whether to perform a full or differential upgrade, the serial number of the targeted upgrade device, the MAC address of the targeted upgrade device, and upgrade instructions.

[0146] If the firmware information is set to non-differential upgrade, the full upgrade package is directly released. If the firmware information is set to differential upgrade, the firmware information can be put into the differential queue to wait for differential, and the differential upgrade package is released after the differential is completed.

[0147] The firmware management module can be used to add new firmware or query the firmware based on the internal model, internal identification code and firmware name. The firmware information can be edited and the firmware release status can be set.

[0148] In actual applications, users can filter firmware information through the drop-down menu, or enter part of the firmware name in the firmware name edit box to further filter.

[0149] like Figure 4As shown, in combination with some application scenarios, the internal model may refer to the product model of the terminal, or the model corresponding to the firmware. When the user selects the internal model, the server may display the firmware list of the product model. The user may further select an internal identification code in the firmware list. In response to the user's selection input, the server may display the firmware list of the internal model and internal identification code. The user may enter the firmware name and click to query. The server may further obtain the firmware list after the fuzzy query that matches the name.

[0150] The large-screen upgrade module is installed in the large-screen display device. It can regularly initiate new version queries to the server. If there is a new update, a prompt will pop up to ask the user whether to update. After the user confirms the update, the system will be guided to perform the upgrade operation.

[0151] like Figure 5 As shown, combined with some application scenarios, the large-screen upgrade module initiates a new version query each time it is started. If there is a new version of the firmware, a query box will pop up to prompt the user whether to upgrade. After the user allows, the new version of the firmware is downloaded according to the returned address. After the download is completed, the device is restarted to load the upgrade program.

[0152] If there is no new version of firmware, or the user manually cancels the upgrade, the large-screen upgrade module completes the query.

[0153] In some feasible implementations, the large-screen upgrade module may also actively trigger a version query when the user clicks an update button in the large-screen display device.

[0154] The version upgrade query module can be used to receive the version sent by the large-screen upgrade module for version query, and feedback to the large-screen upgrade module whether there is available upgrade firmware.

[0155] like Figure 5 and Figure 6 When receiving an upgrade query request, the version upgrade query module retrieves database records to confirm whether there is available upgrade firmware, and returns a firmware download address if there is, and returns a query result indicating that there is no updateable firmware if there is not.

[0156] The firmware differential version calculation module is used to send the differential records between the historical firmware and the current firmware to the differential queue when the new firmware is uploaded to the server, so that the subsequent differential module can retrieve it.

[0157] In one example, if Figure 7As shown, when there is a new firmware entry in the server, the firmware differential version calculation module first confirms the same type of firmware based on the internal type and internal identification code, and then compares the timestamp part in the firmware version. If there is a time update, it determines whether the new firmware is a forced update firmware version. If not, the two firmwares can be differentiated, and the version information of the two firmwares can be written into the differential queue waiting for differentiation; if so, no differentiation is performed and the differentiation stage is skipped.

[0158] The firmware differential module is used to read the differential queue and process the differential packet generation work of each version and the latest version of firmware in sequence according to the differential strategy.

[0159] The firmware differential module runs in the daemon process and reads the differential queue every preset time (for example, 1 minute) to see if there is a new record. If there is, it obtains the new record information and starts executing the Android differential program to generate a differential package. It uploads the differential package to the cloud storage and returns the download address. The address is finally stored in the database for the firmware upgrade query module to query.

[0160] The factory firmware differential package generation module can be used to generate intermediate packages, etc., which can include shell scripts and python files. Among them, the shell script can be used to mirror and replace preset items, etc.; the python file can be used to modify the default compilation parameters, such as the newly added get-bin and get-ota mentioned above.

[0161] like Figure 8 As shown, Figure 8 It is a comparison chart of the firmware upgrade file processing method in this application and the Android system differential upgrade process in conventional technology.

[0162] When the server receives the Android system source code, it can compile the Android system source code. The standard OTA program processing provided by Android (corresponding to conventional technology) can obtain an OTA differential reference package, including system.img. For easy distinction, the system.img obtained based on the standard OTA program processing can be called file A.

[0163] The OTA differential reference package obtained based on the firmware upgrade file processing method of the present application also includes system.img, which can be called file B.

[0164] The bin file used to write to the terminal also includes system.img, which can be called file C.

[0165] During the compilation of the standard OTA program, the preset entries may change, resulting in differences between file A and file C. In this application, even if the preset entries in system.img are changed during compilation, they can be changed back again by replacing the entry image, so that file B and file C are exactly the same.

[0166] Correspondingly, the differential upgrade package obtained by packaging the intermediate package is also obtained by the standard OTA program. The differential upgrade package fails to pass the upgrade verification because the system partition has differences, resulting in terminal upgrade failure. However, the differential upgrade package obtained by this application can ensure that the system partition is consistent, the upgrade verification passes, and the terminal is successfully upgraded.

[0167] like Fig. 9 As shown, the embodiment of the present application also provides a firmware upgrade file processing device, the device comprising:

[0168] A first acquisition module 901 is used to acquire a configuration file;

[0169] The reading and generating module 902 is used to read the preset entry in the configuration file and generate an entry image corresponding to the preset entry;

[0170] A compiling module 903 is used to compile a configuration file and generate an intermediate package, wherein the intermediate package includes a kernel symbol table generated based on the entry image;

[0171] The packaging module 904 is used to package the intermediate package to obtain a firmware upgrade package.

[0172] Optionally, the firmware upgrade package includes a first full upgrade package;

[0173] Accordingly, the firmware upgrade file processing device may further include:

[0174] A receiving module, configured to receive a first firmware upgrade request sent by a first terminal;

[0175] The first sending module is used to send a first full upgrade package to the first terminal in response to a first firmware upgrade request.

[0176] Optionally, the firmware upgrade package further includes a differential reference package, and the first firmware upgrade request carries the first firmware version;

[0177] Accordingly, the firmware upgrade file processing device may further include:

[0178] A second acquisition module, used to acquire a first firmware file corresponding to the first firmware version;

[0179] A first generating module, used for generating a first differential upgrade package according to the differential reference package and the first firmware file;

[0180] The second sending module is configured to send a first differential upgrade package to the second terminal upon receiving a second firmware upgrade request carrying the first firmware version sent by the second terminal.

[0181] Optionally, the firmware upgrade file processing device may further include:

[0182] A third acquisition module is used to acquire target firmware version information, where the target firmware version information includes information of a firmware version between the first firmware version and the second firmware version, where the second firmware version is the firmware version corresponding to the firmware upgrade package;

[0183] Accordingly, the second acquisition module may be specifically used for:

[0184] When the target firmware version information does not contain a forced update firmware version, a first firmware file corresponding to the first firmware version is acquired.

[0185] Optionally, the firmware upgrade file processing device may further include:

[0186] A fourth acquisition module is used to acquire a second firmware file when the target firmware version information has a forced update firmware version, where the second firmware file is a firmware file corresponding to the forced update firmware version closest to the second firmware version;

[0187] A second generating module, used for generating a second differential upgrade package according to the differential reference package and the second firmware file;

[0188] The third sending module is used to send the second differential upgrade package and the second full upgrade package corresponding to the second firmware file to the second terminal when receiving the second firmware upgrade request carrying the first firmware version sent by the second terminal.

[0189] Optionally, the first generating module includes:

[0190] Create unit, used to create container;

[0191] The generating unit is used to generate a first differential upgrade package in the container according to the differential reference package and the first firmware file.

[0192] Optionally, the compiling module 903 includes:

[0193] A first compiling unit is used to compile the configuration file to obtain a kernel symbol table including compiled preset entries;

[0194] The replacement unit is used to replace the compiled preset entry with the entry image to obtain a kernel symbol table generated based on the entry image.

[0195] Optionally, the compiling module 903 includes:

[0196] An acquisition unit, used for acquiring compilation parameters, the compilation parameters including a preset intermediate package type;

[0197] The second compiling unit is used to compile the configuration file according to the compiling parameters to generate an intermediate package whose type matches the preset intermediate package type.

[0198] Optionally, the preset entry includes a block list block_list and a storage type fs_type.

[0199] It should be noted that the firmware upgrade file processing device is a device corresponding to the above-mentioned firmware upgrade file processing method. All implementation methods in the above-mentioned method embodiment are applicable to the embodiment of the device and can achieve the same technical effect.

[0200] Fig.10 A schematic diagram of the hardware structure of the server provided in an embodiment of the present application is shown.

[0201] The server may include a processor 1001 and a memory 1002 storing computer program instructions.

[0202] Specifically, the processor 1001 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.

[0203] The memory 1002 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 1002 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 1002 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 1002 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 1002 is a non-volatile solid-state memory.

[0204] The memory may include read-only memory (ROM), random access memory (RAM), magnetic disk storage media devices, optical storage media devices, flash memory devices, electrical, optical or other physical / tangible memory storage devices. Thus, typically, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the methods according to the present disclosure.

[0205] The processor 1001 implements any one of the firmware upgrade file processing methods in the above embodiments by reading and executing computer program instructions stored in the memory 1002 .

[0206] In one example, the server may further include a communication interface 1003 and a bus 1010. Fig.10 As shown, the processor 1001, the memory 1002, and the communication interface 1003 are connected via a bus 1010 and communicate with each other.

[0207] The communication interface 1003 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.

[0208] Bus 1010 includes hardware, software or both.For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industry standard architecture (EISA) bus, front side bus (FSB), hypertransport (HT) interconnection, industry standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 1010 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the present application considers any suitable bus or interconnection.

[0209] In addition, in combination with the firmware upgrade file processing method in the above embodiment, the embodiment of the present application can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by the processor, any one of the firmware upgrade file processing methods in the above embodiment is implemented.

[0210] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.

[0211] The functional blocks shown in the above block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.

[0212] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.

[0213] Aspects of the present disclosure are described above with reference to the flowchart and / or block diagram of the method, device (system) and computer program product according to the embodiment of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.

[0214] The above are only specific implementation methods of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.

Claims

1. A method for processing firmware upgrade files, It is characterized in that include: Get the configuration file; Reading a preset entry in the configuration file, and generating an entry image corresponding to the preset entry; Compiling the configuration file to generate an intermediate package, wherein the intermediate package includes a kernel symbol table generated based on the entry image, wherein the preset entry is an entry used to generate the kernel symbol table, or an entry that may change during the process of directly compiling the configuration file; Packing the intermediate package to obtain a firmware upgrade package; The compiling the configuration file to generate an intermediate package includes: Compiling the configuration file to obtain a kernel symbol table including compiled preset entries; The compiled preset entry is replaced with the entry image to obtain the kernel symbol table generated based on the entry image.

2. The method according to claim 1, It is characterized in that The firmware upgrade package includes a first full upgrade package; After packaging the intermediate package to obtain a firmware upgrade package, the method further includes: Receiving a first firmware upgrade request sent by a first terminal; In response to the first firmware upgrade request, the first full upgrade package is sent to the first terminal.

3. The method according to claim 2, It is characterized in that The firmware upgrade package also includes a differential reference package, and the first firmware upgrade request carries a first firmware version; After receiving the first firmware upgrade request sent by the first terminal, the method further includes: Acquire a first firmware file corresponding to the first firmware version; generating a first differential upgrade package according to the differential reference package and the first firmware file; When a second firmware upgrade request carrying the first firmware version is received from a second terminal, the first differential upgrade package is sent to the second terminal.

4. The method according to claim 3, It is characterized in that Before obtaining the first firmware file corresponding to the first firmware version, the method further includes: Obtain target firmware version information, where the target firmware version information includes information about a firmware version between the first firmware version and a second firmware version, where the second firmware version is a firmware version corresponding to the firmware upgrade package; The obtaining the first firmware file corresponding to the first firmware version includes: When the target firmware version information does not contain a mandatory update firmware version, a first firmware file corresponding to the first firmware version is obtained.

5. The method according to claim 4, It is characterized in that After obtaining the target firmware version information, the method further includes: In the case that the target firmware version information contains a forced update firmware version, obtaining a second firmware file, where the second firmware file is a firmware file corresponding to a forced update firmware version that is closest to the second firmware version; generating a second differential upgrade package according to the differential reference package and the second firmware file; When a second firmware upgrade request carrying the first firmware version is received from a second terminal, the second differential upgrade package and a second full upgrade package corresponding to the second firmware file are sent to the second terminal.

6. The method according to claim 3, It is characterized in that The step of generating a first differential upgrade package according to the differential reference package and the first firmware file includes: Create a container; A first differential upgrade package is generated in the container according to the differential reference package and the first firmware file.

7. The method according to claim 1, It is characterized in that The compiling the configuration file to generate an intermediate package includes: Obtaining compilation parameters, wherein the compilation parameters include a preset intermediate package type; The configuration file is compiled according to the compilation parameters to generate an intermediate package whose type matches the preset intermediate package type.

8. A firmware upgrade file processing device, It is characterized in that The device comprises: A first acquisition module, used to acquire a configuration file; A reading and generating module, used for reading a preset entry in the configuration file and generating an entry image corresponding to the preset entry; A compiling module, used to compile the configuration file to generate an intermediate package, wherein the intermediate package includes a kernel symbol table generated based on the entry image, wherein the preset entry is an entry used to generate the kernel symbol table, or an entry that may change during the process of directly compiling the configuration file; A packaging module, used for packaging the intermediate package to obtain a firmware upgrade package; The compiling module is specifically used for: compiling the configuration file to obtain a kernel symbol table including compiled preset entries; replacing the compiled preset entries with the entry images to obtain the kernel symbol table generated based on the entry images.

9. A server, It is characterized in that The server includes: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the firmware upgrade file processing method according to any one of claims 1 to 7 is implemented.

10. A computer storage medium, It is characterized in that The computer storage medium stores computer program instructions, and when the computer program instructions are executed by the processor, the firmware upgrade file processing method according to any one of claims 1 to 7 is implemented.

11. A computer program product, It is characterized in that When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the firmware upgrade file processing method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method and device for updating software

    CN106802814A

  • Software upgrading method, intelligent terminal and device with storage function

    CN108170459A

  • A system upgrading method and apparatus

    CN109298873A

  • Method and device for generating upgrade package

    CN109426515A

  • Firmware difference upgrading method, device and equipment

    CN112230975A