Application program updating method, device, equipment and storage medium

By generating dependency trees and checksums, the application update process is optimized, solving the problem of excessively long update times caused by the increase in RN package size, and achieving efficient application updates.

CN114035827BActive Publication Date: 2024-11-12CHINA PING AN LIFE INSURANCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111437024.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-30
Publication Date
2024-11-12
Estimated Expiration
2041-11-30

AI Technical Summary

Technical Problem

In existing technologies, when applications are updated, the increased size of the RN package leads to excessively long update times, and the differential package cannot run independently, making it impossible to optimize the update loading rate.

Method used

By generating a dependency tree, performing dependency analysis, generating a reference cache table and checksum, building a version description file, dynamically updating the application, and optimizing the update process.

Benefits of technology

It improves the efficiency of application updates, avoids duplicate updates, reduces update time, and enhances the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114035827B_ABST
    Figure CN114035827B_ABST
Patent Text Reader

Abstract

The present invention relates to artificial intelligence, and provides an application updating method, device, equipment and storage medium. The method can obtain multiple business function packages of an application to be updated and the dependency relationship of the multiple business function packages, generate a dependency tree according to the function names and dependency relationships of the multiple business function packages, perform dependency analysis on the dependency tree based on the multiple business function packages, obtain a reference cache table, generate verification codes of the multiple business function packages according to the file information of the multiple business function packages, generate a version description file according to the reference cache table and the verification code, obtain the target history description file of the application to be updated, compare the version description file with the target history description file, obtain the target function, and dynamically update the application to be updated according to the update status of the target function, which can improve the update efficiency. In addition, the present invention also relates to blockchain technology, and the update status can be stored in the blockchain.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to an application updating method, device, equipment and storage medium. Background Art

[0002] At present, when an application is updated and loaded, the entire RN package (React-Native) of the application usually needs to be updated and downloaded. However, with the development of business, the size of the RN package increases, resulting in longer update and loading time of the application, which is not conducive to user experience.

[0003] With the development of the Internet, the method of using differential packages to update and load applications has also emerged. However, since differential packages cannot be run independently as physical unpacking, the update loading rate cannot be optimized. Summary of the invention

[0004] In view of the above, it is necessary to provide an application updating method, apparatus, device and storage medium, which can improve the application updating rate.

[0005] In one aspect, the present invention provides an application updating method, the application updating method comprising:

[0006] Acquire multiple business function packages of the application to be updated and dependencies of the multiple business function packages;

[0007] Generate a dependency tree according to the function names of the multiple business function packages and the dependency relationships;

[0008] Perform dependency analysis on the dependency tree based on the multiple business function packages to obtain a reference cache table;

[0009] Generating verification codes of the multiple business function packages according to the file information of the multiple business function packages;

[0010] Generate a version description file according to the reference cache table and the verification code;

[0011] Obtaining a target history description file of the application to be updated;

[0012] Comparing the version description file with the target history description file to obtain the target function;

[0013] The application to be updated is dynamically updated according to the update status of the target function.

[0014] According to a preferred embodiment of the present invention, generating a dependency tree according to the function names of the plurality of business function packages and the dependency relationships comprises:

[0015] Determine the plurality of function names as a plurality of dependent nodes;

[0016] Counting the number of node dependencies of each dependent node according to the dependency relationship;

[0017] Iteratively screening root nodes and leaf nodes from the multiple dependent nodes according to the node dependency quantity and the dependency relationship until the dependency relationship is processed, including: determining the dependent node with the largest node dependency quantity as the root node; selecting candidate nodes of the root node from the multiple dependent nodes according to the dependency relationship; screening the node with the largest node dependency quantity from the candidate nodes as the leaf node of the root node, and determining the leaf node as the root node of the next round of iterative processing;

[0018] The dependency tree is constructed based on the root node and the leaf nodes.

[0019] According to a preferred embodiment of the present invention, performing dependency analysis on the dependency tree based on the multiple business function packages to obtain a reference cache table includes:

[0020] Performing a breadth-first traversal on the dependency tree to obtain traversal nodes and connection nodes of the traversal nodes;

[0021] Extracting a node function package corresponding to the traversal node from the multiple business function packages;

[0022] Performing a depth-first traversal on the node function package based on the connection node to obtain a target method name corresponding to the connection node in the node function package;

[0023] Obtaining a file path of the node function package, and generating a hash value of the node function package according to the function name and the file path;

[0024] The reference cache table is generated by using the hash value as a data key and the target method name as a data value.

[0025] According to a preferred embodiment of the present invention, the reference cache table includes the hash value and the target method name, and generating a version description file according to the reference cache table and the check code includes:

[0026] Extracting information corresponding to the target method name from the verification code as reference information of the multiple business function packages;

[0027] Combining the hash value and the reference information to obtain version information of the multiple business function packages;

[0028] The version information is concatenated according to the arrangement order of the traversal nodes corresponding to the hash values ​​in the dependency tree to obtain the version description file.

[0029] According to a preferred embodiment of the present invention, the target history description file includes function ciphertexts and call information of multiple historical version functions, and the comparison of the version description file with the target history description file to obtain the target function includes:

[0030] comparing the hash value with the functional ciphertext;

