Method and device for processing call relationship, storage medium and electronic device
By obtaining data tables and code files from the target application's database and local code library and analyzing the interactive relationship, the problem of failed call relationship recognition in the run log coverage scenario is solved, and the effect of accurately obtaining the call relationship is achieved.
Patent Information
- Application Number
- CN202210532250.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-10
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2042-05-10
AI Technical Summary
In the prior art, when the run log coverage scenario is incomplete, the interface call relationship of the target application cannot be accurately identified, resulting in recognition failure.
By obtaining the data table name from the target application's database and combining the code files in the local code base, matching and analyzing the interaction between the data table and the code file, we determine the call relationship information of the target application.
It realizes that when the run log coverage scenario is incomplete, accurately obtaining the call relationship information of the target application, improving the accuracy and efficiency of recognition.
Smart Images

Figure CN114840321B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of financial technology, and specifically, to a method and device for processing call relationships, a storage medium, and an electronic device. Background Art
[0002] In the process of application development, there are often scenarios where you need to sort out interface call relationships. For example, when the company's asset accumulation is incomplete and the project needs to be reconstructed urgently, it is necessary to sort out all the call relationship information of the interface. However, manual sorting is not accurate, and it is time-consuming and laborious. In order to improve the accuracy of determining the call relationship information and save a lot of manpower and material resources, the following method has appeared in related technologies. The interface call relationship is scanned by tools to obtain the application's operation log, and the interface call relationship information is obtained through the application's operation log analysis. However, if the operation log does not cover all scenarios, it will cause the problem that its call relationship cannot be identified.
[0003] With regard to the problem in the related art of obtaining call relationships through operation logs, when the operation logs do not cover all scenarios, the call relationships cannot be identified. Currently, no effective solution has been proposed. Summary of the invention
[0004] The main purpose of the present application is to provide a method and device for processing call relations, a storage medium and an electronic device, so as to solve the problem in the related art that the call relations are obtained through operation logs, but the operation logs do not cover all scenarios, resulting in the inability to identify the call relations.
[0005] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a method for processing a call relationship is provided. The method comprises: obtaining the names of multiple data tables from a database corresponding to a target application, wherein the target application calls a data table from the database to support the business operation of the target application through an interaction method corresponding to the data table; obtaining a local code library corresponding to the target application, and obtaining multiple code files in the local code library, wherein the multiple code files include multiple first code files and multiple second code files, the first code files are used to indicate the interaction method of the data table, and the second code files are used to indicate the call relationship between the interaction methods of different data tables; matching the name of each data table with multiple code files respectively, and obtaining the first code file corresponding to each data table; obtaining the interaction method of the data table from the first code file corresponding to each data table; obtaining the call relationship between the interaction methods from multiple second code files respectively, and obtaining multiple call relationships; determining the multiple call relationships as the call relationship information of the target application.
[0006] Furthermore, obtaining the local code library corresponding to the target application includes: obtaining application information of the target application, wherein the application information includes at least: a total code library address, a name of the target application and a code library address corresponding to the target application, the total code library containing code libraries corresponding to multiple applications; determining whether there is a local code library corresponding to the name of the target application; when a local code library exists, detecting whether there is an update to the target application; when an update to the target application is detected, locating the total code library from the cloud according to the total code library address, locating the code library of the target application from the total code library according to the code library address of the target application, obtaining the latest code of the target application from the code library of the target application, and storing the latest code in the local code library.
[0007] Furthermore, after determining whether there is a local code library corresponding to the name of the target application, the method also includes: when there is no local code library corresponding to the target application, locating the total code library from the cloud according to the total code library address, locating the code library of the target application from the total code library according to the code library address of the target application, and saving the code library locally to obtain a local code library.
[0008] Furthermore, after determining multiple call relationships as call relationship information of the target application, the method also includes: determining the name of the target application, the names of multiple data tables and the call relationship information as initial field information; preprocessing the initial field information to obtain target field information; and storing the target field information in the target database.
[0009] Furthermore, after detecting whether the target application has been updated, the method further includes: when it is detected that the target application has been updated, obtaining change information of the target application; and storing the change information in the target database.
[0010] Furthermore, when an update to the target application is detected, change information of the target application is obtained, including: obtaining a first code submission ID when the target application was last updated and a second code submission ID when the target application is currently updated; obtaining the code submitted last based on the first code submission ID, and obtaining the code submitted currently based on the second code submission ID; determining the difference information between the code submitted currently and the code submitted last, to obtain change information of the target application.
[0011] Furthermore, calling relationships between interaction methods are respectively obtained from multiple second code files to obtain multiple calling relationships, including: selecting a first interaction method from the interaction methods in the data table; determining the first interaction method as the target interaction method, and querying the second interaction method that calls the target interaction method in the second code file; updating the second interaction method to the target interaction method, and executing the query in the second code file for the third interaction method that calls the target interaction method, until the target interaction method has no calling information.
[0012] In order to achieve the above-mentioned purpose, according to another aspect of the present application, a device for processing call relations is provided. The device comprises: a first acquisition unit, used to acquire the names of multiple data tables from a database corresponding to a target application, wherein the target application calls the data table from the database to support the business operation of the target application through the interaction device corresponding to the data table; a second acquisition unit, used to acquire the local code library corresponding to the target application, and acquire multiple code files in the local code library, wherein the multiple code files include multiple first code files and multiple second code files, the first code file is used to indicate the interaction device of the data table, and the second code file is used to indicate the call relationship between the interaction devices of different data tables; a matching unit, used to match the name of each data table with the multiple code files respectively, and obtain the first code file corresponding to each data table; a third acquisition unit, used to acquire the interaction device of the data table from the first code file corresponding to each data table; a fourth acquisition unit, used to acquire the call relationship between the interaction devices from the multiple second code files respectively, and obtain multiple call relationships; a first determination unit, used to determine the multiple call relationships as the call relationship information of the target application.
[0013] Furthermore, the second acquisition unit includes: a first acquisition module, used to acquire application information of the target application, wherein the application information includes at least: a total code library address, a name of the target application and a code library address corresponding to the target application, the total code library containing code libraries corresponding to multiple applications; a judgment module, used to judge whether there is a local code library corresponding to the name of the target application; a detection module, used to detect whether there is an update to the target application when a local code library exists; a second acquisition module, used to locate the total code library from the cloud according to the total code library address when an update to the target application is detected, locate the code library of the target application from the total code library according to the code library address of the target application, obtain the latest code of the target application from the code library of the target application, and store the latest code in the local code library.
[0014] Furthermore, the device also includes: a fifth acquisition unit, which is used to, after determining whether there is a local code library corresponding to the name of the target application, locate the total code library from the cloud according to the total code library address when there is no local code library corresponding to the target application, locate the code library of the target application from the total code library according to the code library address of the target application, and save the code library locally to obtain a local code library.
[0015] Furthermore, the device also includes: a second determination unit, used to determine the name of the target application, the names of multiple data tables and the calling relationship information as the initial field information after determining multiple calling relationships as the calling relationship information of the target application; a processing unit, used to pre-process the initial field information to obtain the target field information; and a first storage unit, used to store the target field information in the target database.
[0016] Furthermore, the device also includes: a sixth acquisition unit, which is used to acquire the change information of the target application after detecting whether the target application is updated, when it is detected that the target application is updated; and a second storage unit, which is used to store the change information in the target database.
[0017] Furthermore, the sixth acquisition unit includes: a third acquisition module, used to obtain the first code submission ID when the target application was last updated and the second code submission ID when it is updated this time; a fourth acquisition module, used to obtain the last submitted code based on the first code submission ID, and obtain the currently submitted code based on the second code submission ID; a determination module, used to determine the difference information between the currently submitted code and the last submitted code, and obtain the change information of the target application.
[0018] Furthermore, the fourth acquisition unit includes: a selection module, used to select a first interaction method from the interaction methods in the data table; a query module, used to determine the first interaction method as a target interaction method, and query the second interaction method that calls the target interaction method in the second code file; an execution module, used to update the second interaction method to the target interaction method, and execute the query in the second code file for a third interaction method that calls the target interaction method until there is no calling information for the target interaction method.
[0019] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a computer-readable storage medium is provided, and the storage medium stores a program, wherein the program executes any one of the above-mentioned methods for processing the calling relationship.
[0020] In order to achieve the above-mentioned purpose, according to one aspect of the present application, an electronic device is provided, which includes one or more processors and a memory, and the memory is used to store a processing method for one or more processors to implement the calling relationship of any of the above-mentioned items.
[0021] Through this application, the following steps are adopted: obtaining the names of multiple data tables from the database corresponding to the target application, wherein the target application calls the data table from the database to support the business operation of the target application through the interaction method corresponding to the data table; obtaining the local code library corresponding to the target application, and obtaining multiple code files in the local code library, wherein the multiple code files include multiple first code files and multiple second code files, the first code file is used to indicate the interaction method of the data table, and the second code file is used to indicate the call relationship between the interaction methods of different data tables; matching the name of each data table with multiple code files respectively, obtaining the first code file corresponding to each data table; obtaining the interaction method of the data table from the first code file corresponding to each data table; obtaining the call relationship between the interaction methods from the multiple second code files respectively, and obtaining multiple call relationships; determining the multiple call relationships as the call relationship information of the target application, solving the problem in the related art that the call relationship is obtained through the operation log, and the call relationship cannot be identified when the operation log covers incomplete scenarios. By analyzing the names of the local code library files of the target application and the multiple data tables in the database corresponding to the target application, the call relationship information of the target application is obtained, thereby achieving the effect of accurately obtaining the call relationship of the target application. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0023] Figure 1 is a flowchart of a method for processing a call relationship provided in an embodiment of the present application;
[0024] Figure 2 is a flowchart of an optional method for processing a call relationship provided according to an embodiment of the present application;
[0025] Figure 3 is an optional flowchart of obtaining change information of a target application according to an embodiment of the present application;
[0026] Figure 4 is a schematic diagram of a processing device for a call relationship provided according to an embodiment of the present application;
[0027] Figure 5 is a schematic diagram of an electronic device provided according to an embodiment of the present application. DETAILED DESCRIPTION
[0028] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0029] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0030] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0031] The present invention is described below in conjunction with preferred implementation steps. Figure 1 is a flowchart of a method for processing a call relationship provided in an embodiment of the present application, such as Figure 1 As shown, the method comprises the following steps:
[0032] Step S101 , obtaining names of multiple data tables from a database corresponding to a target application, wherein the target application calls data tables from the database to support business operations of the target application through interaction methods corresponding to the data tables.
[0033] First, find the database corresponding to the target application. The database contains multiple data tables of the target application, and each data table has a corresponding business-level interaction method of the target application.
[0034] Then, the names of all data tables are obtained from the database. For example, the names of the data tables obtained from the database include "Data Table A", "Data Table B" and "Data Table C". Each data table has a corresponding business-level interaction method of the target application.
[0035] Step S102, obtain a local code library corresponding to the target application, and obtain multiple code files in the local code library, wherein the multiple code files include multiple first code files and multiple second code files, the first code files are used to indicate the interaction method of the data table, and the second code files are used to indicate the calling relationship between the interaction methods of different data tables.
[0036] Specifically, a local code library stored locally by the target application is obtained, and all code files of the target application are obtained from the local code library. All code files of the target application include two types of code files, namely, a first code file and a second code file, wherein the code in the first code file describes the interaction method of each data table; and the code in the second code file describes the calling relationship between the interaction methods.
[0037] Step S103: Match the name of each data table with a plurality of code files respectively to obtain a first code file corresponding to each data table.
[0038] It should be noted that the name of the data table has a corresponding relationship with the name of the first code file corresponding to the data table, so the name of each data table is matched with all the code files to obtain the first code file corresponding to each data table.
[0039] For example, match the name "data table A" with multiple code files to obtain code file A corresponding to data table A, match the name "data table B" with multiple code files to obtain code file B corresponding to data table B, and match the name "data table C" with multiple code files to obtain code file C corresponding to data table C.
[0040] Step S104: acquiring the interaction method of each data table from the first code file corresponding to each data table.
[0041] Specifically, the first code file includes the interaction method of the data table. For example, code file A includes interaction method 1 of data table A, code file B includes interaction method 2 of data table B, and code file C includes interaction method 3 of data table C.
[0042] Step S105, respectively obtaining the calling relationships between the interactive methods from the plurality of second code files to obtain a plurality of calling relationships.
[0043] Specifically, the second code file includes the calling relationship between the interaction methods. For example, starting from interaction method 1, the interaction method that calls interaction method 1 is searched in the second code file, and the recursive search is continuously performed upward until the top-level interaction method has no caller.
[0044] Step S106: determine the multiple calling relationships as calling relationship information of the target application.
[0045] It should be noted that, since each calling relationship corresponds to a calling behavior between services at the business level of the target application, the above-mentioned calling relationship is the calling relationship information of the target application.
[0046] In summary, by analyzing the local code library file of the target application and the names of multiple data tables in the database corresponding to the target application, the call relationship information of the target application can be accurately obtained.
[0047] Optionally, in the call relationship processing method provided in the embodiment of the present application, obtaining the local code library corresponding to the target application includes: obtaining application information of the target application, wherein the application information includes at least: a total code library address, a name of the target application and a code library address corresponding to the target application, the total code library containing code libraries corresponding to multiple applications; determining whether there is a local code library corresponding to the name of the target application; when a local code library exists, detecting whether there is an update to the target application; when an update to the target application is detected, locating the total code library from the cloud according to the total code library address, locating the code library of the target application from the total code library according to the code library address of the target application, obtaining the latest code of the target application from the code library of the target application, and storing the latest code in the local code library.
[0048] Specifically, obtaining the local code base of the target application includes: periodically querying the target application, obtaining the total code base address, the name of the target application, and the code base address corresponding to the target application. First, determine whether there is a local code base corresponding to the name of the target application locally according to the name of the target application. If there is a local code base locally, in order to ensure that the code stored in the local code base of the target application is the latest code of the target application, when the target application is updated, first find the total code base from the cloud according to the total code base address. Since the total code base contains the code bases of multiple applications, then find the code base of the target application in the total code base according to the code base address corresponding to the target application, and obtain the latest code of the target application from the code base of the target application, and store the latest code in the local code base of the target application.
[0049] Through the above steps, it is determined whether there is a local code library corresponding to the target application locally. When a local code library exists locally, only the latest code of the target application needs to be obtained, and there is no need to obtain the entire code library of the target application, which improves the efficiency of code update.
[0050] Optionally, in the method for processing the calling relationship provided in the embodiment of the present application, after determining whether there is a local code library corresponding to the name of the target application, the method also includes: when there is no local code library corresponding to the target application, locating the total code library from the cloud according to the total code library address, locating the code library of the target application from the total code library according to the code library address of the target application, and saving the code library locally to obtain a local code library.
[0051] It should be noted that when the local code library corresponding to the target application does not exist locally, in order to improve the efficiency of code acquisition, it is necessary to create a local code library. Specifically, first find the total code library from the cloud according to the total code library address, then find the code library of the target application in the total code library according to the code library address corresponding to the target application, save the code library of the target application locally, and obtain the local code library. Through this embodiment, the code library of the target application is saved locally, which facilitates the analysis of the code file of the target application and obtains the call relationship information of the target application.
[0052] In order to facilitate developers to analyze the calling relationship of the target application, optionally, in the calling relationship processing method provided in the embodiment of the present application, after determining multiple calling relationships as calling relationship information of the target application, the method also includes: determining the name of the target application, the names of multiple data tables and the calling relationship information as initial field information; preprocessing the initial field information to obtain target field information; and storing the target field information in the target database.
[0053] Specifically, after obtaining the name of the target application, the names of all data tables, and the call relationship information of the target application, in order to avoid data errors and data redundancy, the obtained data is first pre-processed (for example, deduplication processing), and the processed name of the target application, the names of all data tables, and the call relationship information of the target application are stored in the target database, specifically, in the form of fields. The target database is different from the database storing the data tables, so that the developer can directly perform visual query on the field information from the target database and perform subsequent call relationship analysis.
[0054] In order to facilitate developers to easily obtain update information of the target application, optionally, in the call relationship processing method provided in the embodiment of the present application, after detecting whether the target application has been updated, the method also includes: when it is detected that the target application has been updated, obtaining change information of the target application; and storing the change information in the target database.
[0055] Specifically, when the target application is updated, the change information of the target application is obtained and saved in the target database. The change information helps subsequent technicians understand the change content of the target application.
[0056] Optionally, in the call relationship processing method provided in the embodiment of the present application, when an update of the target application is detected, the change information of the target application is obtained, including: obtaining the first code submission ID when the target application was last updated and the second code submission ID when the target application is updated this time; obtaining the last submitted code based on the first code submission ID, and obtaining the currently submitted code based on the second code submission ID; determining the difference information between the currently submitted code and the last submitted code to obtain the change information of the target application.
[0057] Specifically, obtaining the change information of the target application includes: first obtaining the first code submission ID of the target application when it was last updated and the second code submission ID of the current update. When updating the target application, each submission of the updated content will have a unique code submission ID, so first obtaining the first code submission ID of the target application when it was last updated and the second code submission ID of the current update. The code information of the last submission can be obtained through the first code submission ID, and the code information of the current submission can be obtained through the second code submission ID. By comparing the code information of the two submissions, the change information of the target application can be accurately obtained.
[0058] Optionally, in the method for processing call relationships provided in an embodiment of the present application, call relationships between interaction methods are respectively obtained from multiple second code files to obtain multiple call relationships, including: selecting a first interaction method from the interaction methods in the data table; determining the first interaction method as the target interaction method, and querying the second interaction method that calls the target interaction method in the second code file; updating the second interaction method to the target interaction method, and executing the query in the second code file for a third interaction method that calls the target interaction method until the target interaction method has no call information.
[0059] Specifically, take interaction method 1 as the target interaction method, first query that interaction method 2 calls interaction method 1, interaction method 2 becomes the new starting point, query the interaction method that calls interaction method 2 in the second code file, query and get interaction method 3 calls interaction method 2, interaction method 3 becomes the new starting point, query the interaction method that calls interaction method 3 in the second code file, query and get interaction method 3 has no caller, then the query ends at this time, the obtained call relationship is interaction method 2 calls interaction method 1, interaction method 3 calls interaction method 2, that is, interaction method 3-interaction method 2-interaction method 1; then there may be interaction method 4 corresponding to data table D, interaction method 4 calls interaction method 1, interaction method 3 calls interaction method 4, at this time the call relationship is interaction method 3-interaction method 4-interaction method 1. When combing the code for interaction method 4, both of these call relationships need to be combed. If there are omissions, the overall logic of the target application will be incomplete and it will not work properly. It should be noted that the complexity of the call relationship for the specific business of the target application is relatively high. Here is just a simple example to illustrate how to comb the call relationship.
[0060] The method for processing the call relationship provided by the embodiment of the present application obtains the names of multiple data tables from the database corresponding to the target application, wherein the target application calls the data table from the database to support the business operation of the target application through the interaction method corresponding to the data table; obtains the local code library corresponding to the target application, and obtains multiple code files in the local code library, wherein the multiple code files include multiple first code files and multiple second code files, the first code file is used to indicate the interaction method of the data table, and the second code file is used to indicate the call relationship between the interaction methods of different data tables; matches the name of each data table with the multiple code files respectively, obtains the first code file corresponding to each data table; obtains the interaction method of the data table from the first code file corresponding to each data table; obtains the call relationship between the interaction methods from the multiple second code files respectively, and obtains multiple call relationships; determines the multiple call relationships as the call relationship information of the target application, which solves the problem in the related art that the call relationship is obtained by running logs, and the call relationship cannot be identified when the running log covers incomplete scenarios. By analyzing the names of the local code library files of the target application and the multiple data tables in the database corresponding to the target application, the call relationship information of the target application is obtained, thereby achieving the effect of accurately obtaining the call relationship of the target application.
[0061] Figure 2 : is a flowchart of an optional method for processing a call relationship provided in an embodiment of the present application, the method comprising:
[0062] Regularly query the target application information that needs to be scanned and analyzed to obtain the total code library address, the name of the target application, and the code library address corresponding to the target application.
[0063] Then, based on the name of the target application, determine whether a local code library already exists locally. If a local code library already exists, directly obtain the latest code of the target file. If no local code library exists, locate the address of the general code library, and directly clone the version library of the corresponding branch of the application from the general code library to the local specified address to obtain the local code library.
[0064] Then, the local code base is scanned, and the names of all data tables involved in the target application are read. According to the names of the data tables and the local code base, the interaction methods of all data tables are obtained.
[0065] Finally, the interaction methods and local code libraries are traversed to obtain the calling relationships between the interaction methods. The calling relationship information, the name of the target application, the name of the data table involved in the target application and other field information are deduplicated and stored in the database to facilitate the query work of developers.
[0066] Figure 3 This is an optional flowchart for obtaining the change information of the target application provided in accordance with an embodiment of the present application, including: obtaining the first code submission ID (commit ID) of the last update of the target application and the second code submission ID (commit ID) of the current update. Then, all the submission codes between the two submissions are obtained, and all the information of the change method is obtained after parsing, and finally the change information (application name, method name, method parameters, and the last submission record person information) is inserted into the target database, so that developers can visually query the change information.
[0067] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0068] The embodiment of the present application also provides a call relationship processing device. It should be noted that the call relationship processing device of the embodiment of the present application can be used to execute the call relationship processing method provided by the embodiment of the present application. The following introduces the call relationship processing device provided by the embodiment of the present application.
[0069] Figure 4 Schematic diagram of a processing device for call relationships according to an embodiment of the present application. Figure 4 As shown, the device includes: a first acquisition unit 401, a second acquisition unit 402, a matching unit 403, a third acquisition unit 404, a fourth acquisition unit 405 and a first determination unit 406.
[0070] The first acquisition unit 401 is used to acquire names of multiple data tables from a database corresponding to a target application, wherein the target application calls a data table from the database to support business operations of the target application through an interaction device corresponding to the data table.
[0071] The second acquisition unit 402 is used to acquire a local code library corresponding to the target application, and acquire multiple code files in the local code library, wherein the multiple code files include multiple first code files and multiple second code files, the first code files are used to indicate the interaction device of the data table, and the second code files are used to indicate the calling relationship between the interaction devices of different data tables.
[0072] The matching unit 403 is used to match the name of each data table with multiple code files respectively to obtain a first code file corresponding to each data table.
[0073] The third acquisition unit 404 is used to acquire the interactive device of the data table from the first code file corresponding to each data table.
[0074] The fourth acquisition unit 405 is used to respectively acquire the calling relationships between the interactive devices from the plurality of second code files to obtain a plurality of calling relationships.
[0075] The first determining unit 406 is configured to determine the multiple calling relationships as the calling relationship information of the target application.
[0076] The processing device of the call relationship provided in the embodiment of the present application obtains the names of multiple data tables from the database corresponding to the target application through the first acquisition unit 401; the second acquisition unit 402 obtains the local code library corresponding to the target application, and obtains multiple code files in the local code library; the matching unit 403 matches the name of each data table with multiple code files respectively to obtain the first code file corresponding to each data table; the third acquisition unit 404 obtains the interactive device of the data table from the first code file corresponding to each data table; the fourth acquisition unit 405 obtains the call relationship between the interactive devices from multiple second code files respectively to obtain multiple call relationships; the first determination unit 406 determines the multiple call relationships as the call relationship information of the target application, which solves the problem in the related art that the call relationship is obtained through the operation log, and the call relationship cannot be identified when the operation log does not cover all scenarios. By analyzing the names of the multiple data tables in the local code library file of the target application and the database corresponding to the target application, the call relationship information of the target application is obtained, thereby achieving the effect of accurately obtaining the call relationship of the target application.
[0077] Optionally, in the call relationship processing device provided in the embodiment of the present application, the second acquisition unit includes: a first acquisition module, used to acquire application information of the target application, wherein the application information includes at least: a total code library address, a name of the target application and a code library address corresponding to the target application, and the total code library contains code libraries corresponding to multiple applications; a judgment module, used to determine whether there is a local code library corresponding to the name of the target application; a detection module, used to detect whether there is an update to the target application when a local code library exists; a second acquisition module, used to locate the total code library from the cloud according to the total code library address when an update to the target application is detected, locate the code library of the target application from the total code library according to the code library address of the target application, obtain the latest code of the target application from the code library of the target application, and store the latest code in the local code library.
[0078] Optionally, in the call relationship processing device provided in the embodiment of the present application, the device also includes: a fifth acquisition unit, which is used to, after determining whether there is a local code library corresponding to the name of the target application, locate the total code library from the cloud according to the total code library address when there is no local code library corresponding to the target application, locate the code library of the target application from the total code library according to the code library address of the target application, and save the code library locally to obtain a local code library.
[0079] Optionally, in the call relationship processing device provided in the embodiment of the present application, the device also includes: a second determination unit, used to determine the name of the target application, the names of multiple data tables and the call relationship information as initial field information after determining multiple call relationships as call relationship information of the target application; a processing unit, used to pre-process the initial field information to obtain target field information; and a first storage unit, used to store the target field information in the target database.
[0080] Optionally, in the call relationship processing device provided in the embodiment of the present application, the device also includes: a sixth acquisition unit, used to obtain change information of the target application after detecting whether the target application has been updated, when it is detected that the target application has been updated; a second storage unit, used to store the change information in the target database.
[0081] Optionally, in the call relationship processing device provided in the embodiment of the present application, the sixth acquisition unit includes: a third acquisition module, used to obtain the first code submission ID when the target application was last updated and the second code submission ID when it is updated this time; a fourth acquisition module, used to obtain the last submitted code based on the first code submission ID, and obtain the currently submitted code based on the second code submission ID; a determination module, used to determine the difference information between the currently submitted code and the last submitted code, and obtain the change information of the target application.
[0082] Optionally, in the calling relationship processing device provided in the embodiment of the present application, the fourth acquisition unit includes: a selection module, used to select a first interaction method from the interaction methods in the data table; a query module, used to determine the first interaction method as the target interaction method, and query the second interaction method that calls the target interaction method in the second code file; an execution module, used to update the second interaction method to the target interaction method, and execute the query in the second code file for the third interaction method that calls the target interaction method until the target interaction method has no calling information.
[0083] The processing device for the call relationship includes a processor and a memory. The above-mentioned first acquisition unit 401, second acquisition unit 402, matching unit 403, third acquisition unit 404, fourth acquisition unit 405 and first determination unit 406 are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize corresponding functions.
[0084] An embodiment of the present invention provides a computer-readable storage medium on which a program is stored. When the program is executed by a processor, the method for processing the calling relationship is implemented.
[0085] like Figure 5 As shown, an embodiment of the present invention provides an electronic device 10, which includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, the following steps are implemented: obtaining the names of multiple data tables from a database corresponding to a target application, wherein the target application calls the data table from the database to support the business operation of the target application through the interaction method corresponding to the data table; obtaining a local code library corresponding to the target application, and obtaining multiple code files in the local code library, wherein the multiple code files include multiple first code files and multiple second code files, the first code file is used to indicate the interaction method of the data table, and the second code file is used to indicate the calling relationship between the interaction methods of different data tables; matching the name of each data table with the multiple code files respectively to obtain the first code file corresponding to each data table; obtaining the interaction method of the data table from the first code file corresponding to each data table; obtaining the calling relationship between the interaction methods from the multiple second code files respectively to obtain multiple calling relationships; determining the multiple calling relationships as the calling relationship information of the target application.
[0086] Optionally, obtaining a local code library corresponding to the target application includes: obtaining application information of the target application, wherein the application information includes at least: a total code library address, a name of the target application and a code library address corresponding to the target application, the total code library containing code libraries corresponding to multiple applications; determining whether there is a local code library corresponding to the name of the target application; when a local code library exists, detecting whether there is an update to the target application; when an update to the target application is detected, locating the total code library from the cloud according to the total code library address, locating the code library of the target application from the total code library according to the code library address of the target application, obtaining the latest code of the target application from the code library of the target application, and storing the latest code in the local code library.
[0087] Optionally, after determining whether there is a local code library corresponding to the name of the target application, the method also includes: when there is no local code library corresponding to the target application, locating the total code library from the cloud according to the total code library address, locating the code library of the target application from the total code library according to the code library address of the target application, and saving the code library locally to obtain a local code library.
[0088] Optionally, after determining multiple call relationships as call relationship information of the target application, the method also includes: determining the name of the target application, the names of multiple data tables and the call relationship information as initial field information; preprocessing the initial field information to obtain target field information; and storing the target field information in the target database.
[0089] Optionally, after detecting whether the target application has been updated, the method further includes: when it is detected that the target application has been updated, acquiring change information of the target application; and storing the change information in the target database.
[0090] Optionally, when an update to the target application is detected, change information of the target application is obtained, including: obtaining a first code submission ID when the target application was last updated and a second code submission ID when the target application is currently updated; obtaining the last submitted code based on the first code submission ID, and obtaining the currently submitted code based on the second code submission ID; determining the difference information between the currently submitted code and the last submitted code to obtain the change information of the target application.
[0091] Optionally, the calling relationships between the interaction methods are obtained from the plurality of second code files respectively to obtain the plurality of calling relationships, including: selecting the first interaction method from the interaction methods in the data table; determining the first interaction method as the target interaction method, and querying the second interaction method that calls the target interaction method in the second code file; updating the second interaction method as the target interaction method, and querying the third interaction method that calls the target interaction method in the second code file until the target interaction method has no calling information. The device in this article can be a server, a PC, a PAD, a mobile phone, etc.
[0092] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program that is initialized with the following method steps: obtaining the names of multiple data tables from a database corresponding to a target application, wherein the target application calls the data tables from the database to support the business operations of the target application through the interaction methods corresponding to the data tables; obtaining a local code library corresponding to the target application, and obtaining multiple code files in the local code library, wherein the multiple code files include multiple first code files and multiple second code files, the first code files are used to indicate the interaction methods of the data tables, and the second code files are used to indicate the calling relationship between the interaction methods of different data tables; matching the name of each data table with the multiple code files respectively to obtain the first code file corresponding to each data table; obtaining the interaction method of the data table from the first code file corresponding to each data table; obtaining the calling relationship between the interaction methods from the multiple second code files respectively to obtain multiple calling relationships; determining the multiple calling relationships as the calling relationship information of the target application.
[0093] Optionally, obtaining a local code library corresponding to the target application includes: obtaining application information of the target application, wherein the application information includes at least: a total code library address, a name of the target application and a code library address corresponding to the target application, the total code library containing code libraries corresponding to multiple applications; determining whether there is a local code library corresponding to the name of the target application; when a local code library exists, detecting whether there is an update to the target application; when an update to the target application is detected, locating the total code library from the cloud according to the total code library address, locating the code library of the target application from the total code library according to the code library address of the target application, obtaining the latest code of the target application from the code library of the target application, and storing the latest code in the local code library.
[0094] Optionally, after determining whether there is a local code library corresponding to the name of the target application, the method also includes: when there is no local code library corresponding to the target application, locating the total code library from the cloud according to the total code library address, locating the code library of the target application from the total code library according to the code library address of the target application, and saving the code library locally to obtain a local code library.
[0095] Optionally, after determining multiple call relationships as call relationship information of the target application, the method also includes: determining the name of the target application, the names of multiple data tables and the call relationship information as initial field information; preprocessing the initial field information to obtain target field information; and storing the target field information in the target database.
[0096] Optionally, after detecting whether the target application has been updated, the method further includes: when it is detected that the target application has been updated, acquiring change information of the target application; and storing the change information in the target database.
[0097] Optionally, when an update to the target application is detected, change information of the target application is obtained, including: obtaining a first code submission ID when the target application was last updated and a second code submission ID when the target application is currently updated; obtaining the last submitted code based on the first code submission ID, and obtaining the currently submitted code based on the second code submission ID; determining the difference information between the currently submitted code and the last submitted code to obtain the change information of the target application.
[0098] Optionally, calling relationships between interaction methods are respectively obtained from multiple second code files to obtain multiple calling relationships, including: selecting a first interaction method from the interaction methods in the data table; determining the first interaction method as the target interaction method, and querying the second interaction method that calls the target interaction method in the second code file; updating the second interaction method to the target interaction method, and executing the query in the second code file for a third interaction method that calls the target interaction method until the target interaction method has no calling information.
[0099] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0100] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0101] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0102] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0103] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0104] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0105] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0106] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0107] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0108] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A method for processing call relations, It is characterized in that include: Acquire names of multiple data tables from a database corresponding to the target application, wherein the target application calls the data tables from the database to support business operations of the target application through interaction methods corresponding to the data tables; Obtaining a local code library corresponding to the target application, and obtaining a plurality of code files in the local code library, wherein the plurality of code files include a plurality of first code files and a plurality of second code files, the first code files are used to indicate an interaction method of a data table, and the second code files are used to indicate a calling relationship between interaction methods of different data tables; Match the name of each data table with a plurality of code files respectively to obtain a first code file corresponding to each data table; Acquire the interaction method of each data table from the first code file corresponding to each data table; Acquire the calling relationships between the interactive methods from the plurality of second code files respectively to obtain a plurality of calling relationships; The multiple calling relationships are determined as calling relationship information of the target application.
2. The method according to claim 1, It is characterized in that Acquiring the local code library corresponding to the target application includes: Acquire application information of the target application, wherein the application information at least includes: a total code library address, a name of the target application and a code library address corresponding to the target application, wherein the total code library includes code libraries corresponding to multiple applications; Determine whether there is a local code library corresponding to the name of the target application; When the local code library exists, detecting whether the target application has an update; When an update to the target application is detected, the total code library is located from the cloud according to the total code library address, the code library of the target application is located from the total code library according to the code library address of the target application, the latest code of the target application is obtained from the code library of the target application, and the latest code is stored in the local code library.
3. The method according to claim 2, It is characterized in that After determining whether there is a local code library corresponding to the name of the target application, the method further includes: When there is no local code library corresponding to the target application, the total code library is located from the cloud according to the total code library address, and the code library of the target application is located from the total code library according to the code library address of the target application, and the code library is saved locally to obtain the local code library.
4. The method according to claim 2, It is characterized in that After determining the multiple call relationships as the call relationship information of the target application, the method further includes: Determine the name of the target application, the names of the multiple data tables, and the call relationship information as initial field information; Preprocessing the initial field information to obtain target field information; The target field information is stored in a target database.
5. The method according to claim 4, It is characterized in that After detecting whether the target application has been updated, the method further includes: When it is detected that the target application is updated, obtaining change information of the target application; The change information is stored in the target database.
6. The method according to claim 5, It is characterized in that When it is detected that the target application is updated, obtaining the change information of the target application includes: Obtain the first code submission ID of the target application during the last update and the second code submission ID of the current update; Obtain the code submitted last time according to the first code submission ID, and obtain the code submitted this time according to the second code submission ID; Determine the difference information between the code submitted this time and the code submitted last time, and obtain the change information of the target application.
7. The method according to claim 1, It is characterized in that Acquire the calling relationships between the interactive methods from the plurality of second code files respectively, and obtain a plurality of calling relationships, including: Selecting a first interaction method from the interaction methods in the data table; Determine the first interaction method as a target interaction method, and search the second code file for a second interaction method that calls the target interaction method; The second interaction method is updated to the target interaction method, and a query is executed in the second code file for a third interaction method that calls the target interaction method until there is no calling information for the target interaction method.
8. A device for processing a call relationship, It is characterized in that include: A first acquisition unit is used to acquire names of multiple data tables from a database corresponding to a target application, wherein the target application calls the data tables from the database to support business operations of the target application through interaction devices corresponding to the data tables; a second acquisition unit, configured to acquire a local code library corresponding to the target application, and acquire a plurality of code files in the local code library, wherein the plurality of code files include a plurality of first code files and a plurality of second code files, the first code files are used to indicate an interaction device of a data table, and the second code files are used to indicate a calling relationship between interaction devices of different data tables; A matching unit, used for matching the name of each data table with a plurality of code files respectively, to obtain a first code file corresponding to each data table; A third acquisition unit, configured to acquire the interaction device of each data table from the first code file corresponding to each data table; A fourth acquisition unit, configured to respectively acquire the calling relationships between the interactive devices from the plurality of second code files to obtain a plurality of calling relationships; The first determining unit is configured to determine the multiple calling relationships as the calling relationship information of the target application.
9. A computer-readable storage medium, It is characterized in that The storage medium stores a program, wherein the program executes the method for processing a call relationship as described in any one of claims 1 to 7.
10. An electronic device, It is characterized in that It includes one or more processors and a memory, wherein the memory is used to store a processing method for one or more processors to implement the call relationship described in any one of claims 1 to 7.
