Incremental upgrading method and device based on link, equipment and medium
By establishing a link between the original image and the incremental image of the target software without modifying the original image, and using the second incremental image for incremental upgrades, the problems of excessively large upgrade packages and excessive resource consumption are solved, achieving efficient software upgrades.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-25
- Publication Date
- 2026-05-26
AI Technical Summary
Existing software upgrade solutions suffer from problems such as large upgrade packages, long upgrade times, long upgrade package transmission times, large upgrade space requirements, and potential software anomalies, especially since differential upgrades require modifications to the original image.
By identifying the original image and existing incremental images of the target software, a target link relationship is established between the original image and the incremental image. Incremental upgrades are performed using the second incremental image, and software upgrades are performed based on the target link relationship without modifying the original image.
This avoids problems such as excessively large upgrade packages, long upgrade times, large upgrade space requirements, and software malfunctions caused by modifications to the original image, and reduces the consumption of flash resources.
Smart Images

Figure CN122086448A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of interactive technology, and in particular to a link-based incremental upgrade method, a link-based incremental upgrade device, an electronic device, and a computer-readable storage medium. Background Technology
[0002] After deployment, the software may require upgrades and updates; common upgrade methods include A / B upgrades, differential upgrades, or original image replacement upgrades; among which:
[0003] A / B upgrade is a dual-partition upgrade scheme where the two partitions (A and B) serve as backups for each other. During each upgrade, the system switches to the other partition, ensuring that while one partition is being upgraded, the other can continue providing services. The advantage of the A / B upgrade scheme is that it allows for rollback in case of upgrade failure. The disadvantages are that the upgrade package is large, requiring significant storage space, and the upgrade package transfer process takes a considerable amount of time.
[0004] Differential upgrade is an incremental upgrade scheme that only transmits and applies the differences in the upgrade package, rather than the entire image. Differential upgrade can significantly reduce the size of the upgrade package and the transmission time. The advantage of differential upgrade is that the upgrade package is smaller, resulting in shorter transmission time. The disadvantage is that it requires modifications to the original image, which may lead to software anomalies after upgrade failure; furthermore, differential upgrade requires a built-in differential upgrade algorithm, which consumes more RAM (Random Access Memory) resources.
[0005] Original image replacement upgrade is a full upgrade solution that transfers and applies the entire image, not just the differences. It is suitable for scenarios requiring a complete replacement of the system or application. The only advantage of original image replacement upgrade is its simplicity; however, its disadvantages include a large upgrade package, long upgrade time, and the need to modify the original image, which may lead to upgrade failure and software malfunctions. Summary of the Invention
[0006] In view of the above problems, a link-based incremental upgrade method, a link-based incremental upgrade device, an electronic device, and a computer-readable storage medium are proposed to overcome or at least partially solve the above problems, comprising:
[0007] A link-based incremental upgrade method, the method comprising:
[0008] Identify the original image of the target software, and the existing first incremental image for the target software;
[0009] Obtain the second incremental image currently used for incremental upgrade of the target software;
[0010] Establish target link relationships between the original image and the second incremental image, as well as between the first incremental image and the second incremental image;
[0011] Based on the second incremental image and the target link relationship, the target software is incrementally upgraded.
[0012] Optionally, establishing the target link relationship between the original image and the second incremental image, and between the first incremental image and the second incremental image, includes:
[0013] Obtain the first retargetable file of the target software from the original image and the first incremental image;
[0014] Obtain the second retargetable file currently used for incremental upgrade of the target software from the second incremental image;
[0015] Based on the second retargetable file and the first retargetable file, the target link relationship for the target software is determined.
[0016] Optionally, the incremental upgrade of the target software based on the second incremental image and the target link relationship includes:
[0017] Store the second incremental image into the preset incremental image area;
[0018] In addition, the target link relationship is stored in a preset global offset table area.
[0019] Optionally, the global offset table area includes a first table area and a second table area, with the first table area and the second table area serving as backups for each other; wherein:
[0020] When storing the target link relationship in the first table area, the first table area is a valid table area and the second table area is an invalid table area;
[0021] When storing the target link relationship in the second table area, the second table area is a valid table area and the first table area is an invalid table area.
[0022] Optionally, the method further includes:
[0023] The target software is run based on the incremental mirror area and the global offset table area.
[0024] Optionally, determining the target link relationship for the target software based on the second retargetable file and the first retargetable file includes:
[0025] Determine the first segment information, first layout information, and first symbol information corresponding to the first retargetable file, and the second segment information, second layout information, and second symbol information corresponding to the second retargetable file;
[0026] Merge the first segment of information and the second segment of information;
[0027] Based on the first layout information and the second layout information, the merged segment information is laid out to obtain the third layout information;
[0028] Based on the third layout information, the first symbol information, and the second symbol information, the merged segment information is redirected to obtain the target link relationship.
[0029] Optionally, merging the first segment of information and the second segment of information includes:
[0030] Based on the second segment of information, determine the third segment of information that has not changed in the first segment of information;
[0031] Merge the second segment of information and the third segment of information.
[0032] This invention also provides a link-based incremental upgrade device, the device comprising:
[0033] The determination module is used to determine the original image of the target software and the existing first incremental image for the target software;
[0034] The acquisition module is used to acquire the second incremental image currently used for incremental upgrade of the target software;
[0035] The relationship establishment module is used to establish target link relationships between the original image and the second incremental image, as well as between the first incremental image and the second incremental image;
[0036] The upgrade module is used to perform incremental upgrades on the target software based on the second incremental image and the target link relationship.
[0037] Optionally, the relationship establishment module is configured to obtain a first retargetable file of the target software from the original image and the first incremental image; obtain a second retargetable file currently used for incremental upgrade of the target software from the second incremental image; and determine the target link relationship for the target software based on the second retargetable file and the first retargetable file.
[0038] Optionally, the upgrade module is used to store the second incremental image in a preset incremental image area; and to store the target link relationship in a preset global offset table area.
[0039] Optionally, the global offset table area includes a first table area and a second table area, with the first table area and the second table area serving as backups for each other; wherein:
[0040] When storing the target link relationship in the first table area, the first table area is a valid table area and the second table area is an invalid table area;
[0041] When storing the target link relationship in the second table area, the second table area is a valid table area and the first table area is an invalid table area.
[0042] Optionally, the device further includes:
[0043] The running module is used to run the target software based on the incremental mirror area and the global offset table area.
[0044] Optionally, the relationship establishment module is used to determine the first segment information, first layout information, and first symbol information corresponding to the first retargetable file, and the second segment information, second layout information, and second symbol information corresponding to the second retargetable file; merge the first segment information and the second segment information; lay out the merged segment information according to the first layout information and the second layout information to obtain third layout information; and redirect the merged segment information according to the third layout information, the first symbol information, and the second symbol information to obtain the target link relationship.
[0045] Optionally, the relationship establishment module is used to determine, based on the second information segment, the third information segment that has not changed in the first information segment; and to merge the second information segment and the third information segment.
[0046] This invention also provides an electronic device, including a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, it implements the link-based incremental upgrade method described above.
[0047] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the link-based incremental upgrade method described above.
[0048] The embodiments of the present invention have the following advantages:
[0049] In this embodiment of the invention, the original image of the target software and an existing first incremental image for the target software are determined; a second incremental image currently used for incremental upgrades of the target software is obtained; target link relationships are established between the original image and the second incremental image, and between the first incremental image and the second incremental image; and incremental upgrades are performed on the target software based on the second incremental image and the target link relationships. Through this embodiment of the invention, incremental upgrades are completed based on the second incremental image, thereby avoiding problems such as large upgrade packages, long upgrade times, long upgrade package transmission times, and large upgrade space requirements. Furthermore, based on the target link relationships, the target software can index corresponding data from the original image, the first incremental image, and the second incremental image to run the latest version of the target software during runtime. Since no modification to the original image is involved, problems such as software anomalies caused by modifying the original image for incremental upgrades can be avoided, and a built-in differential upgrade algorithm is not required, thus avoiding excessive flash resource consumption. Attached Figure Description
[0050] To more clearly illustrate the technical solution of the present invention, the accompanying drawings used in the description of the present invention will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0051] Figure 1 This is a flowchart illustrating the steps of a link-based incremental upgrade method according to an embodiment of the present invention.
[0052] Figure 2 This is a flowchart illustrating the steps of another link-based incremental upgrade method according to an embodiment of the present invention.
[0053] Figure 3 This is a flowchart illustrating the steps of incremental connection construction according to an embodiment of the present invention;
[0054] Figure 4 This is a schematic diagram of a partitioning scheme according to an embodiment of the present invention;
[0055] Figure 5 This is a schematic diagram of a link-based incremental upgrade device according to an embodiment of the present invention. Detailed Implementation
[0056] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0057] To avoid issues such as excessively large upgrade packages consuming excessive flash resources, or software malfunctions caused by modifying the original image, this invention provides a new incremental upgrade scheme that can complete the upgrade without modifying the original image files. For details, please refer to... Figure 1 , Figure 1 A flowchart illustrating the steps of a link-based incremental upgrade method according to an embodiment of the present invention is shown. Figure 1 As shown, the method may include the following steps:
[0058] Step 101: Determine the original image of the target software and the existing first incremental image for the target software.
[0059] In practical applications, three areas can be set up: one area to store the original image, one area to store the incremental image for the target software, and one area to store the link relationships. The original image remains unchanged, while updates and upgrades to the target software are performed by adding incremental images and modifying the link relationships. The link relationships can include related references between data, mutual references between functions, etc., and this embodiment of the invention does not impose limitations on them.
[0060] In this embodiment of the invention, the target software can be a system or an application. When updating or upgrading the target software, the original image of the target software can be determined first, that is, the image initially deployed for the target software, i.e., the image of the first version of the target software.
[0061] If the target software has been updated or upgraded, an existing first incremental image for the target software can also be obtained. This first incremental image can refer to an incremental image used to update or upgrade the target software during a historical period, and may include data modified, added, or deleted compared to the original image. This embodiment of the invention does not impose such limitations.
[0062] Step 102: Obtain the second incremental image currently used for incremental upgrade of the target software.
[0063] Additionally, a second incremental image can be obtained for incremental upgrades of the target software. This second incremental image may include data modified, added, or deleted relative to the currently running image of the target software.
[0064] The first incremental image can be an incremental image of the target software within a historical time period; the second incremental image can be an incremental image of the target software at the current time.
[0065] Step 103: Establish the target link relationship between the original image and the second incremental image, as well as between the first incremental image and the second incremental image.
[0066] After obtaining the original image, the first incremental image, and the second incremental image, a link can be established between the original image and the second incremental image, as well as between the first incremental image and the second incremental image, thus obtaining the target link relationship. Based on the established target link relationship, all data references and function references for the target software can be adjusted, so that when the target software is subsequently started, data and functions can be called according to the new target link relationship.
[0067] Step 104: Based on the second incremental image and the target link relationship, perform an incremental upgrade on the target software.
[0068] After obtaining the target link relationship, the deployed target software can be incrementally upgraded based on the second incremental image and the target link relationship; subsequently, when starting the target software, data and functions in the image can be called based on the target link relationship.
[0069] In this embodiment of the invention, the original image of the target software and an existing first incremental image of the target software are determined.
[0070] In practical applications, three areas can be set up: one area to store the original image, one area to store incremental images for the target software (e.g., a first incremental image or a second incremental image), and one area to store target link relationships. The original image remains unchanged, while updates and upgrades to the target software are performed through incremental images and modifications to the target link relationships. The target link relationships may include related references between data, mutual references between functions, etc., and this embodiment of the invention does not impose limitations on these relationships.
[0071] In this embodiment of the invention, the original image of the target software and an existing first incremental image for the target software are determined; a second incremental image currently used for incremental upgrades of the target software is obtained; target link relationships are established between the original image and the second incremental image, and between the first incremental image and the second incremental image; and incremental upgrades are performed on the target software based on the second incremental image and the target link relationships. Through this embodiment of the invention, incremental upgrades are completed based on the second incremental image, thereby avoiding problems such as large upgrade packages, long upgrade times, long upgrade package transmission times, and large upgrade space requirements. Furthermore, based on the target link relationships, the target software can index corresponding data from the original image, the first incremental image, and the second incremental image to run the latest version of the target software during runtime. Since no modification to the original image is involved, problems such as software anomalies caused by modifying the original image for incremental upgrades can be avoided, and a built-in differential upgrade algorithm is not required, thus avoiding excessive flash resource consumption.
[0072] Reference Figure 2 The diagram illustrates a flowchart of another link-based incremental upgrade method according to an embodiment of the present invention, which may include the following steps:
[0073] Step 201: Determine the original image of the target software and the existing first incremental image for the target software.
[0074] When updating or upgrading target software, you can first determine the original image of the target software; that is, the original image that was initially deployed for the target software.
[0075] If the target software has been updated or upgraded, an existing first incremental image for the target software can also be obtained. This first incremental image can refer to the incremental image used to update or upgrade the target software during a previous update or upgrade, and may include data modified, added, or deleted relative to the original image. This embodiment of the invention does not impose any limitations on this.
[0076] Step 202: Obtain the second incremental image currently used for incremental upgrade of the target software.
[0077] Additionally, a second incremental image can be obtained for incremental upgrades of the target software. This second incremental image may include data modified, added, or deleted relative to the currently running image of the target software.
[0078] Step 203: Obtain the first retargetable file of the target software from the original image and the first incremental image.
[0079] After obtaining the original image and the first incremental image, all the first reversible files of the target software can be extracted from them. These first reversible files can refer to all the reversible files that the target software depends on during its current runtime.
[0080] Among them, a retargetable file refers to an ELF (Executable and Linkable Format) file, which contains code and data, retargeting information, symbol information of code and data, and debugging information.
[0081] Step 204: Obtain the second retargetable file currently used for incremental upgrade of the target software from the second incremental image.
[0082] Additionally, a second retargetable file can be obtained from the second incremental image, which is currently used for incremental upgrades of the target software's data, functions, data reference relationships, function reference relationships, etc.
[0083] Step 205: Determine the target link relationship for the target software based on the second retargetable file and the first retargetable file.
[0084] After obtaining the second retargetable file and the first retargetable file, the reference relationships of the data and functions required to run the target software can be determined based on the overlapping and differences between the second and first retargetable files, thereby determining the target linking relationships of the target software.
[0085] In one embodiment of the present invention, step 205 can be implemented by the following sub-steps:
[0086] Sub-step 11: Determine the first segment information, first layout information, and first symbol information corresponding to the first retargetable file, and the second segment information, second layout information, and second symbol information corresponding to the second retargetable file.
[0087] In some feasible embodiments, the first retargetable file can be analyzed first to obtain the first segment information, first layout information, and first symbol information corresponding to the first retargetable file. The first segment information can be a section, for example, it can include, for instance, the .data section and .bss section of data, the .text section of text, and user-defined sections. Segment information can describe information about different logical parts (segments) of the program within an executable file or shared library, helping to organize, optimize, and debug the program.
[0088] First-order layout information describes the physical layout of a program in memory, aiding in memory management, linking, and loading. First-order symbol information describes identifiers and related information within a program, assisting in symbol resolution, debugging, and optimization.
[0089] Sub-step 12: Merge the first segment of information and the second segment of information.
[0090] In some feasible embodiments, after obtaining the first segment of information and the second segment of information, the first segment of information and the second segment of information can be merged to obtain the merged segment information.
[0091] Sub-step 13: Based on the first layout information and the second layout information, lay out the merged segment information to obtain the third layout information.
[0092] Then, based on the first and second layout information, the merged segment information can be rearranged to obtain the third layout information, which is the new layout information of the first and second segment information.
[0093] Specifically, since all information retrieval and loading relationships may change due to updates, after obtaining the first and second layout information, the linking and loading relationships of the information in the merged segment information can be adjusted based on the first and second layout information, thereby realizing the rearrangement of the information in the merged segment information, and obtaining the third layout information based on the rearranged information.
[0094] For example, a new layout rule can be derived for the target software's data based on the first and second layout information. Then, the merged segment information can be rearranged according to the new layout rule to obtain the third layout information. The third layout information records this new segment arrangement and the position of each piece of information in the merged segment information.
[0095] Sub-step 14: Based on the third layout information, the first symbol information, and the second symbol information, redirect the merged segment information to obtain the target link relationship.
[0096] Next, based on the third layout information, the first symbol information, and the second symbol information, the merged segment information can be redirected to obtain the upgraded reference relationships of the data used to run the target software, the reference relationships of functions, etc., i.e., the target link relationships.
[0097] Specifically, after determining the third layout information, the reference relationships between corresponding symbols and function reference relationships in the merged segment information can be updated and adjusted based on the first symbol information, the second symbol information, and the third layout information, thereby obtaining the upgraded reference relationships of data and function reference relationships used to run the target software, i.e., the target link relationships.
[0098] For example, based on the third layout information, the actual memory address of each symbol (i.e., the first symbol information and the second symbol information) can be determined first. Then, the address references can be updated to the actual memory addresses. Next, the redirection address and redirection method of each symbol can be recorded, and the redirected information can be organized into target link relationships.
[0099] In one embodiment of the present invention, sub-step 12 can be implemented in the following manner:
[0100] Based on the second piece of information, identify the third piece of information that has not changed in the first piece of information; then merge the second and third pieces of information.
[0101] In some feasible embodiments, segment information that has changed may not be considered for merging; specifically, the third segment information that has not changed in the first segment information can be determined based on the second segment information; then, the third segment information that has not changed and the second segment information are merged to obtain the merged segment information.
[0102] Step 206: Store the second incremental image in the preset incremental image area; and store the target link relationship in the preset global offset table area.
[0103] After obtaining the second incremental image and the target link relationship, the second incremental image can be stored in the preset incremental image area, which is the area used to store incremental images for the target software; in addition, the target link relationship can be stored in the preset global offset table area, which is the area used to store link relationships. Thus, the update and upgrade of the target software is complete.
[0104] In one embodiment of the present invention, the global offset table area includes a first table area and a second table area, wherein the first table area and the second table area serve as backups for each other; wherein:
[0105] When storing the target link relationship in the first table area, the first table area is a valid table area and the second table area is an invalid table area;
[0106] When storing the target link relationship in the second table area, the second table area is a valid table area and the first table area is an invalid table area.
[0107] In some feasible embodiments, the global offset table area can be designed in an A / B format, that is, there is a first table area and a second table area, wherein the first table area and the second table area are backups of each other.
[0108] If the target link relationship is stored in the first table area, then the first table area is a valid table area and the second table area is an invalid table area; if the target link relationship is stored in the second table area, then the second table area is a valid table area and the first table area is an invalid table area.
[0109] When the first table area is a valid table area, the starting address in the first table area can be assigned to the register when the target software is running; when the second table area is a valid table area, the starting address in the second table area can be assigned to the register when the target software is running.
[0110] In one embodiment of the present invention, the above method may further include the following steps:
[0111] Run the target software based on the incremental mirror area and the global offset table area.
[0112] In some feasible embodiments, when starting and running the target software, the starting address of the global offset table area can be assigned to a register, and the register can be used to establish a secondary index link relationship. Then, based on the link relationship, the register can obtain the latest data, functions, etc. used to run the target software to run the target software.
[0113] For example, the original image and the modified image are based on the relocatable object (i.e., the redirectable file), that is, based on the .c file, .asm file, or .cpp file. For example, if a .c file contains 10 functions or 5 data items, and one of the functions in the file changes, the file containing that function needs to be put into the incremental upgrade package.
[0114] like Figure 3 As shown, the original image can be processed first; specifically, all sections (i.e., segment information) and their layouts (i.e., layout information) of the original image can be obtained first. Additionally, all relocatable objects can be obtained from the original image.
[0115] Iterate through all input relocatable objects (i.e. incremental images used for upgrades) and reserve the layout of all sections of the input relocatable object based on the original image relocatable object, that is, reserve the positions of all sections of the input relocatable object in memory.
[0116] Iterate through the changed relocatable objects (i.e., the incremental images used for upgrades), obtain the symbols (i.e., symbol information) and sections of the changed relocatable objects, and force the sections of the changed relocatable objects to be named incremental_section, so as to determine which sections belong to the changed relocatable objects based on the naming.
[0117] Iterate through the symbols and sections of the unchanged relocatable object and specify the valid section of the unchanged relocatable object in the reserve area, that is, reserve the valid section of the unchanged relocatable object in memory.
[0118] The incremental section of the changed relocatable object is laid out and designated as a valid section; then, all valid sections and changed sections can be merged to obtain a new data package for software upgrades.
[0119] The merged sections are laid out according to the linking script, and the latest link relationships are established by redirecting based on the layout and symbols.
[0120] Ultimately, a new image can be generated; the incremental data packet is the sum of the links between the original image and the new image. Sending the incremental data packet to the board completes the software upgrade.
[0121] like Figure 4 As shown, the original mirror area, global offset table area, and incremental mirror area can be set. Among them:
[0122] The original image area is used to store the original image, and this part will never change.
[0123] The global offset table area is used to store the GOT tables. The contents of the GOT tables will change with each upgrade. There are two GOT tables in the global offset table area (i.e., valid GOT and invalid GOT), which are A / B to each other. The size of the GOT tables may change, so the global offset table area needs to be reserved. During the device startup process, the starting address of the valid table is assigned to the register, and the register is used to index the GOT table in a secondary manner.
[0124] The incremental mirror area holds incremental images, and the incremental upgrade area will continuously expand as the number of upgrades increases.
[0125] The relationship between function calls or data references in the original image and the incremental image is a two-way reference, and the function calls or data references in the original image and the incremental image are transferred through the GOT table.
[0126] like Figure 4 As shown, updated software can be run based on the original mirror area, the global offset table area, the incremental mirror area, and the links within them. Here, caller0 and caller1 are function callers, callee0 and callee1 are function or data callees, and callee0 entry and callee1 entry refer to specific entries in the function call stack. During startup, a valid GOT table is first determined based on the validity flag. Then, depending on the platform's characteristics, the global GOT table register is set to point to the valid GOT table. Finally, the software is started based on the valid GOT table, the original mirror area, and the incremental mirror area.
[0127] In this embodiment of the invention, the original image of the target software and an existing first incremental image for the target software are determined; a second incremental image currently used for incremental upgrades of the target software is obtained; a first retargetable file of the target software is obtained from the original image and the first incremental image; a second retargetable file currently used for incremental upgrades of the target software is obtained from the second incremental image; a target link relationship for the target software is determined based on the second retargetable file and the first retargetable file; the second incremental image is stored in a preset incremental image area; and the target link relationship is stored in a preset global offset table area. Through this embodiment of the invention, incremental upgrades are completed based on the second incremental image, thereby avoiding problems such as excessively large upgrade packages and excessive flash resource consumption during upgrades. Furthermore, based on the target link relationship, the target software can run the latest version of the target software by indexing corresponding data from the original image, the first incremental image, and the second incremental image based on the target link relationship. Since no modification to the original image is involved, problems such as software anomalies caused by modifying the original image for incremental upgrades can be avoided.
[0128] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.
[0129] Reference Figure 5 The diagram illustrates a structural schematic of a link-based incremental upgrade device according to an embodiment of the present invention, which may include the following modules:
[0130] The determination module 501 is used to determine the original image of the target software and the existing first incremental image of the target software.
[0131] Module 502 is used to acquire the second incremental image currently used for incremental upgrade of the target software;
[0132] The relationship establishment module 503 is used to establish target link relationships between the original image and the second incremental image, as well as between the first incremental image and the second incremental image;
[0133] Upgrade module 504 is used to perform incremental upgrades on the target software based on the second incremental image and the target link relationship.
[0134] In an optional embodiment of the present invention, the relationship establishment module 503 is used to obtain a first retargetable file of the target software from the original image and the first incremental image; obtain a second retargetable file currently used for incremental upgrade of the target software from the second incremental image; and determine the target link relationship for the target software based on the second retargetable file and the first retargetable file.
[0135] In an optional embodiment of the present invention, the upgrade module 504 is used to store the second incremental image into a preset incremental image area; and to store the target link relationship into a preset global offset table area.
[0136] In an optional embodiment of the present invention, the global offset table area includes a first table area and a second table area, wherein the first table area and the second table area are backups of each other; wherein:
[0137] When storing the target link relationship in the first table area, the first table area is a valid table area and the second table area is an invalid table area;
[0138] When storing the target link relationship in the second table area, the second table area is a valid table area and the first table area is an invalid table area.
[0139] In an optional embodiment of the present invention, the relationship establishment module 503 is used to determine the first segment information, the first layout information, and the first symbol information corresponding to the first retargetable file, and the second segment information, the second layout information, and the second symbol information corresponding to the second retargetable file; merge the first segment information and the second segment information; lay out the merged segment information according to the first layout information and the second layout information to obtain the third layout information; and redirect the merged segment information according to the third layout information, the first symbol information, and the second symbol information to obtain the target link relationship.
[0140] In an optional embodiment of the present invention, the relationship establishment module 503 is used to determine, based on the second information, the third information that has not changed in the first information; and to merge the second information and the third information.
[0141] In an optional embodiment of the present invention, the apparatus further includes:
[0142] The runtime module is used to run the target software based on the incremental mirror area and the global offset table area.
[0143] In this embodiment of the invention, the original image of the target software and an existing first incremental image for the target software are determined; a second incremental image currently used for incremental upgrades of the target software is obtained; target link relationships are established between the original image and the second incremental image, and between the first incremental image and the second incremental image; and incremental upgrades are performed on the target software based on the second incremental image and the target link relationships. Through this embodiment of the invention, incremental upgrades are completed based on the second incremental image, thereby avoiding problems such as large upgrade packages, long upgrade times, long upgrade package transmission times, and large upgrade space requirements. Furthermore, based on the target link relationships, the target software can index corresponding data from the original image, the first incremental image, and the second incremental image to run the latest version of the target software during runtime. Since no modification to the original image is involved, problems such as software anomalies caused by modifying the original image for incremental upgrades can be avoided, and a built-in differential upgrade algorithm is not required, thus avoiding excessive flash resource consumption.
[0144] This invention also provides an electronic device, including a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, it implements the link-based incremental upgrade method described above.
[0145] This invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the link-based incremental upgrade method described above.
[0146] As the apparatus embodiment is basically similar to the method embodiment, it is described in a relatively simple manner. For relevant details, please refer to the description of the method embodiment.
[0147] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0148] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, apparatus, or computer program products. Therefore, embodiments of the present invention can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of the present invention can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0149] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0150] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0151] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0152] Although preferred embodiments of the present invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present invention.
[0153] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.
[0154] The foregoing has provided a detailed description of a link-based incremental upgrade method, a link-based incremental upgrade device, an electronic device, and a computer-readable storage medium. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are merely for the purpose of helping to understand the method and core ideas of the present invention. Furthermore, those skilled in the art will recognize that, based on the ideas of the present invention, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A link-based incremental upgrade method, characterized in that, The method includes: Identify the original image of the target software, and the existing first incremental image for the target software; Obtain the second incremental image currently used for incremental upgrade of the target software; Establish target link relationships between the original image and the second incremental image, as well as between the first incremental image and the second incremental image; Based on the second incremental image and the target link relationship, the target software is incrementally upgraded.
2. The method according to claim 1, characterized in that, The establishment of the target link relationship between the original image, the first incremental image, and the second incremental image includes: Obtain the first retargetable file of the target software from the original image and the first incremental image; Obtain the second retargetable file currently used for incremental upgrade of the target software from the second incremental image; Based on the second retargetable file and the first retargetable file, the target link relationship for the target software is determined.
3. The method according to claim 2, characterized in that, The incremental upgrade of the target software based on the second incremental image and the target link relationship includes: Store the second incremental image into a preset incremental image area; In addition, the target link relationship is stored in a preset global offset table area.
4. The method according to claim 3, characterized in that, The global offset table area includes a first table area and a second table area, which serve as backups for each other; wherein: When storing the target link relationship in the first table area, the first table area is a valid table area and the second table area is an invalid table area; When storing the target link relationship in the second table area, the second table area is a valid table area and the first table area is an invalid table area.
5. The method according to claim 3, characterized in that, The method further includes: The target software is run based on the incremental mirror area and the global offset table area.
6. The method according to claim 2, characterized in that, The step of determining the target link relationship for the target software based on the second retargetable file and the first retargetable file includes: Determine the first segment information, first layout information, and first symbol information corresponding to the first retargetable file, and the second segment information, second layout information, and second symbol information corresponding to the second retargetable file; Merge the first segment of information and the second segment of information; Based on the first layout information and the second layout information, the merged segment information is laid out to obtain the third layout information; Based on the third layout information, the first symbol information, and the second symbol information, the merged segment information is redirected to obtain the target link relationship.
7. The method according to claim 6, characterized in that, The merging of the first segment of information and the second segment of information includes: Based on the second segment of information, determine the third segment of information that has not changed in the first segment of information; Merge the second segment of information and the third segment of information.
8. A link-based incremental upgrade device, characterized in that, The device includes: The determination module is used to determine the original image of the target software and the existing first incremental image for the target software; The acquisition module is used to acquire the second incremental image currently used for incremental upgrade of the target software; The relationship establishment module is used to establish the target link relationship between the original image and the first incremental image, and the second incremental image. The upgrade module is used to perform incremental upgrades on the target software based on the second incremental image and the target link relationship.
9. An electronic device, characterized in that, It includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program, when executed by the processor, implements the link-based incremental upgrade method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, which, when executed by a processor, implements the link-based incremental upgrade method as described in any one of claims 1 to 7.