Method, apparatus, electronic device, and storage medium for processing application data
By generating the library reference relationship of the application functions to the basic library and the functional reference relationship of the basic library referenced by the application functions, the problem of inefficient development and maintenance caused by complex resource dependencies is solved, and effective classification and rapid search of resource dependencies are realized.
Patent Information
- Application Number
- CN202111659953.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-30
- Publication Date
- 2025-07-11
- Estimated Expiration
- 2041-12-30
AI Technical Summary
In the prior art, the resource dependencies of applications are complex, resulting in inefficient development and maintenance, making it difficult for developers to effectively classify and manage resource dependencies.
By obtaining the resource reference set and resource dependency information corresponding to each application function in the application, the application function generates the library reference relationship of the basic library and the functional reference relationship of the basic library referenced by the application function, and classifies the node categories and reference relationships of the dependent nodes.
It realizes effective classification of application resource dependencies, and developers can intuitively and quickly understand which application function is referenced by the basic library and which basic library is referenced by the application function, improving search efficiency and maintenance efficiency.
Smart Images

Figure CN114416096B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of software compilation, and particularly to a method for processing application data, an apparatus for processing application data, an electronic device, and a computer-readable storage medium. Background Art
[0002] With the development of software technology, the application functions provided by application programs are becoming increasingly rich. Correspondingly, in order for application programs to provide corresponding functions, programmers need to compile corresponding codes and reference corresponding resources to build corresponding resource libraries, etc. With the development of application programs, the resource dependency relationships corresponding to the programs are becoming increasingly complex. When it is necessary to maintain and update application programs, it is very cumbersome and troublesome for developers to analyze a large number of resource subordinate dependency relationships. In the related art, commands can be used to print out the dependency relationships corresponding to application programs, but it only presents the involved dependency relationships, and developers cannot understand the reference relationships between the dependency relationships from it, resulting in that maintenance and update still require compiling all the involved source codes, thus leading to low development efficiency of application programs due to long compilation time. Summary of the Invention
[0003] Embodiments of the present invention provide a method for processing application data, an apparatus, an electronic device, and a computer-readable storage medium, so as to solve or partially solve the problem in the related art that the resource dependency relationships of application programs cannot be classified and processed, resulting in low development and maintenance efficiency of programs.
[0004] Embodiments of the present invention disclose a method for processing application data, including:
[0005] Obtaining a resource reference set corresponding to each application function in an application program, where the resource reference set includes library information of a basic library referenced by the application function;
[0006] Obtaining resource dependency information of the application program, where the resource dependency information includes dependency nodes;
[0007] Generating a library reference relationship of the basic library by the application function and a function reference relationship of the basic library referenced by the application function in the application program according to the node categories of each dependency node, the reference relationships between the dependency nodes, and the library information of the basic library.
[0008] Optionally, the obtaining a resource reference set corresponding to each application function in an application program includes:
[0009] Obtaining a resource reference set corresponding to each application function in an application program from a preset server.
[0010] Optionally, the resource dependency is a resource dependency tree, and the obtaining of the resource dependency information of the application includes:
[0011] In response to a dependency output instruction, output a resource dependency file corresponding to the application;
[0012] Obtain a data structure identifier for the resource dependency file;
[0013] Convert the resource dependency file into a resource dependency tree corresponding to the application by using the data structure identifier.
[0014] Optionally, the library information includes a first base library identifier of the base library, the dependency node includes a function node corresponding to the application function and a resource node corresponding to the base library, and generating the library reference relationship of the application function to the base library and the function reference relationship of the base library being referenced by the application function according to the node categories of the respective dependency nodes, the reference relationships between the dependency nodes, and the library information of the base library includes:
[0015] Traverse the resource dependency tree to obtain the function identifier of each function node and a second base library identifier of the resource node referenced by the function node;
[0016] Extract, from the resource reference set corresponding to the function node, a first base library identifier that is the same as the second base library identifier of the resource node referenced by the function node as the target base library identifier;
[0017] Construct a library reference relationship between the application function corresponding to the function identifier and the base library corresponding to the target base library identifier by using the function identifier of the function node and the target base library identifier;
[0018] Construct a function reference relationship between the base library corresponding to the resource node and the function node corresponding to the function identifier by using the target base library identifier and the function identifier of the function node that references the resource node corresponding to the target base library identifier.
[0019] Optionally, the constructing a library reference relationship between the application function corresponding to the function identifier and the base library corresponding to the target base library identifier by using the function identifier of the function node and the target base library identifier includes:
[0020] Obtain a first version number corresponding to the target base library identifier;
[0021] Construct a library reference relationship between the application function corresponding to the function identifier and the base library corresponding to the target base library identifier by using the function identifier of the function node, the target base library identifier, and the second version number.
[0022] Optionally, constructing the function reference relationship between the base library corresponding to the resource node and the function node corresponding to the function node that uses the target base library identifier and references the resource node corresponding to the target base library identifier includes:
[0023] Obtain the second version number corresponding to the function identifier;
[0024] Construct the function reference relationship between the base library corresponding to the resource node and the function node corresponding to the function node that uses the target base library identifier and references the resource node corresponding to the target base library identifier by using the target base library identifier, the function identifier of the function node that references the resource node corresponding to the target base library identifier, and the second version number.
[0025] Optionally, the application function includes an application service function, an application component function, and an application extension function, and the function node includes a service function node corresponding to the application service function, a component function node corresponding to the application component function, and an extension function node corresponding to the application extension function.
[0026] An embodiment of the present invention also discloses a processing device for application data, including:
[0027] A resource reference set acquisition module, configured to acquire a resource reference set corresponding to each application function in the application program, where the resource reference set includes library information of the base library referenced by the application function;
[0028] A resource dependency information acquisition module, configured to acquire the resource dependency information of the application program, where the resource dependency information includes dependency nodes;
[0029] A reference relationship generation module, configured to generate a library reference relationship of the application function to the base library and a function reference relationship of the base library being referenced by the application function in the application program according to the node category of each dependency node, the reference relationship between the dependency nodes, and the library information of the base library.
[0030] Optionally, the resource reference set acquisition module is specifically configured to:
[0031] Acquire the resource reference set corresponding to each application function in the application program from a preset server.
[0032] Optionally, the resource dependency information acquisition module is specifically configured to:
[0033] Respond to a dependency output instruction, and output a resource dependency file corresponding to the application program;
[0034] Acquire a data structure identifier for the resource dependency file;
[0035] Using the data structure identification, convert the resource dependency file into a resource dependency tree corresponding to the application program.
[0036] Optionally, the library information includes the first basic library identification of the basic library, the dependency node includes a function node corresponding to the application function and a resource node corresponding to the basic library, and the reference relationship generation module includes:
[0037] A dependency tree traversal sub-module for traversing the resource dependency tree to obtain the function identification of each function node and the second basic library identification of the resource node referenced by the function node;
[0038] A basic library identification determination sub-module for extracting, from the resource reference set corresponding to the function node, the first basic library identification that is the same as the second basic library identification of the resource node referenced by the function node as the target basic library identification;
[0039] A library reference relationship generation sub-module for constructing a library reference relationship between the application function corresponding to the function identification and the basic library corresponding to the target basic library identification by using the function identification of the function node and the target basic library identification;
[0040] A function reference relationship generation sub-module for constructing a function reference relationship between the basic library corresponding to the resource node and the function node corresponding to the function identification by using the target basic library identification and the function identification of the function node that references the resource node corresponding to the target basic library identification.
[0041] Optionally, the library reference relationship generation sub-module is specifically configured to:
[0042] Obtain the first version number corresponding to the target basic library identification;
[0043] Construct a library reference relationship between the application function corresponding to the function identification and the basic library corresponding to the target basic library identification by using the function identification of the function node, the target basic library identification, and the second version number.
[0044] Optionally, the function reference relationship generation sub-module is specifically configured to:
[0045] Obtain the second version number corresponding to the function identification;
[0046] Construct a function reference relationship between the basic library corresponding to the resource node and the function node corresponding to the function identification by using the target basic library identification, the function identification of the function node that references the resource node corresponding to the target basic library identification, and the second version number.
[0047] Optionally, the application functions include application service functions, application component functions, and application extension functions, and the function nodes include service function nodes corresponding to the application service functions, component function nodes corresponding to the application component functions, and extension function nodes corresponding to the application extension functions.
[0048] An embodiment of the present invention also discloses an electronic device, including a processor, a communication interface, a memory, and a communication bus. Among them, the processor, the communication interface, and the memory complete communication with each other through the communication bus;
[0049] The memory is used to store a computer program;
[0050] When the processor is used to execute the program stored on the memory, it implements the method as described in the embodiment of the present invention.
[0051] An embodiment of the present invention also discloses a computer-readable storage medium, on which instructions are stored. When executed by one or more processors, the instructions cause the processors to execute the method as described in the embodiment of the present invention.
[0052] The embodiments of the present invention have the following advantages:
[0053] In the embodiment of the present invention, for the resource dependency relationship of an application program, the resource reference sets corresponding to each application function in the application program can be obtained. The resource reference set can include the library information of the basic libraries referenced by the application function. Then, the resource dependency information of the application program can be obtained. The resource dependency information can include dependency nodes. Then, according to the node categories of each dependency node, the reference relationships between the dependency nodes, and the library information of the basic libraries, the library reference relationships of the application functions to the basic libraries in the application program, and the function reference relationships of the basic libraries being referenced by the application functions can be generated. For the library reference relationships, it can include which basic libraries are referenced by the application functions. For the function reference relationships, it can be which application functions reference the basic libraries. Thus, by classifying the library information of the basic libraries in the resource reference set through the node categories and reference relationships of the dependency nodes in the resource dependency information, the reference relationships of the application functions to the basic libraries, and the reference relationships of the basic libraries being referenced by the application functions are obtained, effectively classifying the resource dependency relationship of the application program, enabling developers to intuitively and quickly understand which application function references the basic library, and which basic libraries are referenced by the application functions, realizing the effective classification of the resource dependency relationship, improving the search efficiency, and further improving the maintenance efficiency of the application program. Description of the Drawings
[0054] Figure 1 It is a flowchart of the steps of a method for processing application data provided in an embodiment of the present invention;
[0055] Figure 2 It is a structural block diagram of a processing device for application data provided in an embodiment of the present invention;
[0056] Figure 3 It is a block diagram of an electronic device provided in an embodiment of the present invention;
[0057] Figure 4 It is a schematic diagram of a computer-readable medium provided in an embodiment of the present invention. Detailed implementation manners
[0058] To make the above objects, features, and advantages of the present invention more obvious and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific implementation manners.
[0059] With the development of software technology, the application functions that application programs can provide are becoming more and more abundant. Relatively speaking, in order for application programs to provide corresponding functions, programmers need to compile corresponding codes and reference corresponding resources to build corresponding resource libraries, etc. As the application programs are developed, the resource dependency relationships corresponding to the programs are becoming more and more complex. When it is necessary to maintain and update the application programs, it is very cumbersome and troublesome for developers to analyze a large number of resource subordination dependency relationships.
[0060] As an example, for an application program that provides an aggregation function, it can provide different application functions for users. For the development of application programs, it is impossible for a single development team to maintain and update all the functions of the application program. In this regard, it may be that one development team is responsible for one function of the application program. For example, in a certain application program, it can provide different application functions such as job hunting, part-time jobs, renting houses, second-hand houses, second-hand items, second-hand cars, local services, housekeeping, new houses, and office buildings. Then, one or more development teams can be responsible for the development and maintenance of one or more of these application functions. Since an application program may be developed by multiple development teams working together, the dependency relationship between the application functions and the basic library of the application program will inevitably be very complex. As a result, when it is necessary to maintain and update a certain function of the application program, it is easy to have problems such as the inability to classify and process the resource dependency relationship of the application program, resulting in low efficiency in program development and maintenance.
[0061] In this regard, one of the core inventive points of the embodiments of the present invention lies in that for the resource dependency relationship of an application, by obtaining the resource reference set corresponding to each application function in the application, the resource reference set may include the library information of the basic libraries referred to by the application function. Then, the resource dependency information of the application can be obtained, and the resource dependency information may include dependency nodes. Then, according to the node categories of each dependency node, the reference relationship between the dependency nodes, and the library information of the basic libraries, the library reference relationship of the application function to the basic libraries in the application and the function reference relationship of the basic libraries being referred to by the application function can be generated. For the library reference relationship, it may include which basic libraries are referred to by the application function. For the function reference relationship, it may be which application functions refer to the basic libraries. Thus, by classifying the library information of the basic libraries in the resource reference set according to the node categories and reference relationships of the dependency nodes in the resource dependency information, the reference relationship of the application function to the basic libraries and the reference relationship of the basic libraries being referred to by the application function are obtained, effectively classifying the resource dependency relationship of the application, enabling developers to intuitively and quickly understand which application function refers to the basic library and which basic libraries are referred to by the application function, realizing the effective classification of the resource dependency relationship, improving the search efficiency, and further improving the maintenance efficiency of the application.
[0062] To enable those skilled in the art to better understand the technical solutions of the embodiments of the present invention, some technical names involved in the embodiments of the present invention will be explained and described below.
[0063] An application function can be a function provided by an application for users, and can include an application service function, an application component function, and an application extension function. Among them, the application service function can be the function at the application layer provided by the application, the application component function can provide component support and underlying implementation for the application layer functions of the application, and the application extension function can be the function of the application linking to other applications. For example, in a certain application, its home page can provide application service functions such as job hunting, part-time jobs, renting houses, second-hand houses, second-hand items, second-hand cars, local services, housekeeping, new houses, and office buildings. Specifically, in the application service function of "job hunting", code implementation, account login, information modification, etc. can be used as application component functions, and at the same time, the "job hunting" linked advertising content can be used as an application extension function, etc. The present invention does not limit this.
[0064] A basic library can be a function that encapsulates various functions. When developers write a new program, they do not need to re-develop the relevant functions and can directly use the corresponding functions by reference.
[0065] Specifically, referring to Figure 1 , a step flowchart of a method for processing application data provided in the embodiments of the present invention is shown, and specifically may include the following steps:
[0066] Step 101: Obtain the resource reference sets corresponding to each application function in the application. The resource reference sets include the library information of the basic libraries referenced by the application function.
[0067] In a specific implementation, for an application, developers can store the resource reference information corresponding to the application in a server. When maintenance or update is required, the corresponding resource reference information can be obtained from the server and edited, thereby avoiding traversing local file information, reducing the amount of data processing. At the same time, storing in the server can avoid modifying local data content when modifying reference information, improving the flexibility of data processing.
[0068] Specifically, when it is necessary to count the reference relationships between each application function of the application and the basic libraries, the resource reference sets corresponding to each application function in the application can be obtained from the server. The resource reference sets can include the library information of the basic libraries referenced by the application function. Among them, the library information can include the basic library identifier of the basic library and the version number of the basic library, etc.
[0069] For example, for an application, it can include an application service function, an application component function, and an application extension function, etc. Then the resource reference sets can include a service resource reference set corresponding to the application service function, a component resource reference set corresponding to the application component function, and an extension resource set corresponding to the application extension function, etc.
[0070] Step 102: Obtain the resource dependency information of the application. The resource dependency information includes dependency nodes.
[0071] After obtaining the resource reference sets corresponding to each application function in the application, the resource dependency information of the application can be output by running the corresponding command. The resource dependency information can be the dependency information between all application functions in the application and the basic libraries. For the resource dependency information, it can be presented in a certain structure. And in the resource dependency information, although developers can obtain the dependency information of the application, they cannot determine the reference relationship between the application function and the basic library, and which application functions reference the basic library.
[0072] In a specific implementation, for an application, by responding to a dependency output instruction, a resource dependency file corresponding to the application can be output. Then, the data structure identifier for the resource dependency file is obtained, and then the resource dependency file is converted into a resource dependency tree corresponding to the application using the data structure identifier. Among them, the dependency output instruction can be an instruction for outputting the application dependency relationship, such as a Gradle instruction, etc.; the resource dependency file can be a local file for storing the resource dependency relationship, which can be in the txt file format; the data structure identifier can be an identifier for marking the resource dependency file as a certain data structure, such as B-, B+ and other data structures. For example, by constructing a corresponding plug-in, and then through the Java program running instruction in the plug-in, the resource dependency relationship of the application is obtained and stored in the local file Gradle_tree.txt. Then, the Gradle_tree.txt file is marked with a B+ tree to obtain the resource dependency tree of the application.
[0073] For the resource dependency tree, it can include dependency nodes. Different types of nodes represent different levels. Specifically, the dependency nodes can include function nodes corresponding to application functions and resource nodes corresponding to basic libraries. Under one function node, multiple resource nodes can be referenced, and under one resource node, multiple resource nodes can be referenced. Thus, through the reference level relationship between function nodes and resource nodes in the application, a resource dependency tree corresponding to the application can be constructed.
[0074] Optionally, for the resource dependency tree, each line represents a node, and the number of prefix characters '|' in each line can represent the reference depth. When the character '+' is encountered, it means there are subsequent sibling references. When the character '\' is encountered, it means the reference at the current level ends. Thus, during the process of traversing the resource dependency tree, the reference relationship between adjacent two dependency nodes can be obtained through the corresponding characters, and then the classification of the application resource dependency relationship can be carried out according to the node type of the dependency nodes and the reference relationship between the dependency nodes, etc.
[0075] Step 103, generate the library reference relationship of the application function to the basic library and the function reference relationship of the basic library being referenced by the application function in the application according to the node types of the respective dependency nodes, the reference relationship between the dependency nodes, and the library information of the basic library.
[0076] In an embodiment of the present invention, a node (node) may be defined first, which is used to store reference names and version numbers. For example, in the node (node), the basic library identifier and version number of the basic library, the function identifier and version number of the application service function, etc. may be stored. And two type variables may be defined, including a library reference relationship and a function reference relationship. Among them, the library reference relationship may be used to save the corresponding relationship between the application function and the referenced basic library; the function application relationship may be used to save the corresponding relationship between the basic library and the referenced application function. For the former, it may include which basic libraries the application function references. For the function reference relationship, the latter may be which application functions the basic library is referenced by.
[0077] In a specific implementation, the library information may include the first basic library identifier of the basic library, and each resource node in the resource dependency tree may correspond to a second basic library identifier. Then, by traversing the resource dependency tree, the function identifier of each function node and the second basic library identifier of the resource node referenced by the function node may be obtained. Then, the first basic library identifier that is the same as the second basic library identifier of the resource node referenced by the function node is extracted from the resource reference set corresponding to the function node as the target basic library identifier. Then, on the one hand, using the function identifier of the function node and the target basic library identifier, a library reference relationship between the application function corresponding to the function identifier and the basic library corresponding to the target basic library identifier is constructed. On the other hand, using the target basic library identifier and the function identifier of the function node that references the resource node corresponding to the target basic library identifier, a function reference relationship between the basic library corresponding to the resource node and the function corresponding to the function node is constructed.
[0078] Among them, the function node may include a function identifier for characterizing different application functions in the application program, and the resource node may include a second basic library identifier for characterizing a certain basic library referenced in the application program. Then, in traversing the resource dependency tree, for each function node, all the resource nodes referenced by the function node can be obtained, and the resource nodes at different reference levels are all processed at the same level to obtain all the resource nodes referenced by the function node. Then, the second basic identifier of the resource node is obtained, and the second basic library identifier is compared with the first basic library identifier of the basic library in the resource reference set of the application function corresponding to the function node obtained from the server to determine whether the basic library is referenced by the function node. For example, taking the application function of "finding a job" as an example, in the resource reference set, there are the basic library identifier A of basic library ①, the basic library identifier B of basic library ②, the basic library identifier C of basic library ③, etc. After traversing the resource dependency tree, it can be obtained that the resource nodes referenced by the function node of "finding a job" include the corresponding nodes of basic library ①, basic library ②, and basic library ③, etc. Then, the basic library identifier a of basic library ①, the basic library identifier b of basic library ②, and the basic library identifier c of basic library ③ can be obtained, and then the comparison of the basic library identifiers is carried out. Thus, it can be known that basic library ①, basic library ②, and basic library ③ are indeed referenced by the application function of "finding a job", and it can be determined that the application function of "finding a job" references a total of three basic libraries, namely basic library ①, basic library ②, and basic library ③. Then, the library reference relationship between "finding a job" and the referenced basic libraries can be:
[0079] Finding a job:
[0080] Basic library ①
[0081] Basic library ②
[0082] Basic library ③
[0083] Through the above process, the library reference relationship between the application function and all the referenced basic libraries can be determined and written into the corresponding type variables for storage. The specific library reference relationship can be:
[0084] Application service function:
[0085] Basic library;
[0086] Basic library;
[0087] Basic library;
[0088] ……
[0089] Application component function:
[0090] Basic library;
[0091] Basic library;
[0092] Basic library;
[0093] ……
[0094] Application extension functions:
[0095] Basic library;
[0096] Basic library;
[0097] Basic library;
[0098] ……
[0099] Through the reference relationship between the above application functions and the basic library, developers can intuitively and quickly find the basic library referenced by each application function from the library reference relationship. During the development, maintenance, etc. processes, the quick positioning of the basic library can be achieved, effectively reducing the search time and improving the efficiency of application program development and maintenance.
[0100] In addition, during the process of traversing the resource dependency tree, in addition to obtaining the correspondence between the function nodes and the referenced resource nodes, it is also possible to perform "reverse inference" with the resource nodes as keys and the function nodes as values to obtain which function nodes reference the resource nodes, and then determine the function reference relationship between the basic library corresponding to the resource node and the function reference corresponding to the function node. For example, for basic library ①, by traversing the resource dependency tree, it can be obtained that it is referenced by application functions such as "finding a job", "part-time job", and "renting a house". Then the function reference relationship between basic library ① and "finding a job", "part-time job", "renting a house", etc. can be:
[0101] Basic library ①:
[0102] Finding a job
[0103] Part-time job
[0104] Renting a house
[0105] At the same time, by combining the node types of the function nodes that reference the basic library (service function nodes corresponding to application service functions, component function nodes corresponding to application component functions, extension function nodes corresponding to application extension functions, etc.), the function reference relationship between the basic library and all the referenced application functions can be determined and written into the corresponding type variables for storage. The specific function reference relationship can be:
[0106] Application service functions:
[0107] Basic library;
[0108] Specific service function
[0109] Specific service function
[0110] Specific service function
[0111] Application component functions:
[0112] Basic library;
[0113] Specific component functions
[0114] Specific component functions
[0115] Specific component functions
[0116] Application extension functions:
[0117] Basic library;
[0118] Specific extension functions
[0119] Specific extension functions
[0120] Specific extension functions
[0121] Through the reference relationship between the above application functions and the basic library, developers can intuitively and quickly find the application functions that each basic library is referenced from the library reference relationship. During the development, maintenance, etc. processes, the quick positioning of the basic library can be achieved, effectively reducing the search time and improving the efficiency of application development and maintenance.
[0122] In one example, for the library reference relationship and the function reference relationship, the corresponding version numbers can be stored in the nodes. Specifically, the first version number corresponding to the target basic library identifier can be obtained, and then, using the function identifier of the function node, as well as the target basic library identifier and the second version number, the library reference relationship between the application function corresponding to the function identifier and the basic library corresponding to the target basic library identifier is constructed, and the second version number corresponding to the function identifier is obtained. Then, using the target basic library identifier and the function identifier and the second version number of the function node that references the resource node corresponding to the target basic library identifier, the function reference relationship between the basic library corresponding to the resource node and the function node is constructed. Then, for the library reference relationship, it can be:
[0123] Application service functions:
[0124] Basic library + version number;
[0125] Basic library + version number;
[0126] Basic library + version number;
[0127] ……
[0128] Application component functions:
[0129] Basic library + version number;
[0130] Basic library + version number;
[0131] Basic library + version number;
[0132] ……
[0133] Application extension function:
[0134] Base library + version number;
[0135] Base library + version number;
[0136] Base library + version number;
[0137] ……
[0138] For the function reference relationship, it can be:
[0139] Application service function:
[0140] Base library;
[0141] Specific service function + version number
[0142] Specific service function + version number
[0143] Specific service function + version number
[0144] Application component function:
[0145] Base library;
[0146] Specific service function + version number
[0147] Specific service function + version number
[0148] Specific service function + version number
[0149] Application extension function:
[0150] Base library;
[0151] Specific service function + version number
[0152] Specific service function + version number
[0153] Specific service function + version number
[0154] In the above process, through the node category and reference relationship of the dependent nodes in the resource dependency information, the library information of the base library in the resource reference set is classified, obtaining the reference relationship of the application function to the base library and the reference relationship of the base library being referenced by the application function, effectively classifying the resource dependency relationship of the application program, enabling developers to intuitively and quickly understand which application function references the base library and which base libraries the application function references, realizing the effective classification of the resource dependency relationship, improving the search efficiency, and thus improving the maintenance efficiency of the application program.
[0155] It should be noted that the embodiments of the present invention include but are not limited to the above examples. It can be understood that under the guidance of the idea of the embodiments of the present invention, those skilled in the art can also make settings according to actual needs, and the present invention does not limit this.
[0156] In the embodiments of the present invention, for the resource dependency relationship of an application program, the resource reference sets corresponding to each application function in the application program can be obtained. The resource reference set can include the library information of the basic libraries referenced by the application function. Then, the resource dependency information of the application program can be obtained. The resource dependency information can include dependency nodes. Then, according to the node categories of each dependency node, the reference relationship between the dependency nodes, and the library information of the basic libraries, the library reference relationship of the application function to the basic libraries in the application program, and the function reference relationship of the basic libraries being referenced by the application function can be generated. For the library reference relationship, it can include which basic libraries are referenced by the application function. For the function reference relationship, it can be which application functions reference the basic libraries. Thus, by classifying the library information of the basic libraries in the resource reference set through the node categories and reference relationships of the dependency nodes in the resource dependency information, the reference relationship of the application function to the basic libraries and the reference relationship of the basic libraries being referenced by the application function are obtained, effectively classifying the resource dependency relationship of the application program, enabling developers to intuitively and quickly understand which application function references the basic library and which basic libraries are referenced by the application function, realizing the effective classification of the resource dependency relationship, improving the search efficiency, and further improving the maintenance efficiency of the application program.
[0157] It should be noted that for the method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the embodiments of the present invention are not limited by the described action sequence, because according to the embodiments of the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily essential for the embodiments of the present invention.
[0158] Referring to Figure 2 , a structural block diagram of a processing device for application data provided in the embodiments of the present invention is shown, which may specifically include the following modules:
[0159] A resource reference set acquisition module 201, configured to acquire resource reference sets corresponding to each application function in the application program, where the resource reference set includes the library information of the basic libraries referenced by the application function;
[0160] A resource dependency information acquisition module 202, configured to acquire the resource dependency information of the application program, where the resource dependency information includes dependency nodes;
[0161] A reference relationship generation module 203, configured to generate a library reference relationship of the application functions in the application program to the basic library and a function reference relationship of the basic library being referenced by the application functions according to the node categories of the respective dependency nodes, the reference relationships between the dependency nodes, and the library information of the basic library.
[0162] In an alternative embodiment, the resource reference set acquisition module 201 is specifically configured to:
[0163] Obtain the resource reference sets corresponding to the respective application functions in the application program from a preset server.
[0164] In an alternative embodiment, the resource dependency information acquisition module 202 is specifically configured to:
[0165] In response to a dependency output instruction, output a resource dependency file corresponding to the application program;
[0166] Obtain a data structure identifier for the resource dependency file;
[0167] Convert the resource dependency file into a resource dependency tree corresponding to the application program by using the data structure identifier.
[0168] In an alternative embodiment, the library information includes a first basic library identifier of the basic library, the dependency nodes include function nodes corresponding to the application functions and resource nodes corresponding to the basic library, and the reference relationship generation module 203 includes:
[0169] A dependency tree traversal sub-module, configured to traverse the resource dependency tree, obtain the function identifiers of the respective function nodes, and the second basic library identifiers of the resource nodes referenced by the function nodes;
[0170] A basic library identifier determination sub-module, configured to extract, from the resource reference set corresponding to the function node, a first basic library identifier that is the same as the second basic library identifier of the resource node referenced by the function node as a target basic library identifier;
[0171] A library reference relationship generation sub-module, configured to construct a library reference relationship between the application function corresponding to the function identifier and the basic library corresponding to the target basic library identifier by using the function identifier of the function node and the target basic library identifier;
[0172] A function reference relationship generation sub-module, configured to construct a function reference relationship between the basic library corresponding to the resource node and the function node corresponding to the function identifier by using the target basic library identifier and the function identifier of the function node that references the resource node corresponding to the target basic library identifier.
[0173] In an alternative embodiment, the library reference relationship generation sub-module is specifically configured to:
[0174] Obtain the first version number corresponding to the target base library identifier;
[0175] Construct a library reference relationship between the application function corresponding to the function identifier and the base library corresponding to the target base library identifier by using the function identifier of the function node, the target base library identifier, and the second version number.
[0176] In an alternative embodiment, the function reference relationship generation sub-module is specifically configured to:
[0177] Obtain the second version number corresponding to the function identifier;
[0178] Construct a function reference relationship between the base library corresponding to the resource node and the function node corresponding to the function node by using the target base library identifier, the function identifier of the function node that references the resource node corresponding to the target base library identifier, and the second version number.
[0179] In an alternative embodiment, the application function includes an application service function, an application component function, and an application extension function, and the function node includes a service function node corresponding to the application service function, a component function node corresponding to the application component function, and an extension function node corresponding to the application extension function.
[0180] For the apparatus embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for the relevant parts, please refer to the partial description of the method embodiment.
[0181] In addition, an embodiment of the present invention further provides an electronic device, as Figure 3 shown, including a processor 301, a communication interface 302, a memory 303, and a communication bus 304. Among them, the processor 301, the communication interface 302, and the memory 303 communicate with each other through the communication bus 304.
[0182] The memory 303 is used to store a computer program;
[0183] When the processor 301 is used to execute the program stored in the memory 303, the following steps are implemented:
[0184] Obtain a resource reference set corresponding to each application function in the application program, where the resource reference set includes library information of the base library referenced by the application function;
[0185] Obtain the resource dependency information of the application program, where the resource dependency information includes dependency nodes;
[0186] Generate the library reference relationship of the application functions in the application program to the basic library and the function reference relationship of the basic library being referenced by the application functions according to the node categories of each of the dependent nodes, the reference relationships between the dependent nodes, and the library information of the basic library.
[0187] In an alternative embodiment, the obtaining the resource reference sets corresponding to the respective application functions in the application program includes:
[0188] Obtain the resource reference sets corresponding to the respective application functions in the application program from a preset server.
[0189] In an alternative embodiment, the resource dependency relationship is a resource dependency tree, and the obtaining the resource dependency information of the application program includes:
[0190] In response to a dependency output instruction, output a resource dependency file corresponding to the application program;
[0191] Obtain a data structure identifier for the resource dependency file;
[0192] Convert the resource dependency file into a resource dependency tree corresponding to the application program by using the data structure identifier.
[0193] In an alternative embodiment, the library information includes a first basic library identifier of the basic library, the dependent nodes include function nodes corresponding to the application functions and resource nodes corresponding to the basic library, and the generating the library reference relationship of the application functions in the application program to the basic library and the function reference relationship of the basic library being referenced by the application functions according to the node categories of each of the dependent nodes, the reference relationships between the dependent nodes, and the library information of the basic library includes:
[0194] Traverse the resource dependency tree to obtain the function identifiers of each of the function nodes and the second basic library identifiers of the resource nodes referenced by the function nodes;
[0195] Extract, from the resource reference set corresponding to the function node, the first basic library identifier that is the same as the second basic library identifier of the resource node referenced by the function node as the target basic library identifier;
[0196] Construct a library reference relationship between the application function corresponding to the function identifier and the basic library corresponding to the target basic library identifier by using the function identifier of the function node and the target basic library identifier;
[0197] Construct a function reference relationship between the basic library corresponding to the resource node and the function node corresponding to the function identifier by using the target basic library identifier and the function identifier of the function node that references the resource node corresponding to the target basic library identifier.
[0198] In an alternative embodiment, constructing a library reference relationship between the application function corresponding to the function identifier and the base library corresponding to the target base library identifier by using the function identifier of the function node and the target base library identifier includes:
[0199] Obtaining a first version number corresponding to the target base library identifier;
[0200] Constructing a library reference relationship between the application function corresponding to the function identifier and the base library corresponding to the target base library identifier by using the function identifier of the function node, the target base library identifier, and the second version number.
[0201] In an alternative embodiment, constructing a function reference relationship between the base library corresponding to the resource node and the function node corresponding to the function identifier by using the target base library identifier and the function identifier of the function node that references the resource node corresponding to the target base library identifier includes:
[0202] Obtaining a second version number corresponding to the function identifier;
[0203] Constructing a function reference relationship between the base library corresponding to the resource node and the function node corresponding to the function identifier by using the target base library identifier, the function identifier of the function node that references the resource node corresponding to the target base library identifier, and the second version number.
[0204] In an alternative embodiment, the application function includes an application service function, an application component function, and an application extension function, and the function node includes a service function node corresponding to the application service function, a component function node corresponding to the application component function, and an extension function node corresponding to the application extension function.
[0205] The communication bus mentioned in the above terminal may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of representation, only a thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0206] The communication interface is used for communication between the above terminal and other devices.
[0207] The memory may include a Random Access Memory (RAM), or may also include non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located far away from the aforementioned processor.
[0208] The aforementioned processor may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0209] As Figure 4 shown, in another embodiment provided by the present invention, there is also provided a computer-readable storage medium 401. Instructions are stored in the computer-readable storage medium. When it runs on a computer, it enables the computer to execute the method for processing application data described in the above embodiment.
[0210] In another embodiment provided by the present invention, there is also provided a computer program product containing instructions. When it runs on a computer, it enables the computer to execute the method for processing application data described in the above embodiment.
[0211] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present invention are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more integrated available media. The available medium can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (SSD)).
[0212] It should be noted that in this document, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including", or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or device. Without further limitation, an element defined by the statement "comprising a..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the element.
[0213] Each embodiment in this specification is described in a related manner. For the same or similar parts among the embodiments, reference can be made to each other. Each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and reference can be made to the relevant part of the method embodiment for the related content.
[0214] The above are only the preferred embodiments of the present invention and are not intended to limit the protection scope of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention are all included in the protection scope of the present invention.
Claims
1. A method for processing application data, characterized in that, Including: Obtain a resource reference set corresponding to each application function in the application, where the resource reference set includes library information of the basic libraries referenced by the application function; Obtain the resource dependency information of the application, where the resource dependency information includes dependency nodes; Generate a library reference relationship of the basic libraries by the application functions and a function reference relationship of the basic libraries being referenced by the application functions in the application according to the node categories of each of the dependency nodes, the reference relationships between the dependency nodes, and the library information of the basic libraries; the node categories include a resource node category and a function node category; the node categories are used to determine the function nodes and resource nodes in the dependency nodes.
2. The method according to claim 1, wherein The obtaining of the resource reference set corresponding to each application function in the application includes: Obtain the resource reference set corresponding to each application function in the application from a preset server.
3. The method according to claim 1, wherein The resource dependency information is a resource dependency tree, and the obtaining of the resource dependency information of the application includes: In response to a dependency output instruction, output a resource dependency file corresponding to the application; Obtain a data structure identifier for the resource dependency file; Convert the resource dependency file into a resource dependency tree corresponding to the application by using the data structure identifier.
4. The method according to claim 3, wherein The library information includes a first basic library identifier of the basic library, and the dependency nodes include function nodes corresponding to the application functions and resource nodes corresponding to the basic libraries. The generating of the library reference relationship of the basic libraries by the application functions and the function reference relationship of the basic libraries being referenced by the application functions in the application according to the node categories of each of the dependency nodes, the reference relationships between the dependency nodes, and the library information of the basic libraries includes: Traverse the resource dependency tree to obtain function identifiers of each of the function nodes and a second basic library identifier of the resource node referenced by the function node; Extract, from the resource reference set corresponding to the function node, a first basic library identifier that is the same as the second basic library identifier of the resource node referenced by the function node as a target basic library identifier; Construct a library reference relationship between the application function corresponding to the function identifier and the basic library corresponding to the target basic library identifier by using the function identifier of the function node and the target basic library identifier; Construct a function reference relationship between the basic library corresponding to the resource node and the function node corresponding to the function identifier by using the target basic library identifier and the function identifier of the function node that references the resource node corresponding to the target basic library identifier.
5. The method according to claim 4, wherein The constructing of the library reference relationship between the application function corresponding to the function identifier and the basic library corresponding to the target basic library identifier by using the function identifier of the function node and the target basic library identifier includes: Obtain a first version number corresponding to the target basic library identifier; Construct a library reference relationship between the application function corresponding to the function identifier and the basic library corresponding to the target basic library identifier by using the function identifier of the function node, and the target basic library identifier and the first version number.
6. The method according to claim 5, wherein Constructing a basic library corresponding to the resource node and a function reference relationship corresponding to the function node by using the target basic library identifier and a function identifier of a function node that references a resource node corresponding to the target basic library identifier includes: Obtaining a second version number corresponding to the function identifier; Constructing a basic library corresponding to the resource node and a function reference relationship corresponding to the function node by using the target basic library identifier, a function identifier of a function node that references a resource node corresponding to the target basic library identifier, and the second version number.
7. The method according to claim 4, wherein The application function includes an application service function, an application component function, and an application extension function. The function node includes a service function node corresponding to the application service function, a component function node corresponding to the application component function, and an extension function node corresponding to the application extension function.
8. A processing device for application data, characterized in that, It includes: A resource reference set acquisition module, configured to acquire a resource reference set corresponding to each application function in an application program, where the resource reference set includes library information of a basic library referenced by the application function; A resource dependency information acquisition module, configured to acquire resource dependency information of the application program, where the resource dependency information includes dependency nodes; A reference relationship generation module, configured to generate a library reference relationship of the basic library by the application function and a function reference relationship of the basic library being referenced by the application function in the application program according to a node category of each dependency node, a reference relationship between the dependency nodes, and the library information of the basic library; the node category includes a resource node category and a function node category; the node category is used to determine a function node and a resource node in the dependency nodes.
9. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus. Among them, the processor, the communication interface, and the memory complete communication with each other through the communication bus; The memory is used to store a computer program; When the processor is configured to execute the program stored in the memory, it implements the method according to any one of claims 1-7.
10. A computer-readable storage medium, on which instructions are stored. When executed by one or more processors, the instructions cause the processor to execute the method according to any one of claims 1-7.
Citation Information
Patent Citations
Generation display method and device of compilation dependency relation tree
CN105718296A
Dependence conflict processing method and device, equipment and storage medium
CN113778450A