CN114035827A - Application program updating method, device, equipment and storage medium - Google Patents

Application program updating method, device, equipment and storage medium Download PDF

Info

Publication number
CN114035827A
CN114035827A CN202111437024.XA CN202111437024A CN114035827A CN 114035827 A CN114035827 A CN 114035827A CN 202111437024 A CN202111437024 A CN 202111437024A CN 114035827 A CN114035827 A CN 114035827A
Authority
CN
China
Prior art keywords
function
information
target
updating
node
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111437024.XA
Other languages
Chinese (zh)
Inventor
张闻宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Life Insurance Company of China Ltd
Original Assignee
Ping An Life Insurance Company of China Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Life Insurance Company of China Ltd filed Critical Ping An Life Insurance Company of China Ltd
Priority to CN202111437024.XA priority Critical patent/CN114035827A/en
Publication of CN114035827A publication Critical patent/CN114035827A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • Databases & Information Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to artificial intelligence and provides an application program updating method, device, equipment and storage medium. The method can acquire a plurality of service function packages of the application program to be updated and the dependency relationship of the service function packages, generate a dependency tree according to the function names and the dependency relationship of the service function packages, perform dependency analysis on the dependency tree based on the service function packages to obtain a reference cache table, generate check codes of the service function packages according to file information of the service function packages, generate a version description file according to the reference cache table and the check codes, acquire a target history description file of the application program to be updated, compare the version description file with the target history description file to obtain a target function, and dynamically update the application program to be updated according to the update state of the target function, so that the update efficiency can be improved. In addition, the invention also relates to a block chain technology, and the updating state can be stored in the block chain.

Description

