Patch loading method, patch compression method, and related device

By dividing the patch file into multiple compressed files and decompressing and loading them sequentially, the problem of patch loading failure caused by memory fragmentation in embedded communication devices was solved, thereby improving the success rate of software upgrades and the stability of device services.

CN114253589BActive Publication Date: 2026-02-24BEIJING HUAWEI DIGITAL TECH
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202010997466.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-21
Publication Date
2026-02-24
Estimated Expiration
2040-09-21

AI Technical Summary

Technical Problem

In embedded communication devices, patch loading failures caused by memory fragmentation can lead to software version upgrade failures, affecting the normal operation of device services.

Method used

The patch file is divided into multiple compressed files, which are then decompressed and loaded into the target memory area in sequence. The correct loading order is ensured by the loading sequence code to avoid loading failures caused by memory fragmentation.

Benefits of technology

This reduces the probability of patch loading failures, decreases the risk of device service interruption, and improves the efficiency of software upgrades.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114253589B_ABST
    Figure CN114253589B_ABST
Patent Text Reader

Abstract

The application discloses a patch loading method, which can be applied to the field of software patches and comprises the following steps: a first device receives a patch file sent by a server, wherein the patch file comprises N compressed files; the first device sequentially decompresses the N compressed files and sequentially stores N patch data obtained by decompressing the N compressed files into a target continuous memory area, wherein each patch data in the N patch data comprises one or more patch units; before decompressing a next compressed file, the first device loads patch data corresponding to a previous compressed file into a patch memory area of a target program. According to the application, the patch file is divided into multiple decompressed files, and patch loading is sequentially performed, so that the probability of patch loading failure caused by memory fragmentation of the first device can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of software patching, and in particular to patch loading methods, patch compression methods, and related equipment. Background Technology

[0002] A software patch is a term in computer software systems and software engineering. It refers to a separate software unit released to correct certain errors in system software. Software patches fix system errors without affecting the normal operation of the system, enabling dynamic system upgrades.

[0003] Software patching requires several key technologies, including patch file creation, patch loading and synchronization, and patch unit management. Patch loading refers to loading the patch file into the patch area. Patch files typically include compressed patch files for individual boards and compressed patch data for the main control board. Before loading the patch, the device needs to retrieve the patch file from the server and decompress it into the device's memory in one go before performing the patch upgrade. In today's embedded communication environment, a device's continuous operation time is measured in years. Continuous operation leads to memory fragmentation on individual boards, which worsens with longer operation. Simultaneously, the device's software version is constantly upgraded, requiring increasingly larger patch files (longer operation time means more problems are discovered and resolved, and more features are developed).

[0004] In this situation, issues can easily arise where insufficient continuous memory on the device prevents patch loading, leading to software upgrade failures. Furthermore, once this problem occurs, the device can no longer be upgraded by simply applying patches; it must be restarted and memory fragmentation cleared before the upgrade can proceed. This will cause service interruption and disrupt normal business operations. Summary of the Invention

[0005] This application provides a patch loading method, a patch compression method, and related devices, which can reduce the probability of patch loading failure due to memory fragmentation.

[0006] The first aspect of this application provides a patch loading method.

[0007] The method includes: a first device receiving a patch file sent by a server, the patch file including N compressed files, where N is an integer greater than 1; the first device sequentially decompressing the N compressed files and storing the resulting N patch data sequentially into a target contiguous memory area, each patch data including one or more patch units; before decompressing the next compressed file, the first device loading the patch data corresponding to the previous compressed file into the patch memory area of ​​the target program.

[0008] Dividing the patch file into multiple decompressed files and loading the patch sequentially can reduce the probability of patch loading failure due to memory fragmentation on the first device, thereby reducing the probability of service interruption on the first device.

[0009] In one optional design of the first aspect, the N compressed files include N load sequence codes, each corresponding one-to-one with one of the N compressed files; the first device decompresses the N compressed files sequentially according to the order of the N load sequence codes. However, the patch units within the patch files may have an incorrect loading order; if the order is incorrect, the software upgrade may fail. When the first device decompresses the patch files into its memory all at once, there is no decompression order issue. This application requires the sequential decompression of the N compressed files; therefore, load sequence codes need to be added to the N compressed files to avoid software upgrade failure due to loading order issues.

[0010] In one alternative design of the first aspect, the first device further receives a first request sent by the server, and sends a target value to the server according to the first request. The target value is the size of the target contiguous memory region, and the target value is greater than the file size of any one of the N compressed files. Regardless of how many compressed files the server divides the patch file into, the first device may still face the problem of insufficient contiguous memory. The first device in this application, by sending the target value to the server, can ensure that the first device has sufficient contiguous memory and avoid the server dividing the patch file into too many compressed files, thus preventing inefficient software upgrades.