[0031] If the hash value is the same as the function ciphertext, comparing the reference information corresponding to the hash value with the call information corresponding to the function ciphertext;

[0032] Determine the traversal node where the reference information and the call information are different as the target function; or

[0033] If the hash value is different from the function ciphertext, the traversal node corresponding to the hash value is determined as the target function.

[0034] According to a preferred embodiment of the present invention, generating verification codes of the multiple business function packages according to the file information of the multiple business function packages includes:

[0035] Eliminate information corresponding to a preset label from the file information to obtain function information, wherein the preset label is used to indicate an operating user;

[0036] Extracting timestamp information of the plurality of service function packages from the function information;

[0037] Replacing the timestamp information based on a preset timestamp to obtain target information corresponding to the function information;

[0038] The target information is processed according to a preset rule algorithm to obtain the verification code.

[0039] According to a preferred embodiment of the present invention, dynamically updating the application to be updated according to the update status of the target function includes:

[0040] Parse the hash value of the target function based on the path label to obtain the function package path of the target function;

[0041] Extracting the function package information of the target function from the function package path;

[0042] Determining an update terminal for the application to be updated, and obtaining an update description file from the update terminal;

[0043] Detecting whether the update description file contains the function package information, and obtaining the update status;

[0044] If the update status is that the update description file includes the function package information, updating the application to be updated based on the function package information; or

[0045] If the update status is that the update description file does not include the function package information, it is determined that the update terminal completes the update of the application to be updated.

[0046] On the other hand, the present invention further provides an application updating device, the application updating device comprising:

[0047] An acquisition unit, configured to acquire a plurality of business function packages of an application to be updated and dependencies between the plurality of business function packages;

[0048] A generating unit, configured to generate a dependency tree according to the function names of the plurality of business function packages and the dependency relationships;

[0049] An analysis unit, configured to perform dependency analysis on the dependency tree based on the multiple business function packages to obtain a reference cache table;

[0050] The generating unit is further configured to generate verification codes of the multiple business function packages according to the file information of the multiple business function packages;

[0051] The generating unit is further used to generate a version description file according to the reference cache table and the verification code;

[0052] The acquisition unit is further used to acquire a target history description file of the application to be updated;

[0053] A comparison unit, used for comparing the version description file with the target history description file to obtain a target function;

[0054] An updating unit is used to dynamically update the application to be updated according to the update status of the target function.

[0055] On the other hand, the present invention further provides an electronic device, comprising:

[0056] a memory storing computer readable instructions; and

[0057] The processor executes the computer-readable instructions stored in the memory to implement the application updating method.

[0058] On the other hand, the present invention further proposes a computer-readable storage medium, in which computer-readable instructions are stored. The computer-readable instructions are executed by a processor in an electronic device to implement the application updating method.

[0059] It can be seen from the above technical solutions that the present invention, by generating the dependency tree, can assist in the rapid generation of the reference cache table because it can convert unordered dependencies into an ordered dependency tree. The verification code generated by the present invention can ensure that different verification codes are generated for function packages with exactly the same content due to different timestamps and operating users, thereby improving the accuracy of the version description file. Further, by comparing the generated version description file with the target history description file, it is possible to accurately determine the target function that needs to be updated without the need to update the multiple business function packages as a whole, thereby improving the update efficiency of the application to be updated. By detecting the update status of the target function, the application to be updated is updated according to the update status. Since the update status can further accurately determine whether the target function needs to be updated, repeated updates of the target function can be avoided, thereby further improving the update efficiency of the application to be updated. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] Figure 1 It is a flow chart of a preferred embodiment of the application updating method of the present invention.

[0061] Figure 2 It is a functional module diagram of a preferred embodiment of the application updating device of the present invention.

[0062] Figure 3 It is a structural schematic diagram of an electronic device of a preferred embodiment of the present invention for implementing the application program updating method. DETAILED DESCRIPTION

[0063] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention is described in detail below with reference to the accompanying drawings and specific embodiments.

[0064] like Figure 1 FIG. 1 is a flow chart of a preferred embodiment of the application updating method of the present invention. According to different requirements, the order of the steps in the flow chart can be changed, and some steps can be omitted.

[0065] The application updating method can acquire and process relevant data based on artificial intelligence technology. Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0066] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0067] The application updating method is applied to one or more electronic devices, wherein the electronic device is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored computer-readable instructions, and its hardware includes but is not limited to a microprocessor, an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA), a digital signal processor (DSP), an embedded device, etc.

[0068] The electronic device may be any electronic product that can perform human-computer interaction with a user, such as a personal computer, a tablet computer, a smart phone, a personal digital assistant (PDA), a game console, an interactive network television (IPTV), a smart wearable device, etc.

[0069] The electronic device may include a network device and / or a user device. The network device includes, but is not limited to, a single network electronic device, an electronic device group consisting of multiple network electronic devices, or a cloud consisting of a large number of hosts or network electronic devices based on cloud computing.

[0070] The network where the electronic device is located includes, but is not limited to: the Internet, a wide area network, a metropolitan area network, a local area network, a virtual private network (VPN), etc.

[0071] S10, obtaining multiple business function packages of the application to be updated and dependency relationships among the multiple business function packages.

[0072] In at least one embodiment of the present invention, the application to be updated may include any APP and web page. The application to be updated usually includes multiple versions of the application.

[0073] The multiple business function packages refer to code package information corresponding to all business nodes in the application program to be updated.

[0074] The dependency relationship refers to the relationship between any two service nodes.

[0075] In at least one embodiment of the present invention, the electronic device acquiring multiple service function packages of the application to be updated and the dependency relationship of the multiple service function packages includes:

[0076] Obtaining configuration information of the application to be updated;

[0077] Extracting a service node from the configuration information according to the first configuration tag, and acquiring the multiple service function packages based on the service node;

[0078] The dependency relationship is extracted from the configuration information according to the second configuration tag.

[0079] The configuration information may be initial information set in advance by a user. The configuration information may store a plurality of pre-set nodes and relationships.

[0080] The first configuration tag is used to indicate a node, and the second configuration tag is used to indicate a relationship.

[0081] S11, generating a dependency tree according to the function names of the multiple business function packages and the dependency relationships.

[0082] In at least one embodiment of the present invention, the dependency tree includes a plurality of dependency nodes and the dependency relationships. The dependency tree has a tree structure.

[0083] In at least one embodiment of the present invention, the electronic device generating a dependency tree according to the function names of the plurality of business function packages and the dependency relationships comprises:

[0084] Determine the plurality of function names as a plurality of dependent nodes;

[0085] Counting the number of node dependencies of each dependent node according to the dependency relationship;

[0086] Iteratively screening root nodes and leaf nodes from the multiple dependent nodes according to the node dependency quantity and the dependency relationship until the dependency relationship is processed, including: determining the dependent node with the largest node dependency quantity as the root node; selecting candidate nodes of the root node from the multiple dependent nodes according to the dependency relationship; screening the node with the largest node dependency quantity from the candidate nodes as the leaf node of the root node, and determining the leaf node as the root node of the next round of iterative processing;

[0087] The dependency tree is constructed based on the root node and the leaf nodes.

[0088] The candidate node refers to a dependent node having a dependency relationship with the root node.

[0089] The root node and the leaf node can be quickly screened out from the multiple dependent nodes through the number of node dependencies and the dependency relationship, thereby improving the construction efficiency of the dependency tree. At the same time, by using the dependency relationship as the stopping condition for iterative processing, the comprehensiveness of the construction of the dependency tree can be improved.

[0090] S12: Perform dependency analysis on the dependency tree based on the multiple business function packages to obtain a reference cache table.

[0091] In at least one embodiment of the present invention, the reference cache table stores a mapping relationship between a hash value of a traversal node and a target method name, wherein the traversal node refers to any dependent node in the dependency tree, and the hash value refers to information encrypted and generated based on the function name of the traversal node and the file path.

[0092] In at least one embodiment of the present invention, the electronic device performs dependency analysis on the dependency tree based on the multiple business function packages to obtain a reference cache table including:

[0093] Performing a breadth-first traversal on the dependency tree to obtain traversal nodes and connection nodes of the traversal nodes;

[0094] Extracting a node function package corresponding to the traversal node from the multiple business function packages;

[0095] Performing a depth-first traversal on the node function package based on the connection node to obtain a target method name corresponding to the connection node in the node function package;

[0096] Obtaining a file path of the node function package, and generating a hash value of the node function package according to the function name and the file path;

[0097] The reference cache table is generated by using the hash value as a data key and the target method name as a data value.

[0098] The connection node refers to a node in the dependency tree that is connected to the traversal node.

[0099] The target method name refers to the specific method in the node function package that references the connection node.

[0100] By performing a breadth-first traversal on the dependency tree, the traversal nodes and the connection nodes can be quickly acquired, and further, by performing a depth-first traversal on the node function package, it is possible to avoid that all information in the node function package is retained and storage space is occupied. By generating the hash value, it is possible to avoid that duplicate business function packages are stored in the reference cache table.

[0101] S13: Generate verification codes of the multiple business function packages according to the file information of the multiple business function packages.

[0102] In at least one embodiment of the present invention, the file information includes information related to the multiple service function packages. For example, the file information includes the time when the multiple service function packages are generated.

[0103] The verification code refers to information generated based on the fixed constant time point information and the content information of each business function package. It can be understood that if the content information of the business function package is different, the verification code corresponding to the business function package is different. On the contrary, if the content information of the business function package is the same, the verification code corresponding to the business function package is the same.

[0104] In at least one embodiment of the present invention, the electronic device generating verification codes of the multiple service function packages according to the file information of the multiple service function packages includes:

[0105] Eliminate information corresponding to a preset label from the file information to obtain function information, wherein the preset label is used to indicate an operating user;

[0106] Extracting timestamp information of the plurality of service function packages from the function information;

[0107] Replacing the timestamp information based on a preset timestamp to obtain target information corresponding to the function information;

[0108] The target information is processed according to a preset rule algorithm to obtain the verification code.

[0109] The function information refers to file information that does not contain relevant information of the operating user.

[0110] The preset timestamp may be any fixed constant time point information.

[0111] The preset rule algorithm may be any algorithm whose dependent variable varies with the independent variable.

[0112] The preset tag can accurately remove information related to the operating user from the file information, and then replace the timestamp information based on a fixed preset timestamp, thereby avoiding different verification codes generated due to different operating users and timestamp information, thereby avoiding the generation of different verification codes for business function packages with exactly the same content.

[0113] S14, generating a version description file according to the reference cache table and the verification code.

[0114] In at least one embodiment of the present invention, the version description file refers to description information corresponding to the multiple business function packages.

[0115] In at least one embodiment of the present invention, the reference cache table includes the hash value and the target method name, and the electronic device generates a version description file according to the reference cache table and the verification code, including:

[0116] Extracting information corresponding to the target method name from the verification code as reference information of the multiple business function packages;

[0117] Combining the hash value and the reference information to obtain version information of the multiple business function packages;

[0118] The version information is concatenated according to the arrangement order of the traversal nodes corresponding to the hash values ​​in the dependency tree to obtain the version description file.

[0119] The reference information refers to the verification code corresponding to the target method name.

[0120] The version information includes the hash value and reference information of each service function package.

[0121] By generating the version information through the hash value and the reference information, the character count of the version information can be reduced, thereby reducing the character count of the version description file. Furthermore, by traversing the order of arrangement of the nodes in the dependency tree, an ordered version description file can be generated, which can facilitate subsequent comparisons.

[0122] S15, obtaining a target history description file of the application to be updated.

[0123] In at least one embodiment of the present invention, the target history description file refers to a history description file that is closest to the release time of the multiple business function packages.

[0124] In at least one embodiment of the present invention, the electronic device filters out the target history description file from the history description files according to the release time of the multiple service function packages.

[0125] S16, comparing the version description file with the target history description file to obtain the target function.

[0126] In at least one embodiment of the present invention, the target function refers to a business function newly added by the application to be updated.

[0127] In at least one embodiment of the present invention, the target history description file includes function ciphertexts and call information of multiple historical version functions, and the electronic device compares the version description file with the target history description file to obtain the target function including:

[0128] comparing the hash value with the functional ciphertext;

[0129] If the hash value is the same as the function ciphertext, comparing the reference information corresponding to the hash value with the call information corresponding to the function ciphertext;

[0130] Determine the traversal node where the reference information and the call information are different as the target function; or

[0131] If the hash value is different from the function ciphertext, the traversal node corresponding to the hash value is determined as the target function.

[0132] By comparing the hash value with the functional ciphertext, the target function can be quickly determined under the premise that the hash value and the functional ciphertext are different. At the same time, when the hash value and the functional ciphertext are the same, the reference information and the call information can be further compared, so that the target function can be accurately determined.

[0133] S17: Dynamically update the application to be updated according to the update status of the target function.

[0134] In at least one embodiment of the present invention, the update status refers to whether the target function has completed updating in the update terminal.

[0135] It should be emphasized that in order to further ensure the privacy and security of the above-mentioned updated status, the above-mentioned updated status can also be stored in a node of a blockchain.

[0136] In at least one embodiment of the present invention, the electronic device dynamically updating the application to be updated according to the update status of the target function includes:

[0137] Parse the hash value of the target function based on the path label to obtain the function package path of the target function;

[0138] Extracting the function package information of the target function from the function package path;

[0139] Determining an update terminal for the application to be updated, and obtaining an update description file from the update terminal;

[0140] Detecting whether the update description file contains the function package information, and obtaining the update status;

[0141] If the update status is that the update description file includes the function package information, updating the application to be updated based on the function package information; or

[0142] If the update status is that the update description file does not include the function package information, it is determined that the update terminal completes the update of the application to be updated.

[0143] The path label is used to indicate the storage path of the function package.

[0144] The update terminal refers to the terminal device where the historical version of the application to be updated is located.

[0145] The update description file stores relevant function information of multiple updated functions.

[0146] By parsing the hash value through the path label, the function package path can be quickly obtained, and then the function package information can be obtained based on the function package path. Since there is no need to traverse the function package information in numerous paths, the efficiency of obtaining the function package information can be improved. Furthermore, by detecting whether the function package information is included in the update description file, on-demand update of the application to be updated can be achieved, thereby improving the update efficiency of the application to be updated.

[0147] It can be seen from the above technical solutions that the present invention, by generating the dependency tree, can assist in the rapid generation of the reference cache table because it can convert unordered dependencies into an ordered dependency tree. The verification code generated by the present invention can ensure that different verification codes are generated for function packages with exactly the same content due to different timestamps and operating users, thereby improving the accuracy of the version description file. Further, by comparing the generated version description file with the target history description file, it is possible to accurately determine the target function that needs to be updated without the need to update the multiple business function packages as a whole, thereby improving the update efficiency of the application to be updated. By detecting the update status of the target function, the application to be updated is updated according to the update status. Since the update status can further accurately determine whether the target function needs to be updated, repeated updates of the target function can be avoided, thereby further improving the update efficiency of the application to be updated.

[0148] like Figure 2, which is a functional module diagram of a preferred embodiment of the application updating device of the present invention. The application updating device 11 includes an acquisition unit 110, a generation unit 111, an analysis unit 112, a comparison unit 113 and an update unit 114. The module / unit referred to in the present invention refers to a series of computer-readable instruction segments that can be acquired by the processor 13 and can perform fixed functions, which are stored in the memory 12. In this embodiment, the functions of each module / unit will be described in detail in subsequent embodiments.