Application program updating method, device, equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a storage medium for updating an application program.
Background
Currently, when an application update is loaded, the whole RN package (read-Native) of the application is generally required to be updated and downloaded. However, as the service is developed, the volume of the RN packet is increased, which results in the extension of the update time and the loading time of the application program, and is not favorable for the user experience.
With the development of the internet, a mode of updating and loading an application program by adopting a differential packet is also generated, however, the differential packet as a physical unpacking cannot be independently operated, so that the updating and loading rate cannot be optimized.
Disclosure of Invention
In view of the foregoing, it is desirable to provide an application updating method, apparatus, device and storage medium capable of increasing an application updating rate.
In one aspect, the present invention provides an application program updating method, where the application program updating method includes:
acquiring a plurality of service function packages of an application program to be updated and the dependency relationship of the service function packages;
generating a dependency tree according to the function names of the service function packages and the dependency relationship;
performing dependency analysis on the dependency tree based on the plurality of service function packages to obtain a reference cache table;
generating check codes of the plurality of service function packages according to the file information of the plurality of service function packages;
generating a version description file according to the reference cache table and the check code;
acquiring a target history description file of the application program to be updated;
comparing the version description file with the target history description file to obtain a target function;
and dynamically updating the application program to be updated according to the updating state of the target function.
According to a preferred embodiment of the present invention, the generating a dependency tree according to the function names of the plurality of service function packages and the dependency relationship includes:
determining a plurality of the function names as a plurality of dependent nodes;
counting the node dependence quantity of each dependence node according to the dependence relationship;
iteratively screening root nodes and leaf nodes from the plurality of dependency nodes according to the node dependency number and the dependency relationship until the dependency relationship is processed, comprising: determining the dependent node with the maximum node dependence number as a root node; selecting a node to be selected of the root node from the plurality of dependent nodes according to the dependency relationship; screening out nodes with the maximum node dependence number from the nodes to be selected as leaf nodes of the root nodes, and determining the leaf nodes as the root nodes of the next round of iterative processing;
and constructing the dependency tree based on the root nodes and the leaf nodes.
According to a preferred embodiment of the present invention, the performing dependency analysis on the dependency tree based on the plurality of service function packages to obtain a reference cache table includes:
performing breadth-first traversal on the dependency tree to obtain traversal nodes and connection nodes of the traversal nodes;
extracting a node function packet corresponding to the traversal node from the plurality of service function packets;
performing depth-first traversal on the node function package based on the link node to obtain a target method name corresponding to the link node in the node function package;
acquiring 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;
and taking the hash value as a data key, and taking the target method name as a data value to generate the reference cache table.
According to a preferred embodiment of the present invention, the reference cache table includes the hash value and the target method name, and the generating the version description file according to the reference cache table and the check code includes:
extracting information corresponding to the target method name from the check code as reference information of the plurality of service function packages;
merging the hash value and the reference information to obtain version information of the service function packages;
and splicing the version information according to the arrangement sequence of the traversal nodes corresponding to the hash values in the dependency tree to obtain the version description file.
According to the preferred embodiment of the present invention, the target history description file includes function ciphertexts and calling information of a plurality of history version functions, and the comparing the version description file with the target history description file to obtain the target function includes:
comparing the hash value with the function ciphertext;
if the hash value is the same as the function ciphertext, comparing the reference information corresponding to the hash value with the calling information corresponding to the function ciphertext;
determining traversal nodes with the reference information different from the calling information as the target functions; or
And if the hash value is different from the function ciphertext, determining the traversal node corresponding to the hash value as the target function.
According to a preferred embodiment of the present invention, the generating the check codes of the service function packages according to the file information of the service function packages includes:
information corresponding to a preset label is removed from the file information to obtain functional information, and the preset label is used for indicating an operation user;
extracting time stamp information of the plurality of service function packets from the function information;
replacing the timestamp information based on a preset timestamp to obtain target information corresponding to the function information;
and processing the target information according to a preset rule algorithm to obtain the check code.
According to a preferred embodiment of the present invention, the dynamically updating the application to be updated according to the update status of the target function includes:
analyzing the hash value of the target function based on the path label to obtain a function packet path of the target function;
extracting function packet information of the target function from the function packet path;
determining an updating terminal of the application program to be updated, and acquiring an updating description file from the updating terminal;
detecting whether the update description file contains the function package information or not to obtain the update state;
if the updating state is that the updating description file contains the function package information, updating the application program to be updated based on the function package information; or
And if the updating state is that the updating description file does not contain the function package information, determining that the updating terminal completes updating the application program to be updated.
In another aspect, the present invention further provides an application program updating apparatus, including:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring a plurality of service function packages of an application program to be updated and the dependency relationship of the service function packages;
a generating unit, configured to generate a dependency tree according to the function names of the service function packages and the dependency relationship;
the analysis unit is used for carrying out dependency analysis on the dependency tree based on the service function packages to obtain a reference cache table;
the generating unit is further configured to generate check codes of the multiple service function packages according to the file information of the multiple service function packages;
the generating unit is further configured to generate a version description file according to the reference cache table and the check code;
the acquisition unit is further used for acquiring a target history description file of the application program to be updated;
the comparison unit is used for comparing the version description file with the target history description file to obtain a target function;
and the updating unit is used for dynamically updating the application program to be updated according to the updating state of the target function.
In another aspect, the present invention further provides an electronic device, including:
a memory storing computer readable instructions; and
a processor executing computer readable instructions stored in the memory to implement the application update method.
In another aspect, the present invention also provides a computer-readable storage medium, in which computer-readable instructions are stored, and the computer-readable instructions are executed by a processor in an electronic device to implement the application program updating method.
It can be seen from the above technical solutions that, by generating the dependency tree, the present invention can assist the rapid generation of the reference cache table because the unordered dependency relationship can be converted into the ordered dependency tree, and by the check code generated by the present invention, it can be ensured that function packages having completely the same content are not generated with different timestamps and different operation users, thereby improving the accuracy of the version description file, and further by comparing the generated version description file with the target history description file, it can accurately determine the target function to be updated without integrally updating the plurality of service function packages, thereby improving the update efficiency of the application program to be updated, and by detecting the update state of the target function, the application program to be updated is updated according to the update state, whether the target function needs to be updated or not can be further accurately determined through the updating state, so that repeated updating of the target function can be avoided, and the updating efficiency of the application program to be updated is further improved.
Drawings
FIG. 1 is a flowchart of an application update method according to a preferred embodiment of the present invention.
FIG. 2 is a functional block diagram of an application update apparatus according to a preferred embodiment of the present invention.
FIG. 3 is a schematic structural diagram of an electronic device implementing an application update method according to a preferred embodiment of the invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in detail with reference to the accompanying drawings and specific embodiments.
FIG. 1 is a flowchart illustrating an application program update method according to a preferred embodiment of the present invention. The order of the steps in the flow chart may be changed and some steps may be omitted according to different needs.
The application program updating method can acquire and process related data based on artificial intelligence technology. Among them, Artificial Intelligence (AI) is a theory, method, technique and application system that simulates, extends and expands human Intelligence using a digital computer or a machine controlled by a digital computer, senses the environment, acquires knowledge and uses the knowledge to obtain the best result.
The artificial intelligence infrastructure generally includes technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a robot technology, a biological recognition technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and the like.
The Application program updating method is applied to one or more electronic devices, which are devices capable of automatically performing numerical calculation and/or information processing according to computer readable instructions set or stored in advance, and the hardware thereof includes, but is not limited to, a microprocessor, an Application Specific Integrated Circuit (ASIC), a Programmable Gate Array (FPGA), a Digital Signal Processor (DSP), an embedded device, and the like.
The electronic device may be any electronic product capable of performing human-computer interaction with a user, for example, a Personal computer, a tablet computer, a smart phone, a Personal Digital Assistant (PDA), a game machine, an interactive Internet Protocol Television (IPTV), a smart wearable device, and the like.
The electronic device may include a network device and/or a user device. Wherein the network device includes, but is not limited to, a single network electronic device, an electronic device group consisting of a plurality of network electronic devices, or a Cloud Computing (Cloud Computing) based Cloud consisting of a large number of hosts or network electronic devices.
The network in which 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), and the like.
S10, obtaining a plurality of service function packages of the application program to be updated and the dependency relationship of the service function packages.
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.
The service function packages refer to code package information corresponding to all service nodes in the application program to be updated.
The dependency relationship refers to a relationship between any two service nodes.
In at least one embodiment of the present invention, the acquiring, by the electronic device, a plurality of service function packages of an application to be updated and a dependency relationship between the plurality of service function packages includes:
acquiring configuration information of the application program to be updated;
extracting service nodes from the configuration information according to the first configuration label, and acquiring the plurality of service function packages based on the service nodes;
and extracting the dependency relationship from the configuration information according to a second configuration label.
The configuration information may be initial information set in advance by a user. The configuration information stores a plurality of preset nodes and relations.
The first configuration label is used for indicating a node, and the second configuration label is used for indicating a relationship.
And S11, generating a dependency tree according to the function names of the service function packages and the dependency relationship.
In at least one embodiment of the present invention, the dependency tree includes a plurality of dependency nodes and the dependency relationships. The structure of the dependency tree is a tree structure.
In at least one embodiment of the present invention, the generating, by the electronic device, a dependency tree according to the function names of the service function packages and the dependency relationship includes:
determining a plurality of the function names as a plurality of dependent nodes;
counting the node dependence quantity of each dependence node according to the dependence relationship;
iteratively screening root nodes and leaf nodes from the plurality of dependency nodes according to the node dependency number and the dependency relationship until the dependency relationship is processed, comprising: determining the dependent node with the maximum node dependence number as a root node; selecting a node to be selected of the root node from the plurality of dependent nodes according to the dependency relationship; screening out nodes with the maximum node dependence number from the nodes to be selected as leaf nodes of the root node, and determining the leaf nodes as the root nodes of the next round of iterative processing;
and constructing the dependency tree based on the root nodes and the leaf nodes.
And the candidate node is a dependent node having a dependent relationship with the root node.
The root node and the leaf node can be rapidly screened out from the plurality of dependency nodes through the node dependency number and the dependency relationship, so that the construction efficiency of the dependency tree can be improved, and meanwhile, the construction comprehensiveness of the dependency tree can be improved by taking the dependency relationship as a stop condition of iterative processing.
S12, performing dependency analysis on the dependency tree based on the service function packages to obtain a reference cache table.
In at least one embodiment of the present invention, a mapping relationship between a hash value of a traversal node and a target method name is stored in the reference cache table, where the traversal node refers to any dependent node in the dependency tree, and the hash value refers to information generated by encrypting according to a function name of the traversal node and the file path.
In at least one embodiment of the present invention, the performing, by the electronic device, dependency analysis on the dependency tree based on the service function packages to obtain a reference cache table includes:
performing breadth-first traversal on the dependency tree to obtain traversal nodes and connection nodes of the traversal nodes;
extracting a node function packet corresponding to the traversal node from the plurality of service function packets;
performing depth-first traversal on the node function package based on the link node to obtain a target method name corresponding to the link node in the node function package;
acquiring 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;
and taking the hash value as a data key, and taking the target method name as a data value to generate the reference cache table.
Wherein the connection node is a node connected to the traversal node in the dependency tree.
The target method name refers to a specific method for referring to the connection node in the node function package.
By performing breadth-first traversal on the dependency tree, the traversal node and the connection node can be quickly acquired, and further, by performing depth-first traversal on the node function packet, the situation that the storage space is occupied due to the fact that information in the node function packet is completely reserved can be avoided, and the situation that repeated service function packets exist in the reference cache table can be avoided by generating the hash value.
And S13, generating the check codes of the service function packages according to the file information of the service function packages.
In at least one embodiment of the present invention, the file information includes information related to the service function packages, for example, the file information includes time for generating the service function packages.
The check code is generated according to the fixed constant time point information and the content information of each service function packet. It can be understood that, if the content information of the service function packet is different, the corresponding check code of the service function packet is different, and conversely, if the content information of the service function packet is the same, the corresponding check code of the service function packet is the same.
In at least one embodiment of the present invention, the generating, by the electronic device, the check codes of the service function packages according to the file information of the service function packages includes:
information corresponding to a preset label is removed from the file information to obtain functional information, and the preset label is used for indicating an operation user;
extracting time stamp information of the plurality of service function packets from the function information;
replacing the timestamp information based on a preset timestamp to obtain target information corresponding to the function information;
and processing the target information according to a preset rule algorithm to obtain the check code.
The function information is file information that does not include information related to the operating user.
The preset timestamp may be any fixed constant time point information.
The preset rule algorithm can be any algorithm with dependent variables different from independent variables.
Through the preset tag, information related to the operating user can be accurately removed from the file information, and then the timestamp information is replaced based on the fixed preset timestamp, so that the situation that generated check codes are different due to the fact that the operating user and the timestamp information are different can be avoided, and therefore the situation that different check codes are generated by service function packages with the same content can be avoided.
And S14, generating a version description file according to the reference cache table and the check code.
In at least one embodiment of the present invention, the version description file refers to description information corresponding to the plurality of service function packages.
In at least one embodiment of the present invention, the reference cache table includes the hash value and the target method name, and the generating, by the electronic device, the version description file according to the reference cache table and the check code includes:
extracting information corresponding to the target method name from the check code as reference information of the plurality of service function packages;
merging the hash value and the reference information to obtain version information of the service function packages;
and splicing the version information according to the arrangement sequence of the traversal nodes corresponding to the hash values in the dependency tree to obtain the version description file.
The reference information refers to a check code corresponding to the target method name.
The version information includes hash values and reference information of each service function packet.
The version information is generated through the hash value and the reference information, the character quantity of the version information can be reduced, the character quantity of the version description file is reduced, and then the ordered version description file can be generated through the arrangement sequence of the traversal nodes in the dependency tree, so that the subsequent comparison can be facilitated.
And S15, acquiring the target history description file of the application program to be updated.
In at least one embodiment of the present invention, the target history description file refers to a history description file closest to the publishing time of the service function packages.
In at least one embodiment of the invention, the electronic device screens out the target history description file from the history description files according to the publishing time of the plurality of service function packages.
And S16, comparing the version description file with the target history description file to obtain a target function.
In at least one embodiment of the present invention, the target function refers to a business function added by the application to be updated.
In at least one embodiment of the present invention, the target history description file includes function ciphertexts and calling information of a plurality of history version functions, and the electronic device compares the version description file with the target history description file to obtain the target function, where the obtaining of the target function includes:
comparing the hash value with the function ciphertext;
if the hash value is the same as the function ciphertext, comparing the reference information corresponding to the hash value with the calling information corresponding to the function ciphertext;
determining traversal nodes with the reference information different from the calling information as the target functions; or
And if the hash value is different from the function ciphertext, determining the traversal node corresponding to the hash value as the target function.
By comparing the hash value with the function ciphertext, the target function can be quickly determined on the premise that the hash value is different from the function ciphertext, and meanwhile, the reference information and the calling information can be further compared when the hash value is the same as the function ciphertext, so that the target function can be accurately determined.
And S17, dynamically updating the application program to be updated according to the update state of the target function.
In at least one embodiment of the present invention, the update status refers to a status of whether the target function completes updating in an update terminal.
It is emphasized that the update state may also be stored in a node of a blockchain in order to further ensure privacy and security of the update state.
In at least one embodiment of the present invention, the dynamically updating, by the electronic device, the application to be updated according to the update status of the target function includes:
analyzing the hash value of the target function based on the path label to obtain a function packet path of the target function;
extracting function packet information of the target function from the function packet path;
determining an updating terminal of the application program to be updated, and acquiring an updating description file from the updating terminal;
detecting whether the update description file contains the function package information or not to obtain the update state;
if the updating state is that the updating description file contains the function package information, updating the application program to be updated based on the function package information; or
And if the updating state is that the updating description file does not contain the function package information, determining that the updating terminal completes updating the application program to be updated.
Wherein the path label is used for indicating the storage path of the function package.
The update terminal is the terminal equipment where the historical version of the application program to be updated is located.
The update description file stores related function information of a plurality of updated functions.
The hash value is analyzed through the path label, the function package path can be quickly acquired, the function package information is further acquired based on the function package path, and the function package information does not need to be traversed in numerous paths, so that the acquisition efficiency of the function package information can be improved, further, the on-demand update of the application program to be updated can be realized by detecting whether the update description file contains the function package information, and the update efficiency of the application program to be updated is improved.
It can be seen from the above technical solutions that, by generating the dependency tree, the present invention can assist the rapid generation of the reference cache table because the unordered dependency relationship can be converted into the ordered dependency tree, and by the check code generated by the present invention, it can be ensured that function packages having completely the same content are not generated with different timestamps and different operation users, thereby improving the accuracy of the version description file, and further by comparing the generated version description file with the target history description file, it can accurately determine the target function to be updated without integrally updating the plurality of service function packages, thereby improving the update efficiency of the application program to be updated, and by detecting the update state of the target function, the application program to be updated is updated according to the update state, whether the target function needs to be updated or not can be further accurately determined through the updating state, so that repeated updating of the target function can be avoided, and the updating efficiency of the application program to be updated is further improved.
FIG. 2 is a functional block diagram of an application update apparatus according to a preferred embodiment of the present invention. The application updating apparatus 11 includes an obtaining unit 110, a generating unit 111, an analyzing unit 112, a comparing unit 113, and an updating unit 114. The module/unit referred to herein is a series of computer readable instruction segments that can be accessed by the processor 13 and perform a fixed function and that are stored in the memory 12. In the present embodiment, the functions of the modules/units will be described in detail in the following embodiments.
The obtaining unit 110 obtains a plurality of service function packages of an application to be updated and a dependency relationship of the service function packages.
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.
The service function packages refer to code package information corresponding to all service nodes in the application program to be updated.
The dependency relationship refers to a relationship between any two service nodes.
In at least one embodiment of the present invention, the acquiring unit 110 acquires a plurality of service function packages of an application to be updated and a dependency relationship between the plurality of service function packages includes:
acquiring configuration information of the application program to be updated;
extracting service nodes from the configuration information according to the first configuration label, and acquiring the plurality of service function packages based on the service nodes;
and extracting the dependency relationship from the configuration information according to a second configuration label.
The configuration information may be initial information set in advance by a user. The configuration information stores a plurality of preset nodes and relations.
The first configuration label is used for indicating a node, and the second configuration label is used for indicating a relationship.
The generating unit 111 generates a dependency tree according to the function names of the plurality of service function packages and the dependency relationship.
In at least one embodiment of the present invention, the dependency tree includes a plurality of dependency nodes and the dependency relationships. The structure of the dependency tree is a tree structure.
In at least one embodiment of the present invention, the generating unit 111 generates the dependency tree according to the function names of the plurality of service function packages and the dependency relationship, including:
determining a plurality of the function names as a plurality of dependent nodes;
counting the node dependence quantity of each dependence node according to the dependence relationship;
iteratively screening root nodes and leaf nodes from the plurality of dependency nodes according to the node dependency number and the dependency relationship until the dependency relationship is processed, comprising: determining the dependent node with the maximum node dependence number as a root node; selecting a node to be selected of the root node from the plurality of dependent nodes according to the dependency relationship; screening out nodes with the maximum node dependence number from the nodes to be selected as leaf nodes of the root node, and determining the leaf nodes as the root nodes of the next round of iterative processing;
and constructing the dependency tree based on the root nodes and the leaf nodes.
And the candidate node is a dependent node having a dependent relationship with the root node.
The root node and the leaf node can be rapidly screened out from the plurality of dependency nodes through the node dependency number and the dependency relationship, so that the construction efficiency of the dependency tree can be improved, and meanwhile, the construction comprehensiveness of the dependency tree can be improved by taking the dependency relationship as a stop condition of iterative processing.
The analysis unit 112 performs dependency analysis on the dependency tree based on the service function packages to obtain a reference cache table.
In at least one embodiment of the present invention, a mapping relationship between a hash value of a traversal node and a target method name is stored in the reference cache table, where the traversal node refers to any dependent node in the dependency tree, and the hash value refers to information generated by encrypting according to a function name of the traversal node and the file path.
In at least one embodiment of the present invention, the analyzing unit 112 performs dependency analysis on the dependency tree based on the service function packages, and obtaining the reference cache table includes:
performing breadth-first traversal on the dependency tree to obtain traversal nodes and connection nodes of the traversal nodes;
extracting a node function packet corresponding to the traversal node from the plurality of service function packets;
performing depth-first traversal on the node function package based on the link node to obtain a target method name corresponding to the link node in the node function package;
acquiring 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;
and taking the hash value as a data key, and taking the target method name as a data value to generate the reference cache table.
Wherein the connection node is a node connected to the traversal node in the dependency tree.
The target method name refers to a specific method for referring to the connection node in the node function package.
By performing breadth-first traversal on the dependency tree, the traversal node and the connection node can be quickly acquired, and further, by performing depth-first traversal on the node function packet, the situation that the storage space is occupied due to the fact that information in the node function packet is completely reserved can be avoided, and the situation that repeated service function packets exist in the reference cache table can be avoided by generating the hash value.
The generating unit 111 generates the check codes of the service function packages according to the file information of the service function packages.
In at least one embodiment of the present invention, the file information includes information related to the service function packages, for example, the file information includes time for generating the service function packages.
The check code is generated according to the fixed constant time point information and the content information of each service function packet. It can be understood that, if the content information of the service function packet is different, the corresponding check code of the service function packet is different, and conversely, if the content information of the service function packet is the same, the corresponding check code of the service function packet is the same.
In at least one embodiment of the present invention, the generating unit 111 generates the check codes of the service function packages according to the file information of the service function packages, where the generating unit includes:
information corresponding to a preset label is removed from the file information to obtain functional information, and the preset label is used for indicating an operation user;
extracting time stamp information of the plurality of service function packets from the function information;
replacing the timestamp information based on a preset timestamp to obtain target information corresponding to the function information;
and processing the target information according to a preset rule algorithm to obtain the check code.
The function information is file information that does not include information related to the operating user.
The preset timestamp may be any fixed constant time point information.
The preset rule algorithm can be any algorithm with dependent variables different from independent variables.
Through the preset tag, information related to the operating user can be accurately removed from the file information, and then the timestamp information is replaced based on the fixed preset timestamp, so that the situation that generated check codes are different due to the fact that the operating user and the timestamp information are different can be avoided, and therefore the situation that different check codes are generated by service function packages with the same content can be avoided.
The generating unit 111 generates a version description file according to the reference cache table and the check code.
In at least one embodiment of the present invention, the version description file refers to description information corresponding to the plurality of service function packages.
In at least one embodiment of the present invention, the reference cache table includes the hash value and the target method name, and the generating unit 111 generates the version description file according to the reference cache table and the check code includes:
extracting information corresponding to the target method name from the check code as reference information of the plurality of service function packages;
merging the hash value and the reference information to obtain version information of the service function packages;
and splicing the version information according to the arrangement sequence of the traversal nodes corresponding to the hash values in the dependency tree to obtain the version description file.
The reference information refers to a check code corresponding to the target method name.
The version information includes hash values and reference information of each service function packet.
The version information is generated through the hash value and the reference information, the character quantity of the version information can be reduced, the character quantity of the version description file is reduced, and then the ordered version description file can be generated through the arrangement sequence of the traversal nodes in the dependency tree, so that the subsequent comparison can be facilitated.
The obtaining unit 110 obtains a target history description file of the application to be updated.
In at least one embodiment of the present invention, the target history description file refers to a history description file closest to the publishing time of the service function packages.
In at least one embodiment of the present invention, the obtaining unit 110 screens out the target history description file from the history description files according to the publishing time of the plurality of service function packages.
The comparing unit 113 compares the version description file with the target history description file to obtain a target function.
In at least one embodiment of the present invention, the target function refers to a business function added by the application to be updated.
In at least one embodiment of the present invention, the target history description file includes function ciphertexts and calling information of a plurality of history version functions, and the comparing unit 113 compares the version description file with the target history description file to obtain the target function, where the obtaining the target function includes:
comparing the hash value with the function ciphertext;
if the hash value is the same as the function ciphertext, comparing the reference information corresponding to the hash value with the calling information corresponding to the function ciphertext;
determining traversal nodes with the reference information different from the calling information as the target functions; or
And if the hash value is different from the function ciphertext, determining the traversal node corresponding to the hash value as the target function.
By comparing the hash value with the function ciphertext, the target function can be quickly determined on the premise that the hash value is different from the function ciphertext, and meanwhile, the reference information and the calling information can be further compared when the hash value is the same as the function ciphertext, so that the target function can be accurately determined.
The updating unit 114 dynamically updates the application to be updated according to the update status of the target function.
In at least one embodiment of the present invention, the update status refers to a status of whether the target function completes updating in an update terminal.
It is emphasized that the update state may also be stored in a node of a blockchain in order to further ensure privacy and security of the update state.
In at least one embodiment of the present invention, the dynamically updating, by the updating unit 114, the application to be updated according to the update status of the target function includes:
analyzing the hash value of the target function based on the path label to obtain a function packet path of the target function;
extracting function packet information of the target function from the function packet path;
determining an updating terminal of the application program to be updated, and acquiring an updating description file from the updating terminal;
detecting whether the update description file contains the function package information or not to obtain the update state;
if the updating state is that the updating description file contains the function package information, updating the application program to be updated based on the function package information; or
And if the updating state is that the updating description file does not contain the function package information, determining that the updating terminal completes updating the application program to be updated.
Wherein the path label is used for indicating the storage path of the function package.
The update terminal is the terminal equipment where the historical version of the application program to be updated is located.
The update description file stores related function information of a plurality of updated functions.
The hash value is analyzed through the path label, the function package path can be quickly acquired, the function package information is further acquired based on the function package path, and the function package information does not need to be traversed in numerous paths, so that the acquisition efficiency of the function package information can be improved, further, the on-demand update of the application program to be updated can be realized by detecting whether the update description file contains the function package information, and the update efficiency of the application program to be updated is improved.
It can be seen from the above technical solutions that, by generating the dependency tree, the present invention can assist the rapid generation of the reference cache table because the unordered dependency relationship can be converted into the ordered dependency tree, and by the check code generated by the present invention, it can be ensured that function packages having completely the same content are not generated with different timestamps and different operation users, thereby improving the accuracy of the version description file, and further by comparing the generated version description file with the target history description file, it can accurately determine the target function to be updated without integrally updating the plurality of service function packages, thereby improving the update efficiency of the application program to be updated, and by detecting the update state of the target function, the application program to be updated is updated according to the update state, whether the target function needs to be updated or not can be further accurately determined through the updating state, so that repeated updating of the target function can be avoided, and the updating efficiency of the application program to be updated is further improved.
Fig. 3 is a schematic structural diagram of an electronic device implementing the method for updating an application program according to a preferred embodiment of the present invention.
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, such as an application update program, stored in the memory 12 and executable on the processor 13.
It will be appreciated by a person skilled in the art that the schematic diagram is only an example of the electronic device 1 and does not constitute a limitation of the electronic device 1, and that it may comprise more or less components than shown, or some components may be combined, or different components, e.g. the electronic device 1 may further comprise an input output device, a network access device, a bus, etc.
The Processor 13 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, etc. The processor 13 is an operation core and a control center of the electronic device 1, and is connected to each part of the whole electronic device 1 by various interfaces and lines, and executes an operating system of the electronic device 1 and various installed application programs, program codes, and the like.
Illustratively, the computer readable instructions may be partitioned into one or more modules/units that are stored in the memory 12 and executed by the processor 13 to implement the present invention. The one or more modules/units may be a series of computer readable instruction segments capable of performing specific functions, which are used for describing the execution process of the computer readable instructions in the electronic device 1. For example, the computer readable instructions may be partitioned into an acquisition unit 110, a generation unit 111, an analysis unit 112, a comparison unit 113, and an update unit 114.
The memory 12 may be used for storing the computer readable instructions and/or modules, and the processor 13 implements various functions of the electronic device 1 by executing or executing the computer readable instructions and/or modules stored in the memory 12 and invoking data stored in the memory 12. The memory 12 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data created according to use of the electronic device, and the like. The memory 12 may include non-volatile and volatile memories, such as: a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), at least one magnetic disk storage device, a Flash memory device, or other storage device.
The memory 12 may be an external memory and/or an internal memory of the electronic device 1. Further, the memory 12 may be a memory having a physical form, such as a memory stick, a TF Card (Trans-flash Card), or the like.
The integrated modules/units of the electronic device 1 may be stored in a computer-readable storage medium if they are implemented in the form of software functional units and sold or used as separate products. Based on such understanding, all or part of the flow of the method according to the above embodiments may be implemented by hardware that is configured to be instructed by computer readable instructions, which may be stored in a computer readable storage medium, and when the computer readable instructions are executed by a processor, the steps of the method embodiments may be implemented.
Wherein the computer readable instructions comprise computer readable instruction code which may be in source code form, object code form, an executable file or some intermediate form, and the like. The computer-readable medium may include: any entity or device capable of carrying said computer readable instruction code, recording medium, U-disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM).
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
In conjunction with fig. 1, the memory 12 in the electronic device 1 stores computer-readable instructions to implement an application update method, and the processor 13 can execute the computer-readable instructions to implement:
acquiring a plurality of service function packages of an application program to be updated and the dependency relationship of the service function packages;
generating a dependency tree according to the function names of the service function packages and the dependency relationship;
performing dependency analysis on the dependency tree based on the plurality of service function packages to obtain a reference cache table;
generating check codes of the plurality of service function packages according to the file information of the plurality of service function packages;
generating a version description file according to the reference cache table and the check code;
acquiring a target history description file of the application program to be updated;
comparing the version description file with the target history description file to obtain a target function;
and dynamically updating the application program to be updated according to the updating state of the target function.
Specifically, the processor 13 may refer to the description of the relevant steps in the embodiment corresponding to fig. 1 for a specific implementation method of the computer readable instructions, which is not described herein again.
In the embodiments provided in the present invention, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The computer readable storage medium has computer readable instructions stored thereon, wherein the computer readable instructions when executed by the processor 13 are configured to implement the steps of:
acquiring a plurality of service function packages of an application program to be updated and the dependency relationship of the service function packages;
generating a dependency tree according to the function names of the service function packages and the dependency relationship;
performing dependency analysis on the dependency tree based on the plurality of service function packages to obtain a reference cache table;
generating check codes of the plurality of service function packages according to the file information of the plurality of service function packages;
generating a version description file according to the reference cache table and the check code;
acquiring a target history description file of the application program to be updated;
comparing the version description file with the target history description file to obtain a target function;
and dynamically updating the application program to be updated according to the updating state of the target function.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. The plurality of units or devices may also be implemented by one unit or device through software or hardware. The terms first, second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims (10)