[0011] In one optional design of the first aspect, the sum of the data size of the target compressed file and the data size of the target patch unit is greater than a target value. The target compressed file is any one of the first N-1 compressed files among N compressed files, and the target patch unit is the first patch unit in the compressed file following the target compressed file. When the sum of the data size of the target compressed file and the data size of the target patch unit is greater than the target value, the contiguous memory corresponding to the target value can be fully utilized, reducing the number of compressed files and improving the efficiency of software upgrades.

[0012] The second aspect of this application provides a patch compression method.

[0013] The method includes: the server sending a patch file to the first device, the patch file including N compressed files, where N is an integer greater than 1, the N compressed files being decompressed sequentially by the first device and stored in the target contiguous memory area to obtain N patch data, each of the N patch data including one or more patch units, and before decompressing the next compressed file, the patch data corresponding to the previous compressed file being loaded by the first device into the patch memory area of ​​the target program.

[0014] In one alternative design of the second aspect, the N compressed files include N loading sequence codes, each of which corresponds one-to-one with one of the N compressed files. The N loading sequence codes are used by the first device to decompress the N compressed files sequentially according to the order of the N loading sequence codes.

[0015] In one alternative design of the second aspect, the server sends a first request to the first device and receives a target value sent by the first device. The target value is the memory size of the target contiguous memory area and is greater than the file size of any one of the N compressed files.

[0016] In one alternative design of the second aspect, the size of the target compressed file plus the size of the target patch unit is greater than the target value. The target compressed file is any one of the first N-1 compressed files among N compressed files, and the target patch unit is the first patch unit in the compressed file following the target compressed file.

[0017] A third aspect of this application provides an apparatus for loading patches.

[0018] The device includes: a receiving module for receiving patch files sent by a server, wherein the patch files consist of N compressed files, where N is an integer greater than 1;

[0019] The decompression module is used to decompress N compressed files sequentially and store the resulting N patch data into the target contiguous memory area sequentially. Each patch data in the N patch data includes one or more patch units.

[0020] The loading module is used to load the patch data corresponding to the previous compressed file into the patch memory area of ​​the target program before decompressing the next compressed file.

[0021] In one alternative design of the third aspect, the N compressed files include N loading sequence codes, and the N loading sequence codes correspond one-to-one with the N compressed files;

[0022] The decompression module is specifically used to decompress N compressed files sequentially according to the order of N load sequence codes.

[0023] In an alternative design of the third aspect, the receiving module is also used to receive the first request sent by the server;

[0024] The device also includes:

[0025] The sending module is used to send the target value to the server according to the first request. The target value is the memory size of the target contiguous memory area and is greater than the file size of any one of the N compressed files.

[0026] In one alternative design of the third aspect, the size of the target compressed file plus the size of the target patch unit is greater than the target value. The target compressed file is any one of the first N-1 compressed files among the N compressed files, and the target patch unit is the first patch unit in the compressed file following the target compressed file.

[0027] The fourth aspect of this application provides an apparatus for compressing patches.

[0028] The device includes: a sending module for sending a patch file to a first device. The patch file includes N compressed files, where N is an integer greater than 1. The first device sequentially decompresses the N compressed files and stores them in a target contiguous memory area to obtain N patch data. Each patch data in the N patch data includes one or more patch units. Before decompressing the next compressed file, the patch data corresponding to the previous compressed file is loaded by the first device into the patch memory area of ​​the target program.

[0029] In one optional design of the fourth aspect, the N compressed files include N loading sequence codes, each of which corresponds one-to-one with one of the N compressed files. The N loading sequence codes are used by the first device to decompress the N compressed files sequentially according to the order of the N loading sequence codes.

[0030] In an alternative design of the fourth aspect, the sending module is also used to send a first request to the first device;

[0031] The device also includes:

[0032] The receiving module is used to receive the target value sent by the first device. The target value is the size of the target contiguous memory area and is greater than the file size of any one of the N compressed files.

[0033] In one alternative design of the fourth aspect, the size of the target compressed file plus the size of the target patch unit is greater than the target value. The target compressed file is any one of the first N-1 compressed files among the N compressed files, and the target patch unit is the first patch unit in the next compressed file after the target compressed file.

[0034] The fifth aspect of this application provides a device for loading patches.

