Application program updating method, device, computer equipment and storage medium
By traversing the keywords in the patch data packet according to data hierarchy relationships during the application update process and updating the data to be updated, the problem of developers' difficulty in verifying whether the patch is effectively repairing application problems, and achieving fast and effective application updates and verification.
Patent Information
- Application Number
- CN202210264141.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-17
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2042-03-17
AI Technical Summary
During the application update process, it is difficult for developers to determine whether the patches are effectively fixing problems in the application, resulting in a long time repackaging or rerun to verify that the problem is resolved.
By obtaining the patch data packet and the data packet to be updated for the target application, the keywords at each data level are traversed according to the data hierarchy relationship in the patch data packet until the keywords at the preset data level are traversed, thereby updating the data to be updated for the target to be updated according to the data hierarchy relationship in the patch data packet until the keywords at the preset data level are traversed, so as to Target patch data corresponding to keywords at the preset data level.
It realizes effective repair and verification of application problems, avoiding the long-term situation caused by verifying whether the problem is resolved.
Smart Images

Figure CN114564228B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to an application updating method, device, computer equipment and storage medium. Background Art
[0002] In the process of computer application development, due to various reasons, there will inevitably be errors and defects, which are often called program vulnerabilities (BUGs). When a BUG appears in an application, it is necessary to promptly fix the BUG through a program (i.e., patch) used to solve the program vulnerability to solve the problem in the application.
[0003] When fixing a bug, a patch is usually used to directly replace the old code with the bug. This method of fixing the bug makes it impossible for developers to know whether the patch has solved the problem in the application. Therefore, it takes a long time to repackage or rerun the application to verify whether the problem in the application has been solved. Summary of the invention
[0004] The embodiments of the present disclosure at least provide an application updating method, apparatus, computer equipment and storage medium.
[0005] In a first aspect, an embodiment of the present disclosure provides an application updating method, comprising:
[0006] Acquire a patch data packet of a target application, and determine a data packet to be updated indicated in the patch data packet; the patch data packet is used to update the data packet to be updated;
[0007] According to the data hierarchy relationship in the patch data packet, traverse each keyword corresponding to each data hierarchy, and continue traversing according to the patch data corresponding to each keyword until the keyword of the preset data hierarchy is traversed;
[0008] Searching for target data to be updated corresponding to the keyword of the preset data level from the data packet to be updated;
[0009] The target data to be updated is updated to target patch data corresponding to the keyword of the preset data level.
[0010] In an optional implementation, traversing each keyword corresponding to each data level, and continuing to traverse according to patch data corresponding to each keyword until traversing to a keyword of a preset data level, includes:
[0011] For each data level, based on each keyword corresponding to the data level, determine the patch data corresponding to each keyword, and determine the data format of the patch data;
[0012] If the data format of the patch data is in table format, continue to traverse each keyword corresponding to the next data level of the patch data in table format, and continue to traverse according to the patch data corresponding to each keyword of the next data level until traversing to the keyword of the preset data level.
[0013] In an optional implementation, after determining the data format of the patch data, the method further includes:
[0014] If the data form of the patch data is in function form, based on the function identifier and the keyword corresponding to the patch data in function form, searching for the data to be updated corresponding to the function identifier and the keyword in the data packet to be updated, and determining the data form of the data to be updated;
[0015] In the case where the data to be updated is in table form, the data to be updated in table form is used to assign values to the patch data in function form to obtain the table value corresponding to the patch data, and then continue to traverse each keyword corresponding to each data level in the table value, and continue to traverse according to the patch data corresponding to each keyword until the keyword of the preset data level is traversed.
[0016] In an optional implementation manner, after determining the data format of the data to be updated, the method further includes:
[0017] If the data format of the data to be updated is in a non-table format and a non-function format, assigning values using the patch data in the function format of the data to be updated;
[0018] If the data form of the data to be updated is a function form, based on the function identifier corresponding to the data to be updated in the function form, the data to be updated corresponding to the function identifier is searched in the data packet to be updated, and the step of determining the data form of the data to be updated is returned.
[0019] In an optional implementation manner, after updating the target data to be updated to the target patch data corresponding to the keyword of the preset data level, the method further includes:
[0020] Based on each keyword included in the patch data packet, determining whether there are other keywords in the data packet to be updated except the keywords included in the patch data packet;
[0021] If so, the other keywords and the to-be-updated data corresponding to the other keywords are deleted from the to-be-updated data packet.
[0022] In an optional implementation, the obtaining of a patch data packet of the target application and determining the data packet to be updated indicated in the patch data packet includes:
[0023] Acquire each patch data packet of the target application from the local storage, and acquire each candidate data packet to be updated from the memory;
[0024] For each of the patch data packets, based on the identification information of the data packet to be updated carried in the patch data packet, searching for the data packet to be updated corresponding to the patch data packet from the candidate data packets to be updated;
[0025] The patch data packet and the data packet to be updated are loaded into a virtual machine used for updating an application program, so as to obtain the patch data packet carrying the data packet to be updated.
[0026] In an optional implementation, after obtaining the patch data packet of the target application and determining the data packet to be updated indicated in the patch data packet, the method further includes:
[0027] If the patch data packet does not have a data hierarchy relationship, the patch data packet is used to replace the to-be-updated data packet of the target application.
[0028] In a second aspect, an embodiment of the present disclosure further provides an application updating device, including:
[0029] An acquisition module, used for acquiring a patch data packet of a target application and determining a data packet to be updated indicated in the patch data packet; the patch data packet is used for updating the data packet to be updated;
[0030] A traversal module, used for traversing each keyword corresponding to each data level according to the data level relationship in the patch data packet, and continuing to traverse according to the patch data corresponding to each keyword until traversing to the keyword of the preset data level;
[0031] A first search module, used for searching the target data to be updated corresponding to the keyword of the preset data level from the data packet to be updated;
[0032] The updating module is used to update the target data to be updated to the target patch data corresponding to the keyword of the preset data level.
[0033] In a third aspect, an embodiment of the present disclosure further provides a computer device, comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the computer device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the above-mentioned first aspect, or any possible implementation of the first aspect are performed.
[0034] In a fourth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned first aspect or any possible implementation of the first aspect are executed.
[0035] In the application updating method provided by the embodiment of the present disclosure, after obtaining the patch data packet of the target application and determining the data packet to be updated indicated in the patch data packet, each keyword of each data layer in the patch data packet is traversed level by level, and finally the patch data corresponding to the keyword of the preset data layer (the preset data layer is generally the last data layer, that is, the data layer does not have a corresponding next data layer) is found, and then the target patch data corresponding to the keyword of the preset data layer is used to update the target data to be updated. In the above process, the target patch data and the target data to be updated for repair can be located, so that it can be known whether the problem in the target application is solved, avoiding the time-consuming situation caused by repackaging or rerunning to verify whether the problem has been solved.
[0036] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following is a brief introduction to the drawings required for use in the embodiments. The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used together with the specification to illustrate the technical solutions of the present disclosure. It should be understood that the following drawings only illustrate certain embodiments of the present disclosure and should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can also be obtained based on these drawings without creative work.
[0038] Figure 1 A flowchart of an application updating method provided by an embodiment of the present disclosure is shown;
[0039] Figure 2 A flowchart of another application updating method provided by an embodiment of the present disclosure is shown;
[0040] Figure 3 A flowchart of another application updating method provided by an embodiment of the present disclosure is shown;
[0041] Figure 4 A flowchart of another application updating method provided by an embodiment of the present disclosure is shown;
[0042] Figure 5 A schematic diagram of an application updating device provided by an embodiment of the present disclosure is shown;
[0043] Figure 6 A schematic diagram of a computer device provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical scheme and advantages of the embodiments of the present disclosure clearer, the technical scheme in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all of the embodiments. The components of the embodiments of the present disclosure generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure provided in the drawings is not intended to limit the scope of the present disclosure for protection, but merely represents the selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present disclosure.
[0045] When a bug occurs in the current application, the bug can be fixed using a patch file. For example, in game applications, Lua scripts are usually used to directly replace the old data in the application to fix the bug. This repair method usually results in developers not knowing whether the problem in the application has been solved. Therefore, after the bug is fixed, it is necessary to repackage or rerun the application to verify whether the problem in the application has been solved, and this process often requires a long wait and is very time-consuming.
[0046] Based on this, the present disclosure provides an application update method, including: obtaining a patch data packet of a target application and a data packet to be updated corresponding to the patch data packet; traversing the keywords corresponding to each data level according to the data hierarchy relationship in the patch data packet, and determining the patch data corresponding to each keyword, until traversing to the keyword of the preset data level of the last data level, searching for the target data to be updated corresponding to the keyword of the preset data level from the data packet to be updated; updating the target data to be updated to the target patch data corresponding to the keyword of the preset data level. After obtaining the patch data packet of the target application and determining the data packet to be updated indicated in the patch data packet, the embodiment of the present disclosure traverses each keyword of each data layer in the patch data packet level by level, and finally finds the patch data corresponding to the keyword of the preset data layer (the preset data layer is generally the last data layer, that is, the data layer does not have a corresponding next data layer), and then uses the target patch data corresponding to the keyword of the preset data layer to update the target data to be updated. In the above process, each target patch data for repair and the target data to be updated can be located, so that it can be known whether the problem in the target application is solved, avoiding the time-consuming situation caused by repackaging or rerunning to verify whether the problem has been solved.
[0047] The defects existing in the above schemes and the proposed solutions are the results obtained by the inventor after practice and careful research. Therefore, the discovery process of the above problems and the solutions proposed by the present disclosure for the above problems below should be the contributions made by the inventor to the present disclosure during the disclosure process.
[0048] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0049] To facilitate understanding of this embodiment, an application updating method disclosed in the embodiment of the present disclosure is first introduced in detail. The executor of the application updating method provided in the embodiment of the present disclosure is generally a computer device with certain computing capabilities.
[0050] The following describes the application updating method provided by the embodiment of the present disclosure by taking the execution subject as a server as an example.
[0051] See also Figure 1 FIG. 1 is a flowchart of an application updating method provided by an embodiment of the present disclosure, wherein the method includes S101 to S104, wherein:
[0052] S101: Acquire a patch data packet of a target application, and determine a data packet to be updated indicated in the patch data packet; the patch data packet is used to update the data packet to be updated.
[0053] In the disclosed embodiments, the target application may refer to an application in which a bug exists. A patch data packet may refer to a data packet written for a bug in the target application and used to fix the bug in the target application. When a bug exists in the target application, a patch data packet for fixing each bug may be obtained. The data packet to be updated may be an old code file corresponding to the bug in the target application. For ease of understanding, the patch data packet may also be understood as a new data packet, and the data packet to be updated may be understood as an old data packet.
[0054] In one embodiment, the written patch data packet can be directly loaded into a virtual machine for updating an application. After the data packet to be updated corresponding to the patch data packet in the memory corresponding to the target application is also loaded into the virtual machine, the virtual machine can complete the comparison and replacement of the patch data packet with the data packet to be updated, that is, complete the comparison and replacement of the new data packet with the old data packet. In another embodiment, the written patch data packet can also be stored in a local memory, such as a local hard disk. When the data packet to be updated in the target application meets the preset conditions (for example, the boundary value of some parameters in the data packet to be updated exceeds the set threshold, or the current time is the preset update time, etc.), each patch data packet of the target application is obtained from the local memory, and each candidate data packet to be updated is obtained from the memory corresponding to the target application. Among them, each candidate data packet to be updated can be a code file with a BUG. Each candidate data packet to be updated can be updated using the corresponding patch data packet. That is, if the candidate data packet 1 to be updated is a data packet with BUG1, then the corresponding patch data packet 1 is a data packet used to repair BUG1, that is, the candidate data packet 1 to be updated can be updated using the patch data packet 1. Then, for each patch data packet, the data packet to be updated corresponding to the patch data packet can be searched from each candidate data packet to be updated based on the identification information of the data packet to be updated carried in the patch data packet; then the patch data packet and the data packet to be updated are loaded into the virtual machine, and the virtual machine can store the data packet to be updated in the corresponding patch data packet, and obtain the patch data packet carrying the data packet to be updated, thereby realizing the reference to the data packet to be updated.
[0055] In the embodiment of the present disclosure, the patch data packet may have no data hierarchy relationship or may have a data hierarchy relationship, wherein the patch data of the previous data hierarchy in the data hierarchy relationship may include the patch data of the next data hierarchy.
[0056] In the case where the patch data package does not have a data hierarchy relationship, the patch data package can directly replace the to-be-updated data package of the target application program, thereby implementing an update of the target application program.
[0057] In the case where the patch data packet has a data hierarchy relationship, in one way, the patch data packet can be a data set in the form of a table written in a target data format, such as a JavaScript Object Notation (JSON) data exchange format. In a patch data packet in the form of a table, there can be at least two data levels. Each data level can contain a keyword (key) and patch data (value) corresponding to each keyword. That is, in a patch data packet with a data hierarchy relationship, the patch data corresponding to the keyword in the previous data level can still be data in the form of a table, and the patch data corresponding to the keyword in the previous data level can contain the keyword in the next data level and the patch data corresponding to each keyword in the table.
[0058] For patch data with a data hierarchy relationship, the target application program may be updated according to steps S102 to S104, which will be described in detail later.
[0059] S102: traversing each keyword corresponding to each data level according to the data level relationship in the patch data packet, and continuing to traverse according to the patch data corresponding to each keyword until traversing to the keyword of the preset data level.
[0060] S103: searching the to-be-updated data packets for target to-be-updated data corresponding to the keyword of the preset data level.
[0061] In the disclosed embodiment, for each keyword in each data level, when the patch data corresponding to the keyword still exists in the next data level, that is, when the patch data is in the form of a table, the patch data cannot be directly used to update the corresponding data to be updated. Therefore, it is necessary to traverse each keyword in the next data level of the patch data in the form of a table until the keyword of the preset data level is traversed.
[0062] Here, the preset data level may generally refer to the last data level, that is, the data level does not have a corresponding next data level.
[0063] Specifically, in one embodiment, in the process of traversing each keyword corresponding to each data level, patch data corresponding to each keyword can be determined for each data level based on each keyword corresponding to the data level, and the data format of the patch data can be determined. Then, according to the data format of the patch data, the traversal is continued until the keyword of the preset data level is traversed.
[0064] As mentioned above, for each keyword in each data layer, the patch data corresponding to the keyword may still be in table form. At this time, you can continue to traverse each keyword corresponding to the next data layer of the table-form patch data, and continue to traverse according to the patch data corresponding to each keyword of the next data layer until you traverse to the keyword of the preset data layer of the preset data layer.
[0065] Continuing from the above, in the process of traversing each keyword corresponding to each data level, for each keyword in each data level, the patch data corresponding to the keyword may also be in a non-table form.
[0066] Specifically, in one case, the non-table patch data corresponding to the keyword may be non-function data.
[0067] In the case where the non-table patch data corresponding to the keyword is non-function data, it means that the patch data of the keyword has no corresponding next data level, that is, the keyword is the keyword of the last data level, and the patch data of the keyword is the target patch data corresponding to the keyword of the preset data level. At this time, the target data to be updated corresponding to the keyword of the preset data level can be searched from the data packet to be updated according to the keyword of the preset data level. It should be noted here that the patch data corresponding to the same keyword can be the same as the data form of the data to be updated. Therefore, here, when the patch data corresponding to the keyword of the preset data level is non-function data, the target data to be updated corresponding to the keyword of the preset data level is also non-function data. Therefore, the step of updating the target data to be updated to the target patch data corresponding to the keyword of the preset data level in S104 can be directly executed. Among them, the target patch data can be patch data of types such as int numerical type, boolean Boolean type, string character string, etc.
[0068] In another case, the patch data corresponding to the keyword may be data in a function form. In the case where the patch data corresponding to the keyword is in a function form, based on the function identifier and keyword corresponding to the patch data in the function form, the data to be updated corresponding to the function identifier and the keyword may be searched in the data packet to be updated, and the data form of the data to be updated may be determined.
[0069] As mentioned above, the patch data corresponding to the same keyword and the data to be updated can be in the same data format. Therefore, when the patch data corresponding to the keyword is in the form of function data, the data to be updated corresponding to the keyword can also be in the form of function data. For ease of understanding, the patch data in the form of function can be understood as a new function, and the data to be updated in the form of function can be understood as an old function.
[0070] Here, the data to be updated corresponding to the function identifier and the keyword found out can be understood as the closure data under the old function corresponding to the keyword. The closure data here can be understood as the return value of the old function.
[0071] Among them, based on the keyword corresponding to the patch data in the form of the function, the old function corresponding to the keyword can be found in the data packet to be updated. Based on the function identifier corresponding to the new function (patch data in the form of the function), such as the function name, the closure data corresponding to the function identifier, that is, the return value of the old function, can be searched from the data packet to be updated. In one method, after finding the old function corresponding to the keyword, based on the function identifier corresponding to the old function, such as the function name, the closure data corresponding to the function identifier can be searched from the data packet to be updated.
[0072] Next, it is also necessary to determine whether the data format of the closure data corresponding to the function identifier and keyword of the new function (ie, patch data in function format) is in table format or non-table format.
[0073] If the closure data of the old function is in table form, the table form data to be updated is used to assign values to the patch data in function form, and the table form value corresponding to the patch data is obtained, and each keyword corresponding to each data level in the table form value is traversed, and the patch data corresponding to each keyword is determined. The process can be referred to in the previous text and will not be repeated here.
[0074] If the closure data of the old function is non-table closure data, it can be divided into two cases, namely, non-function closure data and function closure data.
[0075] For closure data in non-function form, the closure data in non-function form can be used to assign values to patch data in function form.
[0076] For closure data in function form, based on the function identifier corresponding to the data to be updated in the function form, the data to be updated corresponding to the function identifier can be searched in the data packet to be updated, and the step of determining the data form of the data to be updated can be returned.
[0077] S104: updating the target data to be updated to target patch data corresponding to the keyword of the preset data level.
[0078] After the target data to be updated is updated to the target patch data corresponding to the keyword of the preset data level, it is also possible to determine whether there are other keywords in the data packet to be updated except the keyword included in the patch data packet based on each keyword included in the patch data packet.
[0079] Here, other keywords except the keywords included in the patch data packet and the data to be updated corresponding to other keywords may also be the old code files of the BUG of the target application. Therefore, if there are other keywords except the keywords included in the patch data packet and the data to be updated corresponding to other keywords, they can be deleted from the data packet to be updated, thereby achieving the purpose of updating the data packet to be updated using the patch data packet.
[0080] The disclosed embodiment also provides an application updating method, which can be applied to a scenario where a Lua script is used to perform a hot update on a bug in a target game application.
[0081] Lua scripts written in C language are small scripts. Lua scripts can be easily called by C / C++ language codes, and can also call C / C++ language functions in reverse, which makes Lua an interpretive language for writing patch files to fix bugs in target game applications. Lua scripts are patch data packets used to fix bugs. The data in the patch data packets can be regarded as new data. The code files with bugs in the target game application are the data packets to be updated, and the data in the data packets to be updated can be regarded as old data.
[0082] like Figure 2 As shown, after the target game application is logged in, it can be determined whether the hot update conditions are met. Specifically, it can be determined whether the parameter boundary value in the data packet to be updated exceeds the set range, or whether the hot update time has been reached. If the hot update conditions are not met, no processing can be performed and the program can be directly exited. If the hot update conditions are met, an instruction to return the Lua script can be added to the Lua virtual machine. By executing the instruction, the Lua script can be returned from the local hard disk, that is, the new data is in the Lua virtual machine. In addition, the Lua virtual machine can also load the old data from the memory corresponding to the target game application and store it in the data packet package.loaded of the new data.
[0083] Next, the new data and the old data can be compared and replaced in the Lua virtual machine, and the function replacement table can be recorded.
[0084] Here, the new data and old data can be processed separately according to their types. Figure 3As shown, after the new data and the old data are compared and replaced, it can be determined whether the types of the new data and the old data are in table form or function form. It should be noted that the new data type and the old data type can be consistent, that is, when the new data type is data in table form, the old data type can also be data in table form; when the new data type is data in function form, the old data type can also be data in function form; when the new data type is data in non-function and non-table form, the old data type can also be data in non-function and non-table form.
[0085] Specifically, if the types of the new data and the old data are neither in table form nor in function form, such as int numeric type, boolean Boolean type, string string type, etc., the old data in package.loaded can be directly replaced with the new data.
[0086] If the new data and old data are in table format, such as Figure 3 and Figure 4 As shown, the update table interface, that is, the updateTable interface, can be called to compare the new and old data tables and update the data in the old data table. First, the value corresponding to each keyword key in the first data level of the new data table is traversed. For the value corresponding to any keyword, determine whether the type of the value is a function-based data.
[0087] If the value type is not a function data, it can be determined whether the value type is a table data. If the value type is not a table data, the value in the old data table corresponding to the keyword is directly replaced by the value. If the value type is a table data, the value corresponding to each keyword corresponding to the next data level of the value is traversed, and the above steps are repeated until all the values corresponding to the keywords in the new data table are traversed.
[0088] If the value type is data in function form, the old function can be updated with the new function in the form of function replacement. This process will be described in detail below.
[0089] After traversing all the values corresponding to the keywords in the new data table, you can also traverse each keyword in the old data table and determine other keywords that exist in the old data table but not in the new data table. Finally, delete the other keywords and the values corresponding to other keywords from the old data table.
[0090] In the present disclosure, Figure 4 As shown, the metatable of the new and old data tables can also be obtained. In the case where the metatable of the new and old data tables is also data in table form, the metatable of the new and old data can also be compared and replaced through the above process.
[0091] For the function replacement table recorded above, the process of replacing the old functions with the new functions will be performed next.
[0092] Here, if Figure 3 and Figure 4 As shown, the update function interface, i.e., updateFun interface, can be called to implement the process of recording the function replacement table and updating the function closure data. Here, the table format of the function replacement table can be recorded as: {[oldFunc]=newFunc,...}. Then, for any new function, the name of the old function corresponding to the new function can be used to find out whether the closure data of the old function exists.
[0093] If the closure data of the old function does not exist, then the next new function may be searched for the corresponding closure data.
[0094] In the case where closure data of the old function exists, it can be determined whether the type of the closure data is data in a function form.
[0095] If the type of the closure data is data in a function form, then for the closure data in the function form, the process of searching whether there is closure data of the old function according to the name of the old function corresponding to the new function is repeated.
[0096] If the type of the closure data is not a function data, the closure data is directly used to assign a value to the new function. And further determine whether the type of the closure data is a table data. If it is a table data, the above process is performed according to the situation that the types of the new data and the old data are in table data, and no further description is given here. If it is not a table data, the next new function can be traversed until the traversal is completed.
[0097] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.
[0098] Based on the same inventive concept, an application updating device corresponding to the application updating method is also provided in the embodiment of the present disclosure. Since the principle of solving the problem by the device in the embodiment of the present disclosure is similar to the above-mentioned application updating method in the embodiment of the present disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0099] Reference Figure 5 , which is a schematic diagram of the architecture of an application updating device provided by an embodiment of the present disclosure, the device comprises: an acquisition module 501, a traversal module 502, a first search module 503, and an update module 504; wherein,
[0100] The acquisition module 501 is used to acquire a patch data packet of a target application and determine a data packet to be updated indicated in the patch data packet; the patch data packet is used to update the data packet to be updated;
[0101] A traversal module 502, configured to traverse each keyword corresponding to each data level according to the data level relationship in the patch data packet, and continue traversing according to the patch data corresponding to each keyword until the keyword of the preset data level is traversed;
[0102] A first search module 503, configured to search the target data to be updated corresponding to the keyword of the preset data level from the data packet to be updated;
[0103] The updating module 504 is configured to update the target data to be updated to target patch data corresponding to the keyword of the preset data level.
[0104] In an optional implementation, the traversal module 502 is specifically configured to:
[0105] For each data level, based on each keyword corresponding to the data level, determine the patch data corresponding to each keyword, and determine the data format of the patch data;
[0106] If the data format of the patch data is in table format, continue to traverse each keyword corresponding to the next data level of the patch data in table format, and continue to traverse according to the patch data corresponding to each keyword of the next data level until traversing to the keyword of the preset data level.
[0107] In an optional embodiment, the device further comprises:
[0108] A second search module is used for searching the to-be-updated data corresponding to the function identifier and the keyword in the to-be-updated data packet based on the function identifier and the keyword corresponding to the patch data in the function form if the data form of the patch data is in the function form, and determining the data form of the to-be-updated data;
[0109] The first assignment module is used to assign the patch data in function form using the data to be updated in table form, when the data form of the data to be updated is in table form, to obtain the table form value corresponding to the patch data, and continue to traverse the keywords corresponding to each data level in the table form value, and continue to traverse according to the patch data corresponding to each of the keywords until the keyword of the preset data level is traversed.
[0110] In an optional embodiment, the device further comprises:
[0111] A second assignment module is used for, if the data form of the data to be updated is in a non-table form and a non-function form, to assign values by using the patch data in the function form of the data to be updated;
[0112] The third search module is used to search for the data to be updated corresponding to the function identifier in the data packet to be updated based on the function identifier corresponding to the data to be updated in the function form, if the data form of the data to be updated is in the function form, and return to the step of determining the data form of the data to be updated.
[0113] In an optional embodiment, the device further comprises:
[0114] A judging module, configured to judge, based on each keyword included in the patch data packet, whether the data packet to be updated contains other keywords other than the keywords included in the patch data packet;
[0115] The deleting module is used to delete the other keywords and the to-be-updated data corresponding to the other keywords from the to-be-updated data packet if they exist.
[0116] In an optional implementation manner, the acquisition module 501 is specifically configured to:
[0117] Acquire each patch data packet of the target application from the local storage, and acquire each candidate data packet to be updated from the memory;
[0118] For each of the patch data packets, based on the identification information of the data packet to be updated carried in the patch data packet, searching for the data packet to be updated corresponding to the patch data packet from the candidate data packets to be updated;
[0119] The patch data packet and the data packet to be updated are loaded into a virtual machine used for updating an application program, so as to obtain the patch data packet carrying the data packet to be updated.
[0120] In an optional embodiment, the device further comprises:
[0121] A replacement module is used to replace the to-be-updated data packet of the target application with the patch data packet if the patch data packet does not have a data hierarchy relationship.
[0122] For descriptions of the processing flow of each module in the device and the interaction flow between each module, reference may be made to the relevant descriptions in the above method embodiment, which will not be described in detail here.
[0123] Based on the same technical concept, the embodiment of the present disclosure also provides a computer device. Figure 6 As shown, it is a schematic diagram of the structure of a computer device 600 provided in an embodiment of the present disclosure, including a processor 601, a memory 602, and a bus 603. Among them, the memory 602 is used to store execution instructions, including a memory 6021 and an external memory 6022; the memory 6021 here is also called an internal memory, which is used to temporarily store the operation data in the processor 601, and the data exchanged with the external memory 6022 such as a hard disk. The processor 601 exchanges data with the external memory 6022 through the memory 6021. When the computer device 600 is running, the processor 601 communicates with the memory 602 through the bus 603, so that the processor 601 executes the following instructions:
[0124] Acquire a patch data packet of a target application, and determine a data packet to be updated indicated in the patch data packet; the patch data packet is used to update the data packet to be updated;
[0125] According to the data hierarchy relationship in the patch data packet, traverse each keyword corresponding to each data hierarchy, and continue traversing according to the patch data corresponding to each keyword until the keyword of the preset data hierarchy is traversed;
[0126] Searching for target data to be updated corresponding to the keyword of the preset data level from the data packet to be updated;
[0127] The target data to be updated is updated to target patch data corresponding to the keyword of the preset data level.
[0128] The present disclosure also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the application program update method described in the above method embodiment are executed. The storage medium can be a volatile or non-volatile computer-readable storage medium.
[0129] The embodiment of the present disclosure further provides a computer program product, which carries a program code. The program code includes instructions that can be used to execute the steps of the X application program update method described in the above method embodiment. For details, please refer to the above method embodiment, which will not be repeated here.
[0130] The computer program product may be implemented in hardware, software or a combination thereof. In one optional embodiment, the computer program product is implemented as a computer storage medium. In another optional embodiment, the computer program product is implemented as a software product, such as a software development kit (SDK).
[0131] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. In the several embodiments provided in the present disclosure, it should be understood that the disclosed device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the device or unit can be electrical, mechanical or other forms.
[0132] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0133] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0134] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0135] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed in the present disclosure, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure shall be based on the protection scope of the claims.
Claims
1. A method for updating an application, characterized in that: include: Obtaining a patch data packet of a target application, and determining a data packet to be updated indicated in the patch data packet; The patch data packet is used to update the data packet to be updated; According to the data hierarchy relationship in the patch data packet, traverse each keyword corresponding to each data hierarchy, and continue traversing according to the patch data corresponding to each keyword until the keyword of the preset data hierarchy is traversed; Searching for target data to be updated corresponding to the keyword of the preset data level from the data packet to be updated; Updating the target data to be updated to target patch data corresponding to the keyword of the preset data level; Each of the data levels includes the keywords and patch data corresponding to each of the keywords, and the preset data level includes a data level that does not have a corresponding next-level data level.
2. The method according to claim 1, characterized in that The traversing each keyword corresponding to each data level, and continuing the traversal according to the patch data corresponding to each keyword until the keyword of the preset data level is traversed, includes: For each data level, based on each keyword corresponding to the data level, determine the patch data corresponding to each keyword, and determine the data format of the patch data; If the data format of the patch data is in table format, continue to traverse each keyword corresponding to the next data level of the patch data in table format, and continue to traverse according to the patch data corresponding to each keyword of the next data level until traversing to the keyword of the preset data level.
3. The method according to claim 2, characterized in that After determining the data format of the patch data, the method further includes: If the data form of the patch data is in function form, based on the function identifier and the keyword corresponding to the patch data in function form, searching for the data to be updated corresponding to the function identifier and the keyword in the data packet to be updated, and determining the data form of the data to be updated; In the case where the data to be updated is in table form, the data to be updated in table form is used to assign values to the patch data in function form to obtain the table value corresponding to the patch data, and then continue to traverse each keyword corresponding to each data level in the table value, and continue to traverse according to the patch data corresponding to each keyword until the keyword of the preset data level is traversed.
4. The method according to claim 3, characterized in that After determining the data format of the data to be updated, the method further includes: If the data format of the data to be updated is in a non-table format and a non-function format, assigning values using patch data in which the data to be updated is in the function format; If the data form of the data to be updated is a function form, based on the function identifier corresponding to the data to be updated in the function form, the data to be updated corresponding to the function identifier is searched in the data packet to be updated, and the step of determining the data form of the data to be updated is returned.
5. The method according to claim 1, characterized in that After the target data to be updated is updated to the target patch data corresponding to the keyword of the preset data level, the method further includes: Based on each keyword included in the patch data packet, determining whether there are other keywords in the data packet to be updated except the keywords included in the patch data packet; If so, the other keywords and the to-be-updated data corresponding to the other keywords are deleted from the to-be-updated data packet.
6. The method according to claim 1, characterized in that The step of obtaining a patch data packet of the target application and determining the data packet to be updated indicated in the patch data packet includes: Acquire each patch data packet of the target application from the local storage, and acquire each candidate data packet to be updated from the memory; For each of the patch data packets, based on the identification information of the data packet to be updated carried in the patch data packet, searching for the data packet to be updated corresponding to the patch data packet from the candidate data packets to be updated; The patch data packet and the data packet to be updated are loaded into a virtual machine used for updating an application program, so as to obtain the patch data packet carrying the data packet to be updated.
7. An application updating device, characterized in that: include: An acquisition module, used to acquire a patch data packet of a target application and determine a data packet to be updated indicated in the patch data packet; The patch data packet is used to update the data packet to be updated; A traversal module, used for traversing each keyword corresponding to each data level according to the data level relationship in the patch data packet, and continuing to traverse according to the patch data corresponding to each keyword until traversing to the keyword of the preset data level; A first search module, used for searching the target data to be updated corresponding to the keyword of the preset data level from the data packet to be updated; An updating module, used for updating the target data to be updated to target patch data corresponding to the keyword of the preset data level; Each of the data levels includes the keywords and patch data corresponding to each of the keywords, and the preset data level includes a data level that does not have a corresponding next-level data level.
8. A computer device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the computer device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the application updating method as described in any one of claims 1 to 6 are performed.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, executes the steps of the application updating method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Application upgrading method and device
CN111078264A
Function-level hot patching method and device, intelligent terminal and storage medium
CN111506338A