1. An application updating method, comprising:
acquiring a plurality of service function packages of an application program to be updated and the dependency relationship of the service function packages;
generating a dependency tree according to the function names of the service function packages and the dependency relationship;
performing dependency analysis on the dependency tree based on the plurality of service function packages to obtain a reference cache table;
generating check codes of the plurality of service function packages according to the file information of the plurality of service function packages;
generating a version description file according to the reference cache table and the check code;
acquiring a target history description file of the application program to be updated;
comparing the version description file with the target history description file to obtain a target function;
and dynamically updating the application program to be updated according to the updating state of the target function.
2. The application updating method of claim 1, wherein the generating the dependency tree according to the function names of the plurality of business function packages and the dependency relationship comprises:
determining a plurality of the function names as a plurality of dependent nodes;
counting the node dependence quantity of each dependence node according to the dependence relationship;
iteratively screening root nodes and leaf nodes from the plurality of dependency nodes according to the node dependency number and the dependency relationship until the dependency relationship is processed, comprising: determining the dependent node with the maximum node dependence number as a root node; selecting a node to be selected of the root node from the plurality of dependent nodes according to the dependency relationship; screening out nodes with the maximum node dependence number from the nodes to be selected as leaf nodes of the root nodes, and determining the leaf nodes as the root nodes of the next round of iterative processing;
and constructing the dependency tree based on the root nodes and the leaf nodes.
3. The method for updating an application program according to claim 1, wherein the performing a dependency analysis on the dependency tree based on the plurality of service function packages to obtain a reference cache table comprises:
performing breadth-first traversal on the dependency tree to obtain traversal nodes and connection nodes of the traversal nodes;
extracting a node function packet corresponding to the traversal node from the plurality of service function packets;
performing depth-first traversal on the node function package based on the link node to obtain a target method name corresponding to the link node in the node function package;
acquiring 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;
and taking the hash value as a data key, and taking the target method name as a data value to generate the reference cache table.
4. The method for updating an application program according to claim 3, wherein the reference cache table includes the hash value and the name of the target method, and wherein the generating the version description file according to the reference cache table and the check code includes:
extracting information corresponding to the target method name from the check code as reference information of the plurality of service function packages;
merging the hash value and the reference information to obtain version information of the service function packages;
and splicing the version information according to the arrangement sequence of the traversal nodes corresponding to the hash values in the dependency tree to obtain the version description file.
5. The method for updating an application program according to claim 4, wherein the target history description file comprises function ciphertexts and calling information of a plurality of history version functions, and the comparing the version description file with the target history description file to obtain a target function comprises:
comparing the hash value with the function ciphertext;
if the hash value is the same as the function ciphertext, comparing the reference information corresponding to the hash value with the calling information corresponding to the function ciphertext;
determining traversal nodes with the reference information different from the calling information as the target functions; or
And if the hash value is different from the function ciphertext, determining the traversal node corresponding to the hash value as the target function.
6. The method for updating an application program according to claim 1, wherein the generating of the check codes of the service function packages according to the file information of the service function packages comprises:
information corresponding to a preset label is removed from the file information to obtain functional information, and the preset label is used for indicating an operation user;
extracting time stamp information of the plurality of service function packets from the function information;
replacing the timestamp information based on a preset timestamp to obtain target information corresponding to the function information;
and processing the target information according to a preset rule algorithm to obtain the check code.
7. The application program updating method according to claim 1, wherein the dynamically updating the application program to be updated according to the update status of the target function comprises:
analyzing the hash value of the target function based on the path label to obtain a function packet path of the target function;
extracting function packet information of the target function from the function packet path;
determining an updating terminal of the application program to be updated, and acquiring an updating description file from the updating terminal;
detecting whether the update description file contains the function package information or not to obtain the update state;
if the updating state is that the updating description file contains the function package information, updating the application program to be updated based on the function package information; or
And if the updating state is that the updating description file does not contain the function package information, determining that the updating terminal completes updating the application program to be updated.
8. An application update apparatus, comprising:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring a plurality of service function packages of an application program to be updated and the dependency relationship of the service function packages;
a generating unit, configured to generate a dependency tree according to the function names of the service function packages and the dependency relationship;
the analysis unit is used for carrying out dependency analysis on the dependency tree based on the service function packages to obtain a reference cache table;
the generating unit is further configured to generate check codes of the multiple service function packages according to the file information of the multiple service function packages;
the generating unit is further configured to generate a version description file according to the reference cache table and the check code;
the acquisition unit is further used for acquiring a target history description file of the application program to be updated;
the comparison unit is used for comparing the version description file with the target history description file to obtain a target function;
and the updating unit is used for dynamically updating the application program to be updated according to the updating state of the target function.
9. An electronic device, characterized in that the electronic device comprises:
a memory storing computer readable instructions; and
a processor executing computer readable instructions stored in the memory to implement the application program update method of any of claims 1 to 7.
10. A computer-readable storage medium characterized by: the computer-readable storage medium stores therein computer-readable instructions which are executed by a processor in an electronic device to implement the application program update method according to any one of claims 1 to 7.
CN202111437024.XA 2021-11-30 2021-11-30 Application program updating method, device, equipment and storage medium Pending CN114035827A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111437024.XA CN114035827A (en) 2021-11-30 2021-11-30 Application program updating method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111437024.XA CN114035827A (en) 2021-11-30 2021-11-30 Application program updating method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114035827A true CN114035827A (en) 2022-02-11