[0035] The device includes a processor and a transceiver. The transceiver is used to receive patch files sent by the server. The patch files consist of N compressed files, where N is an integer greater than 1.

[0036] The processor is used to decompress N compressed files sequentially and store the resulting N patch data into the target contiguous memory area sequentially. Each patch data in the N patch data includes one or more patch units.

[0037] Before decompressing the next compressed file, the processor loads the patch data corresponding to the previous compressed file into the patch memory area of ​​the target program.

[0038] In one optional design of the fifth aspect, the N compressed files include N loading sequence codes, and the N loading sequence codes correspond one-to-one with the N compressed files;

[0039] The processor is specifically used to decompress N compressed files sequentially according to the order of the N load sequence codes.

[0040] In an alternative design of the fifth aspect, the transceiver is also used to receive the first request sent by the server;

[0041] The transceiver is also used to send a target value to the server according to the first request. The target value is the size of the target contiguous memory area and is greater than the file size of any one of the N compressed files.

[0042] In one alternative design of the fifth aspect, the size of the target compressed file plus the size of the target patch unit is greater than the target value. The target compressed file is any one of the first N-1 compressed files among the N compressed files, and the target patch unit is the first patch unit in the next compressed file after the target compressed file.

[0043] The sixth aspect of this application provides a device for compressing patches.

[0044] The device includes a processor and a transceiver. The processor is used to compress N patch data to obtain N compressed data.

[0045] The transceiver is used to send patch files to the first device. The patch files consist of N compressed files, where N is an integer greater than 1. The first device decompresses the N compressed files sequentially and stores them in the target contiguous memory area to obtain N patch data. Each patch data in the N patch data includes one or more patch units. Before decompressing the next compressed file, the patch data corresponding to the previous compressed file is loaded into the patch memory area of ​​the target program by the first device.

[0046] In one optional design of the sixth aspect, the N compressed files include N loading sequence codes, each of which corresponds one-to-one with one of the N compressed files. The N loading sequence codes are used by the first device to decompress the N compressed files sequentially according to the order of the N loading sequence codes.

[0047] In an alternative design of the sixth aspect, the transceiver is also used to send a first request to the first device;

[0048] The transceiver is also used to receive the target value sent by the first device. The target value is the size of the target contiguous memory area and is greater than the file size of any one of the N compressed files.

[0049] In one alternative design of the sixth aspect, the size of the target compressed file plus the size of the target patch unit is greater than the target value. The target compressed file is any one of the first N-1 compressed files among the N compressed files, and the target patch unit is the first patch unit in the next compressed file after the target compressed file.

[0050] A seventh aspect of this application provides a computer storage medium, characterized in that the computer storage medium stores instructions that, when executed on a computer, cause the computer to perform the method as described in the first aspect or any embodiment of the first aspect; or cause the computer to perform the method as described in the second aspect or any embodiment of the second aspect.

[0051] The eighth aspect of this application provides a computer program product, characterized in that, when the computer program product is executed on a computer, it causes the computer to perform the method as described in the first aspect or any embodiment of the first aspect; or causes the computer to perform the method as described in the first aspect or any embodiment of the first aspect. Attached Figure Description

[0052] Figure 1 Flowchart of the method for extracting the patch using the overall decompression process;

[0053] Figure 2 A schematic diagram of a contiguous memory structure;

[0054] Figure 3 This is a schematic diagram of the patching technology processing flow in the embodiments of this application;

[0055] Figure 4 This is a schematic diagram of an application scenario in an embodiment of this application;

[0056] Figure 5 This is a flowchart illustrating the patch compression method and patch loading method in the embodiments of this application;

[0057] Figure 6 This is a schematic diagram of the patch compression process in an embodiment of this application;

[0058] Figure 7 This is a flowchart illustrating the sequential decompression method used in the patch decompression of this application embodiment;

[0059] Figure 8 This is a schematic diagram of the device for loading patches in an embodiment of this application;

[0060] Figure 9 This is a schematic diagram of the device for compressing patches in an embodiment of this application;

[0061] Figure 10 This is a schematic diagram of the structure of a device for loading patches or compressing patches in the embodiments of this application. Detailed Implementation

[0062] This application provides a patch loading method, a patch compression method, and related equipment, which are applied in the field of software patching. They can reduce the probability of patch loading failure due to memory fragmentation, thereby reducing the probability of business interruption.

[0063] In embedded communication devices, patching technology is an important method for software version upgrades. In particular, hot patching (upgrade) technology is one of the most widely used techniques. It can ensure that software version upgrades are completed without restarting the device, and has little or no impact on the services running on the device.

[0064] The traditional patching process is as follows: Figure 1 As shown, Figure 1 The flowchart illustrates the overall decompression method used in patch decompression. After obtaining patch file 101, the device decompresses patch file 101 into the device's buffer in one go (also known as overall decompression). For example, patch file 101 includes a single-board patch compressed file and a main control board patch compressed file. The device decompresses the main control board patch compressed file from patch file 101 into the main control board patch buffer 102 to obtain the main control board patch data, which includes main control board patch units 1 to n1. Then, the device loads the main control board patch data into the main control board patch memory area 104, thus completing the main control board patch loading. Simultaneously with decompressing the main control board patch compressed file from patch file 101 into the main control board patch buffer 102, the device also decompresses the single-board patch compressed file from patch file 101 into the single-board patch buffer 103 to obtain single-board patch data, which includes single-board patch units 1 to n2. Then, the device loads the single-board patch data into the single-board patch memory area 105, thus completing the single-board patch loading.

[0065] However, the continuous operation of a device is measured in years. This continuous operation leads to memory fragmentation on the circuit boards, which worsens with longer operation. Simultaneously, the patch files required for software upgrades become increasingly large (longer operation time means more problems are discovered and resolved, and more features are added). This combination can easily result in insufficient contiguous memory, causing patches to fail to load and software upgrades to fail. Specifically, for example… Figure 2 As shown, Figure 2This is a schematic diagram of a contiguous memory structure. Assume the device has 150MB of free memory. This 150MB of free memory comprises three contiguous memory regions: a 50MB contiguous memory region, a 20MB contiguous memory region, and an 80MB contiguous memory region. These three contiguous memory regions are not contiguous with each other. Figure 1 The decompressed file of the single-board patch, i.e., the patch data, is 81MB in size. In this case, the patch data cannot be cached in any of the three memory areas mentioned above, leading to incomplete or failed decompression and patch loading failure. Furthermore, after this problem occurs, the device can no longer upgrade its software version using patching technology; it can only be upgraded after restarting the single board and clearing memory fragmentation. This will inevitably cause service interruption on the device and trigger related problems.

[0066] To address this, this application provides a patch compression method and a patch loading method. In the patch compression method, the server divides patch units into multiple groups, and each group is compressed separately to obtain multiple compressed patch files. In the patch loading method, a first device receives patch files sent by the server and sequentially decompresses multiple compressed files within the patch file to the same contiguous memory area. For ease of description, this contiguous memory area is referred to as the target contiguous memory area. Before decompressing the next compressed file, the first device loads the patch data corresponding to the previous compressed file into the patch memory area of ​​the target program. The resulting multiple patch data are used to upgrade the target program. Using the above method, a single compressed file can be divided into multiple compressed files, reducing the size of a single compressed file and thus reducing the probability of patch loading failure due to memory fragmentation, thereby reducing the probability of service interruption.

[0067] To facilitate understanding of the methods provided in the embodiments of this application, the processing flow of the patching technology is first described. Please refer to... Figure 3 , Figure 3 This is a schematic diagram illustrating the patching technology processing flow in an embodiment of this application. Figure 3As shown, the patching process can include patch creation 301, patch compression 302, patch decompression 303, and patch loading 304. Patch creation 301 refers to the process of generating patch units, including but not limited to manual input and software generation. Manual input generally refers to programmers analyzing problems in the target program or identifying areas requiring upgrades, and then writing one or more patch units specifically for a particular problem or content. If multiple patch units are generated for the target program, patch compression 302 will divide these units into multiple groups and compress them into multiple compressed files. Patch decompression 303 is used to sequentially decompress the compressed files within the multiple compressed files and store the decompressed patch data sequentially into the target program's contiguous memory area. Patch loading 304 is used to load the patch data corresponding to the previous compressed file into the target program's patch memory area before decompressing the next compressed file.

[0068] The patching process has been described above, divided into patch creation (301), patch compression (302), patch decompression (303), and patch loading (304). This process requires specific computer equipment to execute; different steps can be completed on different computers or on the same computer. For example, please refer to... Figure 4 , Figure 4 This is a schematic diagram of an application scenario in an embodiment of this application. Figure 4 The system includes a server 401 and a first device 402. The server 401 obtains multiple patch units for upgrading the target software. These patch units can be obtained by the server 401 through patch creation 301, or they can be obtained by the server 401 from other devices. The server 401 executes step patch decompression 303 to obtain multiple compressed files. After obtaining the multiple compressed files, the server 401 transmits the multiple compressed files to the first device 402. The first device 402 decompresses the multiple compressed files through step 303 to obtain multiple patch data. Furthermore, the first device 402 completes the loading of the patch data by executing step 304. In this embodiment, the following will refer to... Figure 4 This example illustrates the process; for other scenarios, please refer to the example provided. Figure 4 The description of the scene.

[0069] exist Figure 4In this application scenario, server 401 can be a desktop computer, laptop, or other computer device with storage and computing capabilities, or it can be a cloud storage device, such as a cloud server. First device 402 can be an access network device, such as a Long Term Evolution (LTE) base station, an evolved Node B (eNB), or a router, switch, or other network element device. First device 402 may or may not establish a connection with server 401. If first device 402 establishes a connection with server 401, the connection method can be wired or wireless; a wireless connection can be a Wi-Fi hotspot or Bluetooth. If first device 402 does not establish a connection with server 401, multiple compressed files can be transferred using a storage medium, such as a USB flash drive.

[0070] The technical solutions in this application will now be described with reference to the accompanying drawings. For example, features or content marked with dashed lines in the drawings related to the embodiments of this application can be understood as optional operations or optional structures of the embodiments.

[0071] Please see Figure 5 , Figure 5 This is a flowchart illustrating the patch compression method and patch loading method in the embodiments of this application.

[0072] In step 501, the server sends a first request to the first device.

[0073] The first request is used to confirm the maximum contiguous memory space available for the first device.

[0074] In step 502, the first device sends the target value to the server.

[0075] The target value is the size of the target contiguous memory region, which is the contiguous memory region that the first device can allocate for this software upgrade.

[0076] In other embodiments, the maximum value of multiple compressed files is a default value, such as 2M. If the maximum contiguous memory space available to the first device is greater than 2M, then in step 502, the first device may simply reply with an acknowledgment message instead of replying with the target value.

[0077] In step 503, the server compresses the patch unit according to the target value to obtain a patch file, which includes N compressed files.

[0078] To make it easier to understand, an example is given below, assuming the target value is 1M. For example... Figure 6 As shown, Figure 6 This is a schematic diagram illustrating the patch compression process in an embodiment of this application. Figure 6In the process, the server compresses patch units 1 to n, resulting in N compressed patch files. Patch units 1 to n can be all single-board patch units, all main control board patch units, or a combination of single-board and main control board patch units. The value in parentheses for the patch unit indicates the size of the compressed data; for example, patch unit 1 (200KB) means patch unit 1 is 200KB in size after compression. The value after the compressed file name indicates the size of the compressed file; for example, compressed file 1 870KB means compressed file 1 is 870KB in size. Figure 6 In the file, patch units 1-3 are compressed into compressed file 1, patch unit 4 is compressed into compressed file 2, and patch files 5 and 6 are compressed into compressed file 3. For other descriptions, please refer to [link to other descriptions]. Figure 6 It should be noted that, Figure 6 This is just an example for the sake of illustration. In actual applications, it is possible that more patch units are compressed into a single compressed file, or that the patch file contains more or fewer compressed files.

[0079] N compressed files include N load order codes, for example Figure 6 The compressed file extensions are 1, 2, 3, 4…N. Of course, in practical applications, other identifiers can be used as loading order codes, such as a, b, c, d, etc. Patch units 1 to n are ordered. The specific order of patch units depends on their content. For example, patch unit 3 implements a new timer function to fix the original timer problem (such as periodically refreshing routes), while patch unit 4 adds a new timer. During normal patch loading, patch unit 3 must be loaded before patch unit 4, therefore patch units 3 and 4 are ordered. If patch unit 4 is loaded first, before patch unit 3 is loaded, a timer might be triggered, calling a function address that doesn't yet exist, causing the first device to malfunction. Figure 6 In the example, if patch unit 3 and patch unit 4 exist in a specific order, then compressed file 1 and compressed file 2 also exist in a specific order. Therefore, the N compressed files include N load order codes, which are used to represent the load order of the N compressed files.

[0080] Here's an explanation of the definition of a patch unit. Generally, a patch unit is defined as one or more files generated to solve a problem or update certain content. Specifically, files with the ".o" extension are .obj files, commonly known as object files. One .obj file can be understood as a patch unit, and multiple .obj files linked together to form one .obj file can also be understood as a patch unit.

[0081] In this embodiment, the size of each compressed file is less than the target value of 1MB. Even if the compressed file is less than 1MB, the size will not be increased by adding part of the content of the next patch unit. For example, if compressed file 1 is 870KB, part of the content of patch unit 4 will not be compressed into compressed file 1 to make the compressed file size reach 1MB.

[0082] The size of the target compressed file plus the size of the target patch unit is greater than the target value. The target compressed file is any one of the first N-1 compressed files among N compressed files, and the target patch unit is the first patch unit in the compressed file following the target compressed file. Figure 6 In the example shown, the target compressed file can compress files 1 to N-1. Specifically, taking compressed file 1 as the target compressed file, the target patch unit is patch unit 4. The size of compressed file 1 plus the size of patch unit 4 after compression is greater than the target value, that is, greater than 1M.

[0083] It should be noted that if steps 501 and 502 are not executed, the server can compress the patch file according to the default contiguous memory size. For example, if it is believed from experience that the first device can definitely request 5M of contiguous memory under normal business scenarios, then the patch units are added to the compressed file in sequence until the size exceeds 5M. Then, the previous patch unit is returned, a new compressed file is added, and the patch units that have not been added to the compressed file are added to the new compressed file in the order of the patch units until the size exceeds 5M, and so on, until all patch units are added to the compressed file.

[0084] In step 504, the server sends a patch file to the first device.

[0085] In step 505, the first device sequentially decompresses N compressed files to obtain N patch data.

[0086] Please see Figure 7 , Figure 7 This is a flowchart illustrating the sequential decompression method used in the patch decompression of this application embodiment. For ease of understanding, Figure 7 The patch files in the middle inherit Figure 6 The patch file is obtained from the server. After the first device receives the patch file, it sequentially decompresses the N compressed files within the patch file to obtain N patch data files. The decompression order can be the order of the N load sequence codes. It should be noted that... Figure 7Although the illustrated patch data in the target patch contiguous memory area includes patch units 1 to n, in actual applications, the target patch contiguous memory area will not simultaneously include patch units 1 to n. Furthermore, the target patch contiguous memory area may not simultaneously contain two complete patch data sets. This is because before decompressing the next compressed file, the first device loads the patch data corresponding to the previous compressed file into the target program's patch memory area. For example, using... Figure 7 For example, after the first device decompresses compressed file 1, the obtained patch data includes patch units 1 to 3. The first device loads the obtained patch data from the target contiguous memory area into the target program's patch memory area. After loading, the first device starts decompressing compressed file 2, and the obtained patch data includes patch unit 4. The first device loads the obtained patch data from the target contiguous memory area into the target program's patch memory area. After loading, the first device starts decompressing compressed file 3... and so on, until all N compressed files are decompressed.

[0087] In step 506, the first device loads N patch data sequentially.

[0088] As described in step 505, the first device sequentially loads the patch data in the target patch contiguous memory area until N patch data have been loaded.

[0089] The patch compression method and patch loading method in the embodiments of this application have been described above. The apparatus for loading patches in the embodiments of this application is described below.

[0090] Please see Figure 8 , Figure 8 This is a schematic diagram of the device for loading patches in an embodiment of this application.

[0091] The device includes: a receiving module 801, used to receive patch files sent by a server, wherein the patch files include N compressed files, where N is an integer greater than 1;

[0092] The decompression module 802 is used to decompress N compressed files sequentially and store the resulting N patch data into the target contiguous memory area sequentially. Each patch data in the N patch data includes one or more patch units.

[0093] Loading module 803 is used to load the patch data corresponding to the previous compressed file into the patch memory area of ​​the target program before decompressing the next compressed file.

[0094] In other embodiments, the device may further include a transmitting module, etc. The modules in the device are specifically used to perform the aforementioned... Figure 5 The first device in the corresponding embodiment can perform all or part of the operations.

[0095] The apparatus for loading patches in the embodiments of this application has been described above. The apparatus for compressing patches in the embodiments of this application is described below.

[0096] Please see Figure 9 , Figure 9 This is a schematic diagram of the device for compressing patches in an embodiment of this application.

[0097] The device includes: a sending module 901, used to send a patch file to a first device. The patch file includes N compressed files, where N is an integer greater than 1. The first device sequentially decompresses the N compressed files and stores them in a target contiguous memory area to obtain N patch data. Each patch data in the N patch data includes one or more patch units. Before decompressing the next compressed file, the patch data corresponding to the previous compressed file is loaded by the first device into the patch memory area of ​​the target program.

[0098] In other embodiments, the device may further include a receiving module, etc. The module in the device is specifically used to perform the aforementioned... Figure 5 The server in the corresponding embodiment can perform all or part of the operations.

[0099] The apparatus for loading patches and the apparatus for compressing patches in the embodiments of this application have been described above. The apparatus for loading patches in the embodiments of this application will be described below.

[0100] Please see Figure 10 , Figure 10 This is a schematic diagram of the structure of a device for loading patches or compressing patches in the embodiments of this application.

[0101] like Figure 10As shown, the device 1000 for loading or compressing patches includes a processor 1010 and a transceiver 1020 coupled to the processor 1010. The processor 1010 may be a central processing unit (CPU), a network processor (NP), or a combination of a CPU and an NP. The processor may also be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof. The processor 1010 may refer to a single processor or may include multiple processors.

[0102] In other embodiments, the device for loading or compressing the patch also includes memory, which may include volatile memory, such as random-access memory (RAM); memory may also include non-volatile memory, such as read-only memory (ROM), FRAM memory, flash memory, hard disk drive (HDD), or solid-state drive (SSD); memory may also include combinations of the above types of memory.

[0103] when Figure 10 When the diagram shows the structure of the device that loads the patch:

[0104] Transceiver 1020 is used to receive patch files sent by the server. The patch files consist of N compressed files, where N is an integer greater than 1.

[0105] The processor 1010 is used to decompress N compressed files sequentially and store the resulting N patch data into the target contiguous memory area sequentially. Each patch data in the N patch data includes one or more patch units.

[0106] Before decompressing the next compressed file, the processor 1010 loads the patch data corresponding to the previous compressed file into the patch memory area of ​​the target program.

[0107] In other embodiments, the device for loading or compressing the patch also includes memory, which may include volatile memory, such as random-access memory (RAM); memory may also include non-volatile memory, such as read-only memory (ROM), FRAM memory, flash memory, hard disk drive (HDD), or solid-state drive (SSD); memory may also include combinations of the above types of memory.

[0108] when Figure 10 When the diagram shows the structure of a device for compressing patches:

[0109] Processor 1010 is used to compress N patch data to obtain N compressed data;

[0110] Transceiver 1020 is used to send patch files to the first device. The patch files include N compressed files, where N is an integer greater than 1. The first device decompresses the N compressed files sequentially and stores them in the target contiguous memory area to obtain N patch data. Each patch data in the N patch data includes one or more patch units. Before decompressing the next compressed file, the patch data corresponding to the previous compressed file is loaded into the patch memory area of ​​the target program by the first device.

[0111] In other embodiments, the processor 1010 is further configured to, after executing computer-readable instructions in memory, perform all or part of the operations that the server can perform, as instructed by the computer-readable instructions, such as when the server interacts with... Figure 5 The operations performed in the corresponding embodiments.

[0112] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between apparatuses or units through some interfaces, and may be electrical, mechanical, or other forms.

[0113] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0114] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0115] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer first device (which may be a personal computer, a server, or a network first device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.

Claims

1. A patch loading method, characterized in that, include: The first device receives the first request sent by the server; The first device sends a target value to the server according to the first request. The target value is the memory size of the target contiguous memory area and the target value is greater than the file size of any one of the N compressed files. The first device receives a patch file sent by the server, the patch file comprising the N compressed files, where N is an integer greater than 1; The first device sequentially decompresses the N compressed files and sequentially stores the resulting N patch data into the target contiguous memory area. Each patch data in the N patch data includes one or more patch units. The size of the target compressed file plus the size of the target patch unit is greater than the target value. The target compressed file is any one of the first N-1 compressed files in the N compressed files. The target patch unit is the first patch unit in the next compressed file after the target compressed file. Before decompressing the next compressed file, the first device loads the patch data corresponding to the previous compressed file into the patch memory area of ​​the target program.

2. The method according to claim 1, characterized in that, The N compressed files include N loading sequence codes, and the N loading sequence codes correspond one-to-one with the N compressed files; The first device sequentially decompresses the N compressed files, including: The first device decompresses the N compressed files sequentially according to the order of the N loading sequence codes.

3. A patch compression method, characterized in that, include: The server sends a first request to the first device; The server receives the target value sent by the first device. The target value is the memory size of the target contiguous memory area. The target value is greater than the file size of any one of the N compressed files. The server sends a patch file to the first device. The patch file includes N compressed files, where N is an integer greater than 1. The N compressed files are sequentially decompressed by the first device and stored in the target contiguous memory area to obtain N patch data. Each patch data includes one or more patch units. Before decompressing the next compressed file, the patch data corresponding to the previous compressed file is loaded into the patch memory area of ​​the target program by the first device. The size of the target compressed file plus the size of the target patch unit is greater than the target value. The target compressed file is any one of the first N-1 compressed files among the N compressed files, and the target patch unit is the first patch unit in the next compressed file after the target compressed file.

4. The method according to claim 3, characterized in that, The N compressed files include N loading sequence codes, each corresponding to one of the N compressed files. The N loading sequence codes are used by the first device to decompress the N compressed files sequentially according to the order of the N loading sequence codes.

5. An apparatus for loading patches, characterized in that, include: The receiving module is also used to receive the first request sent by the server; The sending module is configured to send a target value to the server according to the first request, wherein the target value is the memory size of a target contiguous memory region and the target value is greater than the file size of any one of the N compressed files; The receiving module is used to receive patch files sent by the server, the patch files including the N compressed files, where N is an integer greater than 1; The decompression module is used to decompress the N compressed files sequentially and store the resulting N patch data into the target contiguous memory area sequentially. Each patch data in the N patch data includes one or more patch units. The size of the target compressed file plus the size of the target patch unit is greater than the target value. The target compressed file is any one of the first N-1 compressed files in the N compressed files. The target patch unit is the first patch unit in the next compressed file after the target compressed file. The loading module is used to load the patch data corresponding to the previous compressed file into the patch memory area of ​​the target program before decompressing the next compressed file.

6. The apparatus according to claim 5, characterized in that, The N compressed files include N loading sequence codes, and the N loading sequence codes correspond one-to-one with the N compressed files; The decompression module is specifically used to decompress the N compressed files sequentially according to the order of the N loading sequence codes.

7. An apparatus for compressing patches, characterized in that, include: The sending module is also used to send a first request to the first device; A receiving module is used to receive a target value sent by the first device, wherein the target value is the memory size of a target contiguous memory area, and the target value is greater than the file size of any one of the N compressed files; The sending module is used to send a patch file to the first device. The patch file includes the N compressed files, where N is an integer greater than 1. The N compressed files are sequentially decompressed by the first device and stored in the target contiguous memory area to obtain N patch data. Each patch data in the N patch data includes one or more patch units. Before decompressing the next compressed file, the patch data corresponding to the previous compressed file is loaded into the patch memory area of ​​the target program by the first device. The size of the target compressed file plus the size of the target patch unit is greater than the target value. The target compressed file is any one of the first N-1 compressed files among the N compressed files, and the target patch unit is the first patch unit in the next compressed file after the target compressed file.

8. The apparatus according to claim 7, characterized in that, The N compressed files include N loading sequence codes, each corresponding to one of the N compressed files. The N loading sequence codes are used by the first device to decompress the N compressed files sequentially according to the order of the N loading sequence codes.

9. A device for loading patches, characterized in that, include: A processor and a transceiver, the transceiver being used to receive a first request sent by the server; According to the first request, a target value is sent to the server, the target value being the memory size of a target contiguous memory region, and the target value being greater than the file size of any one of the N compressed files; a patch file is received from the server, the patch file including the N compressed files, where N is an integer greater than 1; The processor is used to decompress the N compressed files sequentially and store the resulting N patch data into the target contiguous memory area sequentially. Each patch data in the N patch data includes one or more patch units. The size of the target compressed file plus the size of the target patch unit is greater than the target value. The target compressed file is any one of the first N-1 compressed files in the N compressed files. The target patch unit is the first patch unit in the next compressed file after the target compressed file. Before decompressing the next compressed file, the processor loads the patch data corresponding to the previous compressed file into the patch memory area of ​​the target program.

10. A device for compressing patches, characterized in that, include: Processor and transceiver, The transceiver is used to send a first request to the first device; Receive the target value sent by the first device, wherein the target value is the memory size of the target contiguous memory region, and the target value is greater than the file size of any one of the N compressed files; The processor is used to compress N patch data to obtain N compressed data; The transceiver is also used to send a patch file to the first device. The patch file includes the N compressed files, where N is an integer greater than 1. The N compressed files are decompressed sequentially by the first device and stored in the target contiguous memory area to obtain the N patch data. Each patch data in the N patch data includes one or more patch units. Before decompressing the next compressed file, the patch data corresponding to the previous compressed file is loaded into the patch memory area of ​​the target program by the first device. The size of the target compressed file plus the size of the target patch unit is greater than the target value. The target compressed file is any one of the first N-1 compressed files among the N compressed files, and the target patch unit is the first patch unit in the next compressed file after the target compressed file.

Citation Information

Patent Citations

  • Installation method and device of component type multimode patch pack

    CN102902562A

  • Patch method using RAM(random-access memory)and temporary memory, patch server, and client

    CN102945170A

  • Set top box based file upgrading system and method

    CN105451042A

  • System and method for updating a computing device

    EP3680773A1