[0149] The acquisition unit 110 acquires a plurality of business function packages of the application to be updated and dependencies between the plurality of business function packages.

[0150] In at least one embodiment of the present invention, the application to be updated may include any APP and web page. The application to be updated usually includes multiple versions of the application.

[0151] The multiple business function packages refer to code package information corresponding to all business nodes in the application program to be updated.

[0152] The dependency relationship refers to the relationship between any two service nodes.

[0153] In at least one embodiment of the present invention, the acquiring unit 110 acquires multiple business function packages of the application to be updated and the dependency relationship of the multiple business function packages, including:

[0154] Obtaining configuration information of the application to be updated;

[0155] Extracting a service node from the configuration information according to the first configuration tag, and acquiring the multiple service function packages based on the service node;

[0156] The dependency relationship is extracted from the configuration information according to the second configuration tag.

[0157] The configuration information may be initial information set in advance by a user. The configuration information may store a plurality of pre-set nodes and relationships.

[0158] The first configuration tag is used to indicate a node, and the second configuration tag is used to indicate a relationship.

[0159] The generating unit 111 generates a dependency tree according to the function names of the plurality of business function packages and the dependency relationships.

[0160] In at least one embodiment of the present invention, the dependency tree includes a plurality of dependency nodes and the dependency relationships. The dependency tree has a tree structure.

[0161] In at least one embodiment of the present invention, the generating unit 111 generates a dependency tree according to the function names of the multiple business function packages and the dependency relationships, including:

[0162] Determine the plurality of function names as a plurality of dependent nodes;

[0163] Counting the number of node dependencies of each dependent node according to the dependency relationship;

[0164] Iteratively screening root nodes and leaf nodes from the multiple dependent nodes according to the node dependency quantity and the dependency relationship until the dependency relationship is processed, including: determining the dependent node with the largest node dependency quantity as the root node; selecting candidate nodes of the root node from the multiple dependent nodes according to the dependency relationship; screening the node with the largest node dependency quantity from the candidate nodes as the leaf node of the root node, and determining the leaf node as the root node of the next round of iterative processing;

[0165] The dependency tree is constructed based on the root node and the leaf nodes.

[0166] The candidate node refers to a dependent node having a dependency relationship with the root node.

[0167] The root node and the leaf node can be quickly screened out from the multiple dependent nodes through the number of node dependencies and the dependency relationship, thereby improving the construction efficiency of the dependency tree. At the same time, by using the dependency relationship as the stopping condition for iterative processing, the comprehensiveness of the construction of the dependency tree can be improved.

[0168] The analyzing unit 112 performs dependency analysis on the dependency tree based on the multiple business function packages to obtain a reference cache table.

[0169] In at least one embodiment of the present invention, the reference cache table stores a mapping relationship between a hash value of a traversal node and a target method name, wherein the traversal node refers to any dependent node in the dependency tree, and the hash value refers to information encrypted and generated based on the function name of the traversal node and the file path.

[0170] In at least one embodiment of the present invention, the analyzing unit 112 performs dependency analysis on the dependency tree based on the multiple business function packages, and obtains a reference cache table including:

[0171] Performing a breadth-first traversal on the dependency tree to obtain traversal nodes and connection nodes of the traversal nodes;

[0172] Extracting a node function package corresponding to the traversal node from the multiple business function packages;

[0173] Performing a depth-first traversal on the node function package based on the connection node to obtain a target method name corresponding to the connection node in the node function package;

[0174] Obtaining a file path of the node function package, and generating a hash value of the node function package according to the function name and the file path;

[0175] The reference cache table is generated by using the hash value as a data key and the target method name as a data value.

[0176] The connection node refers to a node in the dependency tree that is connected to the traversal node.

[0177] The target method name refers to the specific method in the node function package that references the connection node.

[0178] By performing a breadth-first traversal on the dependency tree, the traversal nodes and the connection nodes can be quickly acquired, and further, by performing a depth-first traversal on the node function package, it is possible to avoid that all information in the node function package is retained and storage space is occupied. By generating the hash value, it is possible to avoid that duplicate business function packages are stored in the reference cache table.

[0179] The generating unit 111 generates verification codes of the multiple service function packages according to the file information of the multiple service function packages.

[0180] In at least one embodiment of the present invention, the file information includes information related to the multiple service function packages. For example, the file information includes the time when the multiple service function packages are generated.

[0181] The verification code refers to information generated based on the fixed constant time point information and the content information of each business function package. It can be understood that if the content information of the business function package is different, the verification code corresponding to the business function package is different. On the contrary, if the content information of the business function package is the same, the verification code corresponding to the business function package is the same.

[0182] In at least one embodiment of the present invention, the generating unit 111 generates the verification codes of the multiple business function packages according to the file information of the multiple business function packages, including:

[0183] Eliminate information corresponding to a preset label from the file information to obtain function information, wherein the preset label is used to indicate an operating user;

[0184] Extracting timestamp information of the plurality of service function packages from the function information;

[0185] Replacing the timestamp information based on a preset timestamp to obtain target information corresponding to the function information;

[0186] The target information is processed according to a preset rule algorithm to obtain the verification code.

[0187] The function information refers to file information that does not contain relevant information of the operating user.

[0188] The preset timestamp may be any fixed constant time point information.