Family

ID=80145909

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111437024.XA Pending CN114035827A (en) 2021-11-30 2021-11-30 Application program updating method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114035827A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115174385A (en) * 2022-06-15 2022-10-11 桂林电子科技大学 Industrial Internet of things equipment firmware software updating method based on block chain
CN115248699A (en) * 2022-09-21 2022-10-28 华谱科仪(北京)科技有限公司 Online chromatograph system updating method and device, electronic equipment and storage medium
CN115454989A (en) * 2022-09-29 2022-12-09 深圳市手心游戏科技有限公司 Data processing method and device for application program data
CN116894014A (en) * 2023-09-08 2023-10-17 荣耀终端有限公司 Cache updating method, server, terminal equipment and chip system

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115174385A (en) * 2022-06-15 2022-10-11 桂林电子科技大学 Industrial Internet of things equipment firmware software updating method based on block chain
CN115174385B (en) * 2022-06-15 2024-04-02 桂林电子科技大学 Firmware software updating method for industrial Internet of things equipment based on blockchain
CN115248699A (en) * 2022-09-21 2022-10-28 华谱科仪(北京)科技有限公司 Online chromatograph system updating method and device, electronic equipment and storage medium
CN115248699B (en) * 2022-09-21 2022-12-06 华谱科仪(北京)科技有限公司 Online chromatograph system updating method and device, electronic device and storage medium
CN115454989A (en) * 2022-09-29 2022-12-09 深圳市手心游戏科技有限公司 Data processing method and device for application program data
CN115454989B (en) * 2022-09-29 2023-12-08 深圳市手心游戏科技有限公司 Data processing method and device for application program data
CN116894014A (en) * 2023-09-08 2023-10-17 荣耀终端有限公司 Cache updating method, server, terminal equipment and chip system
CN116894014B (en) * 2023-09-08 2024-02-27 荣耀终端有限公司 Cache updating method, server, terminal equipment and chip system

Similar Documents

Publication Publication Date Title
CN114035827A (en) Application program updating method, device, equipment and storage medium
CN113283675B (en) Index data analysis method, device, equipment and storage medium
CN112948418A (en) Dynamic query method, device, equipment and storage medium
CN113536770B (en) Text analysis method, device and equipment based on artificial intelligence and storage medium
US11797617B2 (en) Method and apparatus for collecting information regarding dark web
CN113918467A (en) Financial system testing method, device, equipment and storage medium
CN114116108A (en) Dynamic rendering method, device, equipment and storage medium
CN113900955A (en) Automatic testing method, device, equipment and storage medium
CN112947911A (en) Interface script generation method, device, equipment and storage medium
CN113268597A (en) Text classification method, device, equipment and storage medium
CN112396314A (en) Task allocation method and device, electronic equipment and storage medium
CN113283677B (en) Index data processing method, device, equipment and storage medium
CN115952201A (en) Data query method, device, system and storage medium
CN114003784A (en) Request recording method, device, equipment and storage medium
CN114360732B (en) Medical data analysis method, device, electronic equipment and storage medium
CN114942749A (en) Development method, device and equipment of approval system and storage medium
CN115794621A (en) Code coverage test method, device, equipment and storage medium
CN114692204A (en) Data query method, device, equipment and storage medium
CN113434273B (en) Data processing method, device, system and storage medium
CN115455006A (en) Data processing method, data processing device, electronic device, and storage medium
Sosík et al. Computational power of cell separation in tissue P systems
CN113282218A (en) Multi-dimensional report generation method, device, equipment and storage medium
CN113177543A (en) Certificate identification method, device, equipment and storage medium
CN112416361A (en) Structured query language script examination method and related equipment
CN112199364A (en) Data cleaning method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination