Program processing method and apparatus
By generating a call relationship graph through parsing program call relationships, the problem of program modifications affecting multiple modules is solved, improving accuracy and efficiency, and facilitating business design and development.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-17
- Publication Date
- 2026-03-17
AI Technical Summary
In the financial sector, program modifications can easily affect multiple business function modules, leading to customer usage problems, and existing manual review methods are prone to overlooking certain aspects.
By acquiring program code resources, using regular expressions to parse the call relationships between programs, generating a program call relationship graph, and generating a program list based on business type.
This improves the accuracy and efficiency of program analysis, ensuring that program modifications do not affect other modules, and facilitates business design and development.
Smart Images

Figure CN114489783B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of program analysis technology and can be used in the financial field or other fields, particularly a program processing method and apparatus. Background Technology
[0002] Currently in the financial sector, with the enrichment and upgrading of online banking functions, there are more and more programs, and the calling relationships between these programs are becoming increasingly complex. Modifications to a single program may affect multiple business function modules. Relying solely on developers to manually analyze these changes can easily lead to omissions, resulting in disruptions to customer use after the program goes live. Summary of the Invention
[0003] In view of the problems existing in the prior art, the main objective of the embodiments of the present invention is to provide a program processing method and apparatus to improve the accuracy and efficiency of program sorting.
[0004] To achieve the above objectives, embodiments of the present invention provide a program processing method, the method comprising:
[0005] Obtain code resources from multiple programs, categorize the code resources, and determine the type corresponding to each program;
[0006] The code resources are parsed to obtain the mutual calling relationships between programs of the same type, as well as the direct calling relationships between programs of different types.
[0007] Based on the mutual call relationship and the direct call relationship, a program call relationship diagram is generated, and based on the preset business type and the program call relationship diagram, a program list corresponding to each business type is generated.
[0008] Optionally, in one embodiment of the present invention, the step of parsing the code resource to obtain the mutual calling relationship between programs of the same type includes:
[0009] Regular expressions are used to parse the code resources of programs of the same type, thereby obtaining the mutual calling relationships between programs of the same type.
[0010] Optionally, in one embodiment of the present invention, the step of parsing the code resource to obtain the direct calling relationship between various types of programs includes:
[0011] Regular expressions are used to parse the code resources of various types of programs to obtain the direct calling relationships between them.
[0012] Optionally, in one embodiment of the present invention, generating a program call relationship graph based on the mutual call relationship and the direct call relationship includes:
[0013] Using the mutual call relationships and the direct call relationships as edges, and each program as a node, construct the program call relationship graph.
[0014] Optionally, in one embodiment of the present invention, generating a program list corresponding to each business type based on a preset business type and the program call relationship diagram includes:
[0015] Based on the preset business types, determine the corresponding entry program for each business type;
[0016] Based on the entry program, reachability queries are performed in the program call relationship graph to generate a program list corresponding to each business type.
[0017] Optionally, in one embodiment of the present invention, the step of performing a reachability query in the program call relationship graph based on the entry program to generate a program list corresponding to each business type includes:
[0018] Based on the entry program, a reachability query is performed in the program call relationship graph to generate a program list corresponding to each business type.
[0019] Based on the program list, determine the basic data structure corresponding to each business type.
[0020] Optionally, in one embodiment of the present invention, generating a program list corresponding to each business type by performing a reachability query in the program call relationship graph according to the entry program includes: performing a reachability query in the program call relationship graph according to the entry program, and marking the queried points in the program call relationship graph as traversed, thereby obtaining a program list corresponding to each business type.
[0021] This invention also provides a program processing apparatus, the apparatus comprising:
[0022] The program classification module is used to acquire code resources of multiple programs, classify the code resources, and determine the type of each program.
[0023] The call relationship module is used to parse the code resources to obtain the mutual call relationships between programs of the same type, as well as the direct call relationships between programs of different types.
[0024] The program listing module is used to generate a program call relationship diagram based on the mutual call relationship and the direct call relationship, and to generate a program listing corresponding to each business type based on the preset business type and the program call relationship diagram.
[0025] Optionally, in one embodiment of the present invention, the call relationship module includes:
[0026] The mutual call unit is used to use regular expressions to parse the code resources of programs of the same type and obtain the mutual call relationship between programs of the same type.
[0027] The direct call unit is used to parse the code resources of various types of programs using regular expressions to obtain the direct call relationships between different types of programs.
[0028] Optionally, in one embodiment of the present invention, the program listing module is further configured to construct the program call relationship graph by using the mutual call relationship and the direct call relationship as edges and each program as a point.
[0029] Optionally, in one embodiment of the present invention, the program listing module includes:
[0030] The entry program unit is used to determine the entry program corresponding to each business type based on the preset business type.
[0031] The program listing unit is used to perform reachability queries in the program call relationship graph based on the entry program, and generate program listings corresponding to each business type.
[0032] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the above-described method.
[0033] The present invention also provides a computer-readable storage medium storing a computer program for performing the above-described method.
[0034] This invention automatically sorts out program code, analyzes the call relationships between programs, and obtains a program call relationship diagram, thereby quickly generating program lists corresponding to various business types. This improves the accuracy and efficiency of program code modification and optimization, and greatly facilitates business design and development. Attached Figure Description
[0035] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0036] Figure 1 This is a flowchart of a program processing method according to an embodiment of the present invention;
[0037] Figure 2 This is a flowchart illustrating the process of determining the calling relationship in an embodiment of the present invention;
[0038] Figure 3 This is a flowchart illustrating the generation of the program listing in an embodiment of the present invention;
[0039] Figure 4 This is a schematic diagram illustrating the various program types and their calling relationships in an embodiment of the present invention;
[0040] Figure 5 This is a schematic diagram of the program call relationship in an embodiment of the present invention;
[0041] Figure 6 This is a functional structure diagram of the application processing method system in an embodiment of the present invention;
[0042] Figure 7 This is a schematic diagram of the system architecture of the application processing method in an embodiment of the present invention;
[0043] Figure 8 This is a schematic diagram of the structure of a program processing device according to an embodiment of the present invention;
[0044] Figure 9 This is a schematic diagram of the calling relationship module in an embodiment of the present invention;
[0045] Figure 10 This is a schematic diagram of the structure of the program listing module in an embodiment of the present invention;
[0046] Figure 11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0047] This invention provides a program processing method and apparatus that can be used in the financial field and other fields. It should be noted that the program processing method and apparatus of this invention can be used in the financial field, or in any field other than the financial field. The application field of the program processing method and apparatus of this invention is not limited.
[0048] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0049] like Figure 1The diagram shows a flowchart of a program processing method according to an embodiment of the present invention. The execution subject of the program processing method provided in this embodiment includes, but is not limited to, a computer. The present invention automatically analyzes program code, parses the call relationships between programs, and obtains a program call relationship diagram, thereby quickly generating program lists corresponding to various business types. This improves the accuracy and efficiency of program code modification and optimization, and greatly facilitates business design and development. Specifically, the method shown in the diagram includes:
[0050] Step S1: Obtain code resources from multiple programs, classify the code resources, and determine the type of each program.
[0051] This process involves reading all program code resources (i.e., program code) from the enterprise workspace, categorizing these resources, extracting various types of code resources, and determining the type corresponding to each program. Specifically, program types include Java, JavaScript, and Object Pascal, among others.
[0052] Step S2: Perform code parsing on the code resources to obtain the mutual calling relationships between programs of the same type, as well as the direct calling relationships between programs of different types.
[0053] In this process, regular expressions are used to parse each type of code resource to obtain the mutual calling relationships between code resources and the direct calling relationships between code resources of this type to other types of resources.
[0054] Furthermore, the direct calling relationships between different types of programs are as follows: Figure 4 As shown in the diagram, the columns indicate business types, JSP and Java are different types of programs, and the connecting lines indicate the calling relationship.
[0055] Step S3: Generate a program call relationship diagram based on the mutual call relationship and the direct call relationship, and generate a program list corresponding to each business type based on the preset business type and the program call relationship diagram.
[0056] Direct call relationships and mutual call relationships can represent program call relationships at two levels, thus accurately determining the program call relationships. A program call relationship graph is constructed using direct call relationships and mutual call relationships as edges and program nodes, as shown below. Figure 5 As shown in the figure, Jsp_B, Op_1, etc. are program names, and the connecting lines between them represent the calling relationship.
[0057] Furthermore, Figure 5 In a program, the calling relationship between programs of the same type is a mutual calling relationship. For example, the calling relationship between Op_1, Op_2, and Op_3 is a mutual calling relationship between individual programs. Furthermore, Figure 5 The calling relationship between different types of programs in the text is a direct calling relationship, which is... Figure 4 As a result, Jsp_B and Op_1 are programs of different types, and the calling relationship between them is a direct calling relationship.
[0058] As an embodiment of the present invention, such as Figure 2 As shown, code parsing of code resources yields the mutual calling relationships between programs of the same type, as well as the direct calling relationships between programs of different types, including:
[0059] Step S21: Use regular expressions to parse the code resources of programs of the same type to obtain the mutual calling relationship between programs of the same type;
[0060] Step S22: Use regular expressions to parse the code resources of each type of program to obtain the direct calling relationship between each type of program.
[0061] In this process, regular expressions are used to parse each type of code resource to obtain the mutual calling relationships between code resources and the direct calling relationships between code resources of this type to other types of resources.
[0062] Furthermore, regular expressions are first used to parse the code resources of programs belonging to the same type, and then regular expressions are used to parse the code resources of programs of different types to obtain mutual call relationships and direct call relationships respectively.
[0063] Furthermore, during the code parsing process, regular expression technology is used to match references to other program resources during program calls, thereby obtaining the mutual call relationships and direct call relationships between programs.
[0064] As an embodiment of the present invention, generating a program call relationship graph based on mutual call relationships and direct call relationships includes: using mutual call relationships and direct call relationships as edges and each program as a point to construct a program call relationship graph.
[0065] In this model, program resources are used as nodes, and program call relationships are used as edges, including mutual call relationships and direct call relationships. This allows us to abstract a call relationship graph between programs, such as... Figure 5 As shown.
[0066] As an embodiment of the present invention, such as Figure 3 As shown, based on the preset business types and the program call relationship diagram, the program list corresponding to each business type is generated, including:
[0067] Step S31: Determine the entry program corresponding to each business type according to the preset business types;
[0068] Step S32: Based on the entry program, perform a reachability query in the program call relationship graph to generate a program list corresponding to each business type.
[0069] In this embodiment, generating a program list corresponding to each business type by performing a reachability query in the program call relationship graph based on the entry program includes: performing a reachability query in the program call relationship graph based on the entry program to generate a program list corresponding to each business type; and determining the basic data structure corresponding to each business type based on the program list. Specifically, this can be achieved from... Figure 5 As can be seen from the dotted lines, there is a "loop" in this call relationship, which corresponds exactly to the graph structure in computer science. It can serve as the basic data structure for program ledger organization.
[0070] In this embodiment, the process of generating a program list corresponding to each business type by performing a reachability query in the program call relationship graph based on the entry program includes: performing a reachability query in the program call relationship graph based on the entry program, marking the queried points in the program call relationship graph as traversed, and obtaining a program list corresponding to each business type.
[0071] This involves pre-setting different business types with corresponding column functions and column entry points, where the column entry point is the entry program. Reachability queries are performed in the program call relationship graph, specifically, as follows: Figure 4 As shown, the relevant types of programs are determined from the entry program corresponding to the business type, and then combined with, for example... Figure 5 The program call relationship diagram shown generates a program list corresponding to each business type.
[0072] Furthermore, during the process of finding reachable program resource nodes on the graph, loops may occur, causing repeated traversal of nodes and infinite loops. To avoid this problem, during the traversal process, a mark is made on the program node that has been reached, for example, marked as traversed. This marks the currently traversed section information, thereby obtaining the program list corresponding to each business type.
[0073] Furthermore, the program lists corresponding to each business type can be used for subsequent program development, optimization, and modification, thereby improving the accuracy and efficiency of program code modification and optimization, and greatly facilitating business design and development.
[0074] In a specific embodiment of the present invention, such as Figure 6The diagram shows the functional structure of the application processing method system in this embodiment of the invention. To retrieve the relationships between enterprise online banking code resources, and considering the large variety and quantity of code resources in the enterprise online banking workspace, an enterprise online banking code resource analysis and processing system was designed and implemented. This system takes the code resources in the enterprise online banking workspace as input, processes them, and outputs the inter-call relationships between code resources and a list of program resources related to each online banking section. Ultimately, these outputs can be used to assist developers and designers in analysis and decision-making.
[0075] In this embodiment, Figure 6 The system shown is mainly divided into three modules: a program resource extraction module, a call relationship parsing module, and a call relationship network construction module. The program resource extraction module is responsible for reading all code resources in the workspace and extracting various categories of code resources to prepare for further processing of different categories. The call relationship parsing module is responsible for parsing each category of code resources, obtaining the mutual calls between these code resources and the calls from this category of code resources to other categories of resources, and storing these direct call relationships in the database. The call relationship network construction module uses the direct call relationships between programs to construct a network structure for program resource calls. Starting with the entry program corresponding to the enterprise online banking section as the starting point, a query can retrieve all program code resources related to that section.
[0076] In this embodiment, as Figure 7 The architecture shown has many types of code resources in the enterprise online banking workspace, requiring separate processing for each type, resulting in complex functionalities. To improve system flexibility and maintainability, based on the "top-down, stepwise refinement" approach, the system adopts the following... Figure 7 The system architecture is structured from top to bottom, consisting of three layers: executors, modules, and processing units. Each analysis task is controlled by an executor, while the various sub-functional modules within the same analysis task are implemented by modules. Each module manages several processing units, and each processing unit is responsible for analyzing and processing the source files in the workspace. This three-layer architecture not only greatly simplifies system development and debugging, but also allows for configuration of the number and types of sub-modules managed by upper-level modules, significantly increasing the system's operational flexibility.
[0077] Based on the current state of online banking procedures, the types of programs in the online banking workspace and the calling relationships between them have been identified, such as... Figure 4As shown. Regarding these call relationships, the system scans the directory of the workspace to parse out the direct call relationships between various program calls. The parsing process primarily uses regular expressions to match references to other program resources during program calls. Furthermore, Figure 4 The `includeJSP` directive is for common JSP pages, `JSP` is for transaction JSP pages, `OP` is for transaction process configuration files, `ComponentID` is for Java common program identifiers, `DSR` is for host interfaces, and `Procedure` is for stored procedures.
[0078] Furthermore, by abstracting the obtained call relationships, using program resources as nodes (Vetexes) and program call relationships as edges (Edges), the call relationships between programs can be abstracted, such as... Figure 5 As shown. Specifically, it can be seen from... Figure 5 As can be seen from the dotted lines, there is a "loop" in this call relationship, which corresponds exactly to the graph structure in computer science. It can serve as the basic data structure for program ledger organization.
[0079] Furthermore, using the previous results, program resources are treated as nodes (Vetex), and program call relationships are treated as edges (Edge), to construct a program call relationship graph in memory.
[0080] Next, the process of organizing the program ledger related to a certain directory involves finding the corresponding entry node in the graph based on the entry program of the category. Then, starting from that node, a reachability query is performed on the graph to see which program resource nodes can be reached from that entry node. The program resources represented by all these reachable nodes constitute the list of all programs for the corresponding category.
[0081] Specifically, the entry point for the function Func1 corresponding to the business type is Op_1, using, for example... Figure 5 The program call diagram shown can be traced from node Op_1 to the program resource nodes Jsp_A, Jsp_F, and Jsp_E. This yields the resource ledger list related to Func1, as follows: Op_1, Jsp_A, Jsp_F, Jsp_E.
[0082] In this embodiment, during the process of finding reachable program resource nodes on the graph from the entry program node, loops may occur, causing repeated traversal of nodes and infinite loops. To avoid this problem, during the traversal, a mark is made on each reached program node to indicate the currently traversed category information. Thus, upon reaching each node, it is first checked whether the node contains a mark corresponding to the current category:
[0083] If so, it means that the node has already been traversed, so stop and traverse other nodes;
[0084] If not, it means that the node has not been traversed. The program it identifies is then used as the program of the category, and its child nodes are traversed.
[0085] Furthermore, following the preceding process, for each section of the online banking system, a reachability query is performed on the graph structure starting from the section's entry point to obtain all the programs represented by reachable nodes, forming the program list for that section. Finally, the relationships between sections and programs obtained from the preceding process are imported into a database for reference by developers and designers of other online banking systems. This includes nearly 40,000 source files and over 200,000 call relationships, providing strong support for developers and designers in making code-level decisions.
[0086] This invention greatly facilitates the design and development of enterprise online banking through a "program resource call relationship diagram": the "relationship network" makes it easy to identify the upstream and downstream resources affected by a change in a program resource, ensuring accurate and complete modifications; designers can also easily understand the workload differences between different solutions when designing and optimizing code through the "relationship network"; in addition, all program resources under the category menu can be accessed through the category menu entry point for design and development reference.
[0087] like Figure 8 The figure shows a schematic diagram of a program processing device according to an embodiment of the present invention. The device shown in the figure includes:
[0088] The program classification module 10 is used to acquire code resources from multiple programs, classify the code resources, and determine the type of each program.
[0089] This process involves reading the code resources of all programs from the enterprise workspace, categorizing these resources (extracting code resources into various categories to determine the type of each program), and specifically, identifying program types such as Java.
[0090] The call relationship module 20 is used to parse the code resources to obtain the mutual call relationship between programs of the same type, as well as the direct call relationship between programs of different types.
[0091] In this process, regular expressions are used to parse each type of code resource to obtain the mutual calling relationships between code resources and the direct calling relationships between code resources of this type to other types of resources.
[0092] The program listing module 30 is used to generate a program call relationship diagram based on the mutual call relationship and the direct call relationship, and to generate a program listing corresponding to each business type based on the preset business type and the program call relationship diagram.
[0093] Direct call relationships and mutual call relationships can represent program call relationships at two levels, thus accurately determining the program call relationships. A program call relationship graph is constructed using direct call relationships and mutual call relationships as edges and program segments as nodes.
[0094] As an embodiment of the present invention, such as Figure 9 As shown, the calling relationship module 20 includes:
[0095] The mutual calling unit 21 is used to use regular expressions to parse the code resources of programs of the same type and obtain the mutual calling relationship between programs of the same type.
[0096] Direct call unit 22 is used to parse the code resources of various types of programs using regular expressions to obtain the direct call relationship between various types of programs.
[0097] As an embodiment of the present invention, the program listing module 30 is also used to construct a program call relationship graph by taking mutual call relationships and direct call relationships as edges and each program as a point.
[0098] As an embodiment of the present invention, such as Figure 10 As shown, the program listing module 30 includes:
[0099] Entry program unit 31 is used to determine the entry program corresponding to each business type according to the preset business type;
[0100] Program listing unit 32 is used to perform reachability queries in the program call relationship graph based on the entry program, and generate program listings corresponding to each business type.
[0101] Based on the same concept as the aforementioned program processing method, this invention also provides a program processing apparatus. Since the principle by which this program processing apparatus solves the problem is similar to that of the program processing method, the implementation of this program processing apparatus can refer to the implementation of the program processing method, and repeated details will not be elaborated further.
[0102] This invention automatically analyzes program code and parses the call relationships between programs to obtain a program call relationship diagram, enabling the rapid generation of program lists corresponding to various business types. This improves the accuracy and efficiency of program code modification and optimization, and greatly facilitates business design and development.
[0103] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the above-described method.
[0104] The present invention also provides a computer-readable storage medium storing a computer program for performing the above-described method.
[0105] like Figure 11 As shown, the electronic device 600 may also include: a communication module 110, an input unit 120, an audio processing unit 130, a display 160, and a power supply 170. It is worth noting that the electronic device 600 does not necessarily need to include these components. Figure 11 All components shown; in addition, the electronic device 600 may also include Figure 11 For components not shown, please refer to existing technologies.
[0106] like Figure 11 As shown, the central processing unit 100, sometimes also referred to as a controller or operating control, may include a microprocessor or other processor device and / or logic device. The central processing unit 100 receives inputs and controls the operation of various components of the electronic device 600.
[0107] The memory 140 may be, for example, one or more of a cache, flash memory, hard drive, removable media, volatile memory, non-volatile memory, or other suitable devices. It may store the aforementioned failure-related information, and also store a program for executing that information. The central processing unit 100 may execute the program stored in the memory 140 to perform information storage or processing, etc.
[0108] Input unit 120 provides input to central processing unit 100. Input unit 120 may be, for example, a keypad or touch input device. Power supply 170 provides power to electronic device 600. Display 160 displays images and text. Display may be, for example, an LCD display, but is not limited thereto.
[0109] The memory 140 can be a solid-state memory, such as a read-only memory (ROM), random access memory (RAM), a SIM card, etc. It can also be a memory that retains information even when power is off, can be selectively erased, and contains more data; examples of this type of memory are sometimes referred to as EPROMs. The memory 140 can also be some other type of device. The memory 140 includes a buffer memory 141 (sometimes referred to as a buffer). The memory 140 may include an application / function storage unit 142 for storing application programs and function programs or processes for executing the operation of the electronic device 600 via the central processing unit 100.
[0110] The memory 140 may also include a data storage unit 143 for storing data, such as contacts, digital data, pictures, sounds, and / or any other data used by the electronic device. The driver storage unit 144 of the memory 140 may include various drivers for the electronic device's communication functions and / or for performing other functions of the electronic device (such as messaging applications, address book applications, etc.).
[0111] The communication module 110 is a transmitter / receiver 110 that transmits and receives signals via antenna 111. The communication module (transmitter / receiver) 110 is coupled to the central processing unit 100 to provide input signals and receive output signals, which can be the same as in a conventional mobile communication terminal.
[0112] Based on different communication technologies, multiple communication modules 110 can be configured in the same electronic device, such as cellular network modules, Bluetooth modules, and / or wireless LAN modules. The communication module (transmitter / receiver) 110 is also coupled to a speaker 131 and a microphone 132 via an audio processor 130 to provide audio output via the speaker 131 and receive audio input from the microphone 132, thereby enabling typical telecommunications functions. The audio processor 130 may include any suitable buffer, decoder, amplifier, etc. Additionally, the audio processor 130 is coupled to a central processing unit 100, enabling on-device recording via the microphone 132 and on-device playback of stored audio via the speaker 131.
[0113] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0114] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0115] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0116] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0117] Specific embodiments have been used to illustrate the principles and implementation methods of this invention. The descriptions of the embodiments above are only for the purpose of helping to understand the method and core ideas of this invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this invention. Therefore, the content of this specification should not be construed as a limitation of this invention.
Claims
1. A program processing method characterized by comprising: The method comprises: acquiring code resources of a plurality of programs, and classifying the code resources to determine types corresponding to the programs; performing code analysis on the code resources to obtain mutual calling relations between programs of the same type and direct calling relations between programs of different types, wherein the code analysis comprises: performing code analysis on the code resources of programs of different types by using regular expressions to obtain the direct calling relations between programs of different types; generating a program calling relation graph according to the mutual calling relations and the direct calling relations, and generating program lists corresponding to different business types according to preset business types and the program calling relation graph, wherein different business types have corresponding column functions and column entrances; wherein the generation of the program lists corresponding to different business types according to the preset business types and the program calling relation graph comprises: determining entrance programs corresponding to different business types according to the preset business types; performing reachability query in the program calling relation graph according to the entrance programs to generate the program lists corresponding to different business types; wherein the reachability query comprises: when reaching a node, first determining whether the node contains a mark corresponding to a current column; if yes, stopping and traversing other nodes; if no, marking a program in the node as a program of the column, and continuing to traverse child nodes of the program.
2. The method of claim 1, wherein, The code analysis on the code resources to obtain mutual calling relations between programs of the same type comprises: performing code analysis on the code resources of programs of the same type by using regular expressions to obtain the mutual calling relations between programs of the same type.
3. The method of claim 1, wherein, The generation of the program calling relation graph according to the mutual calling relations and the direct calling relations comprises: constructing the program calling relation graph by taking the mutual calling relations and the direct calling relations as edges and taking the programs as points.
4. The method of claim 1, wherein, The generation of the program lists corresponding to different business types according to the entrance programs in the program calling relation graph comprises: performing reachability query in the program calling relation graph according to the entrance programs to generate the program lists corresponding to different business types; determining basic data structures corresponding to different business types according to the program lists.
5. The method of claim 4, wherein, The generation of the program lists corresponding to different business types according to the entrance programs in the program calling relation graph comprises: performing reachability query in the program calling relation graph according to the entrance programs, marking points in the program calling relation graph that have been queried as having been traversed, and obtaining the program lists corresponding to different business types.
6. A program processing device characterized by comprising: The device comprises: a program classification module configured to acquire code resources of a plurality of programs, and classify the code resources to determine types corresponding to the programs; a calling relation module configured to perform code analysis on the code resources to obtain mutual calling relations between programs of the same type and direct calling relations between programs of different types; and a program calling relation graph generation module configured to generate a program calling relation graph according to the mutual calling relations and the direct calling relations. The calling relationship module comprises a direct calling unit, configured to parse code resources of each type of program by using a regular expression to obtain direct calling relationships between the programs; A program list module is configured to generate a program calling relationship graph according to the mutual calling relationship and the direct calling relationship, and generate a program list corresponding to each business type according to a preset business type and the program calling relationship graph, wherein different business types have corresponding column functions and column entrances; The program list module is further configured to determine an entrance program corresponding to each business type according to the preset business type, and perform reachability query in the program calling relationship graph according to the entrance program to generate the program list corresponding to each business type. The reachability query comprises, for each node, first judging whether the node contains a mark corresponding to a current column; if yes, stopping and traversing other nodes; if no, marking a program in the node as a program of the column, and continuing to traverse child nodes of the node.
7. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the method in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program for executing the method in any one of claims 1 to 5.
Citation Information
Patent Citations
Code management method and system, computing device and readable storage medium
CN112486563A