[0189] The preset rule algorithm may be any algorithm whose dependent variable varies with the independent variable.

[0190] The preset tag can accurately remove information related to the operating user from the file information, and then replace the timestamp information based on a fixed preset timestamp, thereby avoiding different verification codes generated due to different operating users and timestamp information, thereby avoiding the generation of different verification codes for business function packages with exactly the same content.

[0191] The generating unit 111 generates a version description file according to the reference cache table and the verification code.

[0192] In at least one embodiment of the present invention, the version description file refers to description information corresponding to the multiple business function packages.

[0193] In at least one embodiment of the present invention, the reference cache table includes the hash value and the target method name, and the generation unit 111 generates a version description file according to the reference cache table and the verification code, including:

[0194] Extracting information corresponding to the target method name from the verification code as reference information of the multiple business function packages;

[0195] Combining the hash value and the reference information to obtain version information of the multiple business function packages;

[0196] The version information is concatenated according to the arrangement order of the traversal nodes corresponding to the hash values ​​in the dependency tree to obtain the version description file.

[0197] The reference information refers to the verification code corresponding to the target method name.

[0198] The version information includes the hash value and reference information of each service function package.

[0199] By generating the version information through the hash value and the reference information, the character count of the version information can be reduced, thereby reducing the character count of the version description file. Furthermore, by traversing the order of arrangement of the nodes in the dependency tree, an ordered version description file can be generated, which can facilitate subsequent comparisons.

[0200] The acquisition unit 110 acquires a target history description file of the application to be updated.

[0201] In at least one embodiment of the present invention, the target history description file refers to a history description file that is closest to the release time of the multiple business function packages.

[0202] In at least one embodiment of the present invention, the acquisition unit 110 filters out the target history description file from the history description files according to the release time of the multiple business function packages.

[0203] The comparison unit 113 compares the version description file with the target history description file to obtain the target function.

[0204] In at least one embodiment of the present invention, the target function refers to a business function newly added by the application to be updated.

[0205] In at least one embodiment of the present invention, the target history description file includes function ciphertexts and call information of multiple historical version functions, and the comparison unit 113 compares the version description file with the target history description file to obtain the target function including:

[0206] comparing the hash value with the functional ciphertext;

[0207] If the hash value is the same as the function ciphertext, comparing the reference information corresponding to the hash value with the call information corresponding to the function ciphertext;

[0208] Determine the traversal node where the reference information and the call information are different as the target function; or

[0209] If the hash value is different from the function ciphertext, the traversal node corresponding to the hash value is determined as the target function.

[0210] By comparing the hash value with the functional ciphertext, the target function can be quickly determined under the premise that the hash value and the functional ciphertext are different. At the same time, when the hash value and the functional ciphertext are the same, the reference information and the call information can be further compared, so that the target function can be accurately determined.

[0211] The updating unit 114 dynamically updates the application to be updated according to the update status of the target function.

[0212] In at least one embodiment of the present invention, the update status refers to whether the target function has completed updating in the update terminal.

[0213] It should be emphasized that in order to further ensure the privacy and security of the above-mentioned updated status, the above-mentioned updated status can also be stored in a node of a blockchain.

[0214] In at least one embodiment of the present invention, the updating unit 114 dynamically updates the application to be updated according to the update status of the target function, including:

[0215] Parse the hash value of the target function based on the path label to obtain the function package path of the target function;

[0216] Extracting the function package information of the target function from the function package path;

[0217] Determining an update terminal for the application to be updated, and obtaining an update description file from the update terminal;

[0218] Detecting whether the update description file contains the function package information, and obtaining the update status;

[0219] If the update status is that the update description file includes the function package information, updating the application to be updated based on the function package information; or

[0220] If the update status is that the update description file does not include the function package information, it is determined that the update terminal completes the update of the application to be updated.

[0221] The path label is used to indicate the storage path of the function package.

[0222] The update terminal refers to the terminal device where the historical version of the application to be updated is located.

[0223] The update description file stores relevant function information of multiple updated functions.

[0224] By parsing the hash value through the path label, the function package path can be quickly obtained, and then the function package information can be obtained based on the function package path. Since there is no need to traverse the function package information in numerous paths, the efficiency of obtaining the function package information can be improved. Furthermore, by detecting whether the function package information is included in the update description file, on-demand update of the application to be updated can be achieved, thereby improving the update efficiency of the application to be updated.

[0225] It can be seen from the above technical solutions that the present invention, by generating the dependency tree, can assist in the rapid generation of the reference cache table because it can convert unordered dependencies into an ordered dependency tree. The verification code generated by the present invention can ensure that different verification codes are generated for function packages with exactly the same content due to different timestamps and operating users, thereby improving the accuracy of the version description file. Further, by comparing the generated version description file with the target history description file, it is possible to accurately determine the target function that needs to be updated without the need to update the multiple business function packages as a whole, thereby improving the update efficiency of the application to be updated. By detecting the update status of the target function, the application to be updated is updated according to the update status. Since the update status can further accurately determine whether the target function needs to be updated, repeated updates of the target function can be avoided, thereby further improving the update efficiency of the application to be updated.

[0226] like Figure 3 FIG. 1 is a schematic diagram of the structure of an electronic device according to a preferred embodiment of the present invention for implementing the application program updating method.

[0227] In one embodiment of the present invention, the electronic device 1 includes, but is not limited to, a memory 12, a processor 13, and computer-readable instructions stored in the memory 12 and executable on the processor 13, such as an application update program.

[0228] Those skilled in the art will understand that the schematic diagram is merely an example of the electronic device 1 and does not constitute a limitation on the electronic device 1. The electronic device 1 may include more or fewer components than shown in the diagram, or a combination of certain components, or different components. For example, the electronic device 1 may also include input and output devices, network access devices, buses, etc.

[0229] The processor 13 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor 13 is the computing core and control center of the electronic device 1, and uses various interfaces and lines to connect various parts of the entire electronic device 1, and executes the operating system of the electronic device 1 and various installed applications, program codes, etc.

[0230] Exemplarily, the computer-readable instructions may be divided into one or more modules / units, which are stored in the memory 12 and executed by the processor 13 to complete the present invention. The one or more modules / units may be a series of computer-readable instruction segments capable of completing specific functions, which are used to describe the execution process of the computer-readable instructions in the electronic device 1. For example, the computer-readable instructions may be divided into an acquisition unit 110, a generation unit 111, an analysis unit 112, a comparison unit 113, and an update unit 114.

[0231] The memory 12 can be used to store the computer-readable instructions and / or modules, and the processor 13 implements various functions of the electronic device 1 by running or executing the computer-readable instructions and / or modules stored in the memory 12, and calling the data stored in the memory 12. The memory 12 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the electronic device, etc. The memory 12 can include non-volatile and volatile memories, such as: a hard disk, a memory, a plug-in hard disk, a smart memory card (SmartMedia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other storage devices.

[0232] The memory 12 may be an external memory and / or an internal memory of the electronic device 1. Furthermore, the memory 12 may be a memory in a physical form, such as a memory stick, a TF card (Trans-flash Card), and the like.

[0233] If the module / unit integrated in the electronic device 1 is implemented in the form of 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 present invention implements all or part of the processes in the above-mentioned embodiment method, and can also instruct the relevant hardware to complete it through computer-readable instructions. The computer-readable instructions can be stored in a computer-readable storage medium. When the computer-readable instructions are executed by the processor, the steps of the above-mentioned various method embodiments can be implemented.

[0234] The computer-readable instructions include computer-readable instruction codes, which may be in source code form, object code form, executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer-readable instruction code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM).

[0235] The blockchain referred to in this invention is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.

[0236] Combination Figure 1 The memory 12 in the electronic device 1 stores computer-readable instructions to implement an application updating method, and the processor 13 can execute the computer-readable instructions to implement:

[0237] Acquire multiple business function packages of the application to be updated and dependencies of the multiple business function packages;

[0238] Generate a dependency tree according to the function names of the multiple business function packages and the dependency relationships;

[0239] Perform dependency analysis on the dependency tree based on the multiple business function packages to obtain a reference cache table;

[0240] Generating verification codes of the multiple business function packages according to the file information of the multiple business function packages;

[0241] Generate a version description file according to the reference cache table and the verification code;

[0242] Obtaining a target history description file of the application to be updated;

[0243] Comparing the version description file with the target history description file to obtain the target function;

[0244] The application to be updated is dynamically updated according to the update status of the target function.

[0245] Specifically, the specific implementation method of the processor 13 for the above-mentioned computer readable instructions can refer to Figure 1 The description of the relevant steps in the corresponding embodiments will not be repeated here.

[0246] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.

[0247] The computer-readable storage medium stores computer-readable instructions, wherein the computer-readable instructions are used to implement the following steps when executed by the processor 13:

[0248] Acquire multiple business function packages of the application to be updated and dependencies of the multiple business function packages;

[0249] Generate a dependency tree according to the function names of the multiple business function packages and the dependency relationships;

[0250] Perform dependency analysis on the dependency tree based on the multiple business function packages to obtain a reference cache table;

[0251] Generating verification codes of the multiple business function packages according to the file information of the multiple business function packages;

[0252] Generate a version description file according to the reference cache table and the verification code;

[0253] Obtaining a target history description file of the application to be updated;

[0254] Comparing the version description file with the target history description file to obtain the target function;

[0255] The application to be updated is dynamically updated according to the update status of the target function.

[0256] The modules described as separate components may or may not be physically separated, and the components shown as modules 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 modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0257] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.

[0258] Therefore, no matter from which point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present invention is limited by the appended claims rather than the above description, so it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any attached figure mark in the claims should not be regarded as limiting the claims involved.

[0259] In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. The multiple units or devices mentioned can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.

[0260] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.

Claims

1. A method for updating an application, characterized in that: The application updating method comprises: Acquire multiple business function packages of the application to be updated and dependencies of the multiple business function packages; Generate a dependency tree according to the function names of the multiple business function packages and the dependency relationships, including: determining the multiple function names as multiple dependency nodes; counting the number of node dependencies of each dependency node according to the dependency relationship; iteratively screening root nodes and leaf nodes from the multiple dependency nodes according to the number of node dependencies and the dependency relationship until the dependency relationship is processed, including: determining the dependency node with the largest number of node dependencies as the root node; selecting the candidate nodes of the root node from the multiple dependency nodes according to the dependency relationship; screening the nodes with the largest number of node dependencies from the candidate nodes as the leaf nodes of the root node, and determining the leaf nodes as the root nodes of the next round of iterative processing; constructing the dependency tree based on the root node and the leaf nodes; Performing dependency analysis on the dependency tree based on the multiple business function packages to obtain a reference cache table, including: performing a breadth-first traversal on the dependency tree to obtain traversal nodes and connection nodes of the traversal nodes; extracting node function packages corresponding to the traversal nodes from the multiple business function packages; performing a depth-first traversal on the node function packages based on the connection nodes to obtain target method names corresponding to the connection nodes in the node function packages; obtaining a file path of the node function package, and generating a hash value of the node function package according to the function name and the file path; using the hash value as a data key and the target method name as a data value to generate the reference cache table; Generating verification codes of the multiple business function packages according to the file information of the multiple business function packages; Generate a version description file according to the reference cache table and the verification code; Obtaining a target history description file of the application to be updated; Comparing the version description file with the target history description file to obtain the target function; The application to be updated is dynamically updated according to the update status of the target function.

2. The application updating method according to claim 1, characterized in that: The reference cache table includes the hash value and the target method name, and generating a version description file according to the reference cache table and the verification code includes: Extracting information corresponding to the target method name from the verification code as reference information of the multiple business function packages; Combining the hash value and the reference information to obtain version information of the multiple business function packages; The version information is concatenated according to the arrangement order of the traversal nodes corresponding to the hash values ​​in the dependency tree to obtain the version description file.

3. The application updating method according to claim 2, characterized in that: The target history description file includes function ciphertexts and call information of multiple historical version functions, and the comparison between the version description file and the target history description file to obtain the target function includes: comparing the hash value with the functional ciphertext; If the hash value is the same as the function ciphertext, comparing the reference information corresponding to the hash value with the call information corresponding to the function ciphertext; Determine the traversal node where the reference information and the call information are different as the target function; or If the hash value is different from the function ciphertext, the traversal node corresponding to the hash value is determined as the target function.

4. The application updating method according to claim 1, characterized in that: The step of generating verification codes of the plurality of business function packages according to the file information of the plurality of business function packages comprises: Eliminate information corresponding to a preset label from the file information to obtain function information, wherein the preset label is used to indicate an operating user; Extracting timestamp information of the plurality of service function packages from the function information; Replacing the timestamp information based on a preset timestamp to obtain target information corresponding to the function information; The target information is processed according to a preset rule algorithm to obtain the verification code.

5. The application updating method according to claim 1, characterized in that: The dynamically updating the application to be updated according to the update status of the target function comprises: Parse the hash value of the target function based on the path label to obtain the function package path of the target function; Extracting the function package information of the target function from the function package path; Determining an update terminal for the application to be updated, and obtaining an update description file from the update terminal; Detecting whether the update description file contains the function package information, and obtaining the update status; If the update status is that the update description file includes the function package information, updating the application to be updated based on the function package information; or If the update status is that the update description file does not include the function package information, it is determined that the update terminal completes the update of the application to be updated.

6. An application updating device, characterized in that: The application updating device comprises: An acquisition unit, configured to acquire a plurality of business function packages of an application to be updated and dependencies between the plurality of business function packages; A generation unit, for generating a dependency tree according to the function names of the multiple business function packages and the dependency relationships, including: determining the multiple function names as multiple dependency nodes; counting the number of node dependencies of each dependency node according to the dependency relationship; iteratively screening root nodes and leaf nodes from the multiple dependency nodes according to the number of node dependencies and the dependency relationship until the dependency relationship is processed, including: determining the dependency node with the largest number of node dependencies as the root node; selecting the candidate nodes of the root node from the multiple dependency nodes according to the dependency relationship; screening the nodes with the largest number of node dependencies from the candidate nodes as the leaf nodes of the root node, and determining the leaf nodes as the root nodes of the next round of iterative processing; constructing the dependency tree based on the root node and the leaf nodes; The analysis unit is used to perform dependency analysis on the dependency tree based on the multiple business function packages to obtain a reference cache table, including: performing a breadth-first traversal on the dependency tree to obtain traversal nodes and connection nodes of the traversal nodes; extracting node function packages corresponding to the traversal nodes from the multiple business function packages; performing a depth-first traversal on the node function packages based on the connection nodes to obtain target method names corresponding to the connection nodes in the node function packages; obtaining a file path of the node function package, and generating a hash value of the node function package according to the function name and the file path; using the hash value as a data key and the target method name as a data value to generate the reference cache table; The generating unit is further configured to generate verification codes of the multiple business function packages according to the file information of the multiple business function packages; The generating unit is further used to generate a version description file according to the reference cache table and the verification code; The acquisition unit is further used to acquire a target history description file of the application to be updated; A comparison unit, used for comparing the version description file with the target history description file to obtain a target function; An updating unit is used to dynamically update the application to be updated according to the update status of the target function.

7. An electronic device, characterized in that: The electronic device comprises: a memory storing computer-readable instructions; and A processor executes computer-readable instructions stored in the memory to implement the application updating method according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, and the computer-readable instructions are executed by a processor in an electronic device to implement the application updating method as described in any one of claims 1 to 5.