Construction method and device of calling relation table, equipment and storage medium
By building the call relationship table, the insurance company's API management is inefficient and high error rate are solved, and the automated API call relationship table construction is realized, which improves management efficiency and data accuracy.
Patent Information
- Application Number
- CN202411397711.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-08
- Publication Date
- 2025-02-25
AI Technical Summary
In insurance companies' system architecture, API management is inefficient and has high error rates, especially when a certain API needs to be expanded, changed, or disabled. It becomes crucial to know which systems are using the API, but relying on manual communication leads to inefficiency and high error rates.
By building a call relationship table, obtaining the configuration information of the target service, determining the network calling tool used, scanning the request method annotation and request ID, extracting relevant API information from the internal and external interface information tables, and establishing an API call relationship table.
It realizes automated API call relationship table construction, clearly displays the call relationship between each API, improves the efficiency of API management, reduces the error rate, and improves the accuracy of data.
Smart Images

Figure CN119512611A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of managing API call relationships, and in particular to a method, device, equipment and storage medium for constructing a call relationship table. Background Art
[0002] In the system architecture of insurance companies, the business middle office plays an important role, providing application programming interfaces (APIs) of various standard business functions for use by external merchants and the company's internal customer-facing systems. These APIs not only support docking with external intermediary channels to facilitate operations such as insurance and policy inquiries, but also need to call many external APIs, such as risk control systems, anti-fraud systems, and third-party management agencies (TPA) claims systems to effectively handle insurance business. As the volume of business increases, the number of APIs is also growing.
[0003] When an API needs to be expanded, changed, or deactivated, as well as when coordinating with external APIs or responding to regulatory inspections, it is critical to understand which systems are using the API. This usually requires contacting developers to obtain call information, but relying on this manual communication method often leads to inefficiency and high error rates, which in turn leads to inefficient API management and high error rates.
[0004] Therefore, how to improve the management efficiency of API and reduce the error rate during API management is a technical problem that technical personnel in this field urgently need to solve. Summary of the invention
[0005] Based on the above problems, the present application provides a method, device, equipment and storage medium for constructing a call relationship table, which can improve the management efficiency of the API and reduce the error rate during API management.
[0006] The embodiments of the present application disclose the following technical solutions:
[0007] A method for constructing a call relationship table, the method comprising:
[0008] Acquire configuration information of a first target service, and determine a target network calling tool used by the first target service from the configuration information;
[0009] Scan the request method annotation and request identity identifier ID of the target network calling tool;
[0010] Determine the calling application program interface API information of the first target service from the internal interface information table and / or the external interface information table based on the request mode annotation and the request ID of the target network calling tool;
[0011] An API call relationship table is established based on the service name of the first target service and the calling API information of the first target service.
[0012] In a possible implementation, the process of constructing the internal interface information table includes:
[0013] In the API management service, call the period solution swagger document of all businesses through scheduled tasks;
[0014] Parse the swagger documents of all the businesses to obtain multiple internal API information; each internal API information includes an internal interface ID, an internal interface name, an internal interface description, an internal interface path, an internal interface service, an internal interface module, an internal interface request method, an internal interface protocol, an internal interface domain name, and an internal interface calling environment;
[0015] Based on the multiple pieces of internal API information, construct the internal interface information table;
[0016] Wherein, when parsing the new swagger document of all the services, if there is new internal API information, the internal interface information table is updated based on the new internal API information.
[0017] In a possible implementation, the process of constructing the external interface information table includes:
[0018] Obtain one or more external API information entered externally; the external API information includes the external interface name, external interface description, external interface path, the system to which the external interface belongs, the external interface request method, the external interface protocol, the external interface domain name, and the external interface calling environment;
[0019] Generate an external interface ID for each external API message;
[0020] Constructing the external interface information table based on the one or more pieces of external API information and the external API information ID corresponding to each piece of external API information;
[0021] When new external API information input from the outside is obtained, the external interface information table is updated based on the new external API information.
[0022] In a possible implementation, the method further includes:
[0023] In response to the interface path calling request sent by the second target service through the gateway service, identifying whether the second target service in the API calling relationship table corresponds one-to-one to the target interface path in the interface path calling request;
[0024] If so, the interface corresponding to the target interface path is forwarded to the second target service.
[0025] In a possible implementation, the configuration process of the target network calling tool includes:
[0026] Get the interface ID and request method of the called interface;
[0027] Annotating the request method of the called interface as the request method of the network calling tool forest, and using the interface ID of the called interface as the request ID of the network calling tool forest, thereby generating the target network calling tool;
[0028] The target network calling tool is configured in the configuration information of the first target service.
[0029] A device for constructing an API call relationship table, the device comprising:
[0030] A first acquisition unit, used to acquire configuration information of a first target service;
[0031] A first determining unit, configured to determine a target network calling tool used by the first target service from the configuration information;
[0032] A scanning unit, used for scanning the request method annotation and request identity identifier ID of the target network calling tool;
[0033] A second determining unit, configured to determine the calling application program interface API information of the first target service from an internal interface information table and / or an external interface information table based on the request mode annotation and the request ID of the target network calling tool;
[0034] The API call relationship table establishing unit is used to establish an API call relationship table based on the service name of the first target service and the calling API information of the first target service.
[0035] In a possible implementation manner, the device further includes:
[0036] The calling unit is used to call the period solution swagger document of all businesses through scheduled tasks in the API management service;
[0037] A parsing unit, used to parse the swagger documents of all the businesses to obtain multiple internal API information; each internal API information includes an internal interface ID, an internal interface name, an internal interface description, an internal interface path, an internal interface service, an internal interface module, an internal interface request method, an internal interface protocol, an internal interface domain name, and an internal interface calling environment;
[0038] An internal interface information table construction unit, used to construct the internal interface information table based on the multiple pieces of internal API information;
[0039] Wherein, when parsing the new swagger document of all the services, if there is new internal API information, the internal interface information table is updated based on the new internal API information.
[0040] In a possible implementation manner, the device further includes:
[0041] The second acquisition unit is used to acquire one or more external API information entered externally; the external API information includes the external interface name, external interface description, external interface path, external interface belonging system, external interface request method, external interface protocol, external interface domain name and external interface calling environment;
[0042] An external interface ID generating unit, used to generate an external interface ID for each piece of external API information;
[0043] An external interface information table construction unit, configured to construct the external interface information table based on the one or more pieces of external API information and the external API information ID corresponding to each piece of external API information;
[0044] When new external API information input from the outside is obtained, the external interface information table is updated based on the new external API information.
[0045] A device for constructing a call relationship table includes: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the method for constructing a call relationship table as described above is implemented.
[0046] A computer-readable storage medium stores instructions, and when the instructions are executed on a terminal device, the terminal device executes the method for constructing a call relationship table as described above.
[0047] Compared with the prior art, this application has the following beneficial effects:
[0048] The present application provides a method, device, equipment and storage medium for constructing a call relationship table. Specifically, when executing the method for constructing a call relationship table provided in an embodiment of the present application, the specific network call tool used by the business is first determined by obtaining the configuration information of the first target business. Then, it annotates the request method and request ID of the target network call tool. Based on the results of these scans, the call API information related to the first target business is further screened out from the internal interface information table and the external interface information table. Finally, a detailed API call relationship table is constructed by combining the name of the first target business and its call API information. The present application can automatically establish an API call relationship table to display the call relationship between each API, so that managers can more clearly understand the use of APIs in the system without manually arranging information and improving work efficiency. At the same time, the call relationship table is established through an automated process, which reduces the chance of human intervention and reduces the error rate. This helps to improve the accuracy of data and reduce the risk of errors in the management process. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the technical solutions in this embodiment or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0050] Figure 1 A method flow chart of a method for constructing a call relationship table provided in an embodiment of the present application;
[0051] Figure 2 A method flow chart of a method for configuring a target network calling tool provided in an embodiment of the present application;
[0052] Figure 3 A method flow chart of a method for constructing an internal interface information table provided in an embodiment of the present application;
[0053] Figure 4 A schematic diagram of the structure of an internal interface information table provided in an embodiment of the present application;
[0054] Figure 5 A method flow chart of a method for constructing an external interface information table provided in an embodiment of the present application;
[0055] Figure 6 A schematic diagram of the structure of an external interface information table provided in an embodiment of the present application;
[0056] Figure 7 A schematic diagram of the structure of an API call relationship table provided in an embodiment of the present application;
[0057] Figure 8 A schematic diagram of the structure of a device for constructing a call relationship table provided in an embodiment of the present application. DETAILED DESCRIPTION
[0058] To facilitate understanding of the technical solutions provided by the embodiments of the present application, the background technology involved in the embodiments of the present application will be described below.
[0059] In the system architecture of insurance companies, the business middle office plays a core role. The API it provides integrates standardized business services, aiming to efficiently connect external merchants and internal customer-oriented systems. These services cover key processes from insurance application, policy inquiry to claims management, and achieve comprehensive and in-depth support by calling external risk control, anti-fraud and TPA claims and other professional systems.
[0060] As insurance business continues to expand and become more complex, the number and application scenarios of APIs are increasing. In this context, it may be necessary to expand, change, or deactivate a specific API, as well as manage APIs such as external API changes or regulatory audits. However, when performing such operations, it is crucial to accurately identify and contact all systems that rely on the API to obtain call information, but this approach often faces challenges of low efficiency and high error rates. This leads to inefficient API management and high error rates.
[0061] The low efficiency and high error rate are mainly reflected in two aspects: First, when it is necessary to trace the use of APIs, it is usually necessary to manually communicate and confirm each system one by one, which is not only time-consuming but also requires a high degree of organizational coordination. Especially in large insurance companies, the number of systems and the variety of services make this process particularly lengthy and complicated. Second, this manual and manual-dependent approach is susceptible to human errors, such as information omissions, feedback delays, or misunderstandings, thereby reducing the overall operational accuracy and response speed.
[0062] In order to solve this problem, an embodiment of the present application provides a method, device, equipment and storage medium for constructing a call relationship table. First, the configuration information of the first target business is obtained to determine the target network calling tool used by it, and then the request method annotation and request identity identifier ID of the tool are scanned, and then the relevant API information is extracted from the internal and external interface information tables, and finally a complete API call relationship table is established based on the business name and the called API information. The present application can automatically generate an API call relationship table, clearly display the call relationship between each API, so that managers can more intuitively understand the use of APIs in the system, eliminating the tediousness of manually collating information, thereby improving work efficiency. At the same time, the automation process reduces the chance of human intervention, effectively reduces the error rate, improves the accuracy of data, and thus reduces the risk of errors in the management process.
[0063] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. 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 are within the scope of protection of this application.
[0064] See also Figure 1 , which is a flow chart of a method for constructing a call relationship table provided in an embodiment of the present application, such as Figure 1 As shown, the method for constructing the call relationship table may include steps S101-S104:
[0065] S101: Acquire configuration information of a first target service, and determine a target network calling tool used by the first target service from the configuration information.
[0066] In order to construct the API call relationship table of the first target business, the configuration information of the first target business needs to be obtained first. The configuration information of the first target business can be obtained by checking the system configuration file, environment variables or other settings to determine the configuration items related to the first target business. After obtaining the configuration information of the first target business, the target network call tool used by the first target business can be determined from it. Configuration information refers to the parameters and settings used to configure and manage software systems or applications. This information usually includes various properties required for system operation, such as:
[0067] Database connection information: such as database type, address, port, user name and password, etc.
[0068] API endpoint: Uniform Resource Locator (URL) of the external service, request method (GET, POST, etc.), request header information, etc.
[0069] Authentication information: such as API keys, OAuth (OpenAuthorization) tokens, etc., used for identity authentication and authorization.
[0070] Environment variables: specific settings for different environments (development, testing, production), such as log level, cache strategy, etc.
[0071] Function switch: A flag used to control whether certain functions are enabled.
[0072] Third-party service configuration: such as payment service, email service, etc.
[0073] Configuration information is generally stored in configuration files (such as JSON (JavaScript Object Notation), YAML, XML (eXtensible Markup Language)) or in a database so that it can be read and used when the application is started or running.
[0074] It should be noted that the first target business refers to various businesses that currently need to establish API call relationship tables, such as various risk controls and TPA claims.
[0075] See also Figure 2 , Figure 2 A method flow chart of a method for configuring a target network calling tool provided in an embodiment of the present application can be implemented through steps A1-A3:
[0076] A1: Get the interface ID and request method of the called interface.
[0077] To configure the target network calling tool, you first need to obtain the interface identity identifier (Identity, ID) of the called interface and its request method (such as GET, POST, etc.) for subsequent processing.
[0078] It should be noted that the interface ID is a unique number that identifies a specific interface and helps to easily locate and identify the interface when needed.
[0079] Request method: refers to the Hypertext Transfer Protocol (HTTP) request method, such as GET, POST, etc. This information is used to guide the network call tool on how to interact with the server.
[0080] A2: Annotate the request method of the called interface as the request method of the network calling tool forest, and use the interface ID of the called interface as the request ID of the network calling tool forest, thereby generating the target network calling tool.
[0081] The request method of the called interface is annotated as the request method of the network calling tool forest, and the interface ID is used as the request ID of the network calling tool forest, then the target network calling tool can be obtained.
[0082] For example, assuming that the target network calling tool used by the first target service determined from the configuration information may be:
[0083] @Post(url="dipint-a6012e30-4dca-47b9-a7a6-47baa58e559",conteneType="application / json).
[0084] It should be noted that request method annotations: When using programming languages such as JavaScript and Java, you can use annotations to specify the request method. For example, you can add annotations to the GET or POST method to indicate how the network calls the tool.
[0085] Request ID: By passing the interface ID as a parameter, context information can be provided inside the forest to ensure accurate identification and processing of data from different interfaces.
[0086] Network call tool forest: forest is a network call tool for simplifying API calls and data management. It provides an easy-to-use interface that allows developers to quickly make HTTP requests, process responses, and manage data status.
[0087] A3: Configure the target network calling tool in the configuration information of the first target service.
[0088] Finally, the created target network calling tool forest and the corresponding configuration information are integrated into the configuration information of the first target service, so as to ensure that the first target service correctly uses and calls the generated network calling tool.
[0089] S102: Scan the request method annotation and request ID of the target network calling tool.
[0090] Scanning the target network call tool's request method annotations and request IDs refers to inspecting and analyzing the target network call tool to determine the communication method (i.e., request method annotations) and unique identifier (i.e., request identifier ID) it uses. This process involves reviewing the tool's configuration or metadata to identify the method required when sending requests (such as GET, POST, etc.) and the unique identifier for each request.
[0091] For example, assume that the target network calling tool used by the first target service determined from the configuration information is:
[0092] @Post(url="dipint-a6012e30-4dca-47b9-a7a6-47baa58e559",conteneType="application / json).
[0093] Among them, Post is the request method annotation of the target network calling tool;
[0094] "dipint-a6012e30-4dca-47b9-a7a6-47baa58e559" is the request ID of the target network call tool.
[0095] S103: Based on the request mode annotation and request ID of the target network calling tool, determine the calling application program interface API information of the first target service from the internal interface information table and / or the external interface information table.
[0096] Based on the request method annotation and request ID of the target network calling tool, the calling API information related to the first target business can be extracted from the internal interface information table and / or the external interface information table. Specifically, the request method annotation provides the HTTP method required for the business, and the request ID is used to uniquely identify the specific interface to be called. By consulting the internal and external interface information tables, this process can confirm the corresponding interface name, interface description, interface path, interface system, interface protocol, interface domain name, and external interface calling environment.
[0097] If one or more request mode annotations and request IDs only appear in the internal interface information table, then only the calling API information related to the first target business is extracted from the internal interface information table.
[0098] If one or more request mode annotations and request IDs only appear in the external interface information table, then only the call API information related to the first target business is extracted from the external interface information table.
[0099] If multiple request method annotations and request IDs appear both in the internal interface information table and in the external interface information table, then it is necessary to extract the calling API information related to the first target business from both the internal interface information table and the external interface information table.
[0100] See also Figure 3 , Figure 3 A method flow chart of a method for constructing an internal interface information table provided in an embodiment of the present application can be implemented through steps B1-B3:
[0101] B1: In the API management service, call the swagger documents of all businesses through scheduled tasks.
[0102] To build the internal interface information table, you need to use the scheduled task function of the API management service to regularly retrieve API documents from services of different businesses. These documents are usually in the Swagger format, which provides descriptive data of the API, such as path, parameters, return type, etc., for easy understanding and use.
[0103] It should be noted that Swagger document is a standard format for describing, defining and displaying RESTful APIs (application programming interface). It allows developers to clearly understand how the API is designed, including specific routes, HTTP methods (such as GET, POST, etc.), request parameters, response formats, error handling and other information.
[0104] B2: Parse the swagger documents of all the businesses to obtain multiple internal API information.
[0105] When the API documents are successfully obtained, the parser will perform refined processing on these documents. The parser understands the document content based on the Swagger specification and extracts key information of each API, including but not limited to:
[0106] Internal interface ID: A unique identifier used to distinguish different APIs.
[0107] Internal interface name: The official name of the API, providing a clear description of the function.
[0108] Internal interface description: more detailed API functions and usage instructions.
[0109] Internal interface path: The URL or path of the API request, which is the main entry point for accessing the API.
[0110] Internal interface service: The service name to which the API belongs, which helps locate service-level permissions or dependencies.
[0111] Module to which the internal interface belongs: a functional module specific to the service, representing the business area that the API focuses on.
[0112] Internal interface request method: HTTP method, such as GET, POST, PUT, DELETE, etc.
[0113] Internal interface protocol: The protocol used for communication, which may include HTTPS, etc.
[0114] Internal interface domain name: the main domain name or subdomain name that provides services.
[0115] Internal interface call environment: the environment configuration where the API runs or is available, such as production, testing, development, etc.
[0116] B3: Based on the multiple pieces of internal API information, construct the internal interface information table.
[0117] Finally, all the extracted information will be integrated into an internal interface information table for administrators or developers to easily view and manage. This table is the central component of the system and is of great value for unified management, version control, and performance optimization. Figure 4 As shown, Figure 4 A schematic diagram of the structure of an internal interface information table provided in an embodiment of the present application.
[0118] In one possible implementation, when parsing new Swagger documents for all businesses, if new internal API information is found, the internal interface information table needs to be updated based on the new information. This means that the system will check the latest Swagger document and identify any newly added internal APIs. Then, for each new internal API, the system will perform the following steps to update the internal interface information table:
[0119] Add new internal API information: Add relevant information of the new internal API to the internal interface information table, including internal interface ID, name, description, path, service, module, request method, protocol, domain name, calling environment and other data.
[0120] Update existing information: If an existing internal API is changed, such as the path, description, or request method, the system will also update these fields accordingly to reflect the latest status.
[0121] Maintain consistency: Ensure that the data in the internal interface information table is always consistent with the actual business requirements and interface specifications so that the system can accurately access and call these internal APIs.
[0122] By updating the internal interface information table in a timely and accurate manner, the system can keep track of the latest internal APIs.
[0123] See also Figure 5 , Figure 5 A method flow chart of a method for constructing an external interface information table provided in an embodiment of the present application can be implemented through steps C1-C3:
[0124] C1: Get one or more external API information entered externally.
[0125] To build the external interface information table, you first need to collect external API information through external input. This may include receiving data directly from developers or service providers, crawling public API documents through crawlers, or obtaining information through internal service interfaces. For each external API record, the following fields should be included:
[0126] External interface name: Provide a clear, easy-to-understand API identifier.
[0127] External interface description: briefly describe the function and purpose of the API.
[0128] External interface path: The specific URL or endpoint of the API request.
[0129] System to which the external interface belongs: the name of the external system that the API runs or integrates.
[0130] External interface request method: HTTP method, such as GET, POST, PUT, DELETE, etc.
[0131] External interface protocol: The network protocol used to communicate with the API.
[0132] External interface domain name: the domain name or subdomain of the API server.
[0133] External interface calling environment: The availability status of the API in a specific environment (such as production, testing).
[0134] C2: Generate an external interface ID for each external API message.
[0135] To ensure that each piece of API information has a unique identifier, a unique external interface ID is generated for each API. This helps to quickly locate and manage the API in subsequent operations.
[0136] The ID format may contain numbers, letters, or a specific naming convention to improve its uniqueness and readability.
[0137] C3: constructing the external interface information table based on the one or more pieces of external API information and the external API information ID corresponding to each piece of external API information.
[0138] Based on the collected multiple external API information and the external API information ID corresponding to each piece of information, an external interface information table is constructed. This table will contain comprehensive information of all external interfaces, providing convenience for the management and integration of external interfaces. Figure 6 As shown, Figure 6 A schematic diagram of the structure of an external interface information table provided in an embodiment of the present application.
[0139] In one possible implementation, when new external API information is obtained, the external interface information table needs to be updated according to the new information. This means that the system will check the newly entered external API information and update the external interface information table according to the following steps:
[0140] New external API information: The system will add new external API information to the external interface information table, including external interface name, description, path, system, request method, protocol, domain name, calling environment and other related data.
[0141] Update existing information: If an existing external API is changed, such as a change in description, path, or request method, the system will update these fields accordingly to ensure that the information in the table is consistent with the latest entered data.
[0142] Maintain data consistency: The system ensures that the data in the external interface information table is consistent with the actual external API information entered, so that the system can accurately access and call these external interfaces.
[0143] By regularly checking and updating the external interface information table, the system can track changes in external APIs in real time to ensure that the management and calls of external interfaces are always up to date.
[0144] S104: Establish an API call relationship table based on the service name of the first target service and the calling API information of the first target service.
[0145] After determining the calling API information of the first target service from the internal interface information table and the external interface information table, an API calling relationship table may be constructed based on the information and in combination with the service name of the first target service.
[0146] The API call relationship table shows the business name of each type of target business, the called interface ID, the called interface name, the called interface path, the system or module to which the called interface belongs, and whether it is an external interface.
[0147] See also Figure 7 , Figure 7 A structural diagram of an API call relationship table provided in an embodiment of the present application. Figure 7The API call relationship table shown not only covers the API call relationship of the first target business, but also covers the API call relationship of multiple target businesses. The target business refers to various types of business in the target system group (eg, the system group of an insurance company).
[0148] In a possible implementation, the method further includes:
[0149] In response to the interface path call request sent by the second target service through the gateway service, it is identified whether the second target service in the API call relationship table corresponds to the target interface path in the interface path call request. If so, the interface corresponding to the target interface path is forwarded to the second target service.
[0150] Specifically, initiating a request: the second target business sends an interface path call request to the gateway service, which usually includes information such as the specific API path and parameters that the business needs to access.
[0151] Parsing the request: After receiving the request, the gateway service will first parse the key information in the request, mainly including the target interface path of the request.
[0152] Query the API call relationship table: The gateway service then retrieves its internal API call relationship table (also called API mapping table, routing table, etc.). This table contains the association information between all known interfaces and their actual processing logic, that is, which interface is called through the internal path, and their correspondence with the external request path.
[0153] One-to-one correspondence check: The gateway service compares the parsed request interface path with the records in the API call relationship table to confirm whether there is a one-to-one mapping relationship. This one-to-one correspondence means that the external interface path of the request is directly associated with the internal processing interface or logic.
[0154] Interface forwarding: If the requested interface path matches a record in the table, it means that a clear interface mapping relationship has been found. At this time, the gateway service will perform the interface forwarding operation and forward the request to the corresponding internal interface or service intact or with slight adjustments as needed. This step ensures that the original request can be processed correctly by the system.
[0155] Response processing: The internal interface returns the results after processing the request. After receiving these results, the gateway service encapsulates them in an appropriate form and returns them to the original requester, completing the entire call process.
[0156] This process is crucial to realizing the function of API gateway, which is responsible for transferring requests between multiple layers of services, while providing additional service features such as authentication, current limiting, monitoring and traffic scheduling, which enhances the flexibility, security and stability of the system.
[0157] Based on the contents of S101-S104, it can be known that the configuration information of the first target business is first obtained, and the target network calling tool used by the first target business is determined through the configuration information of the first target business. Scan the request method annotation and request identity ID of the target network calling tool, and on this basis, determine the calling API information of the target business from the internal and external interface information table, and establish an API calling relationship table based on the name of the target business and its calling API information. The present application can automatically create an API calling relationship table, display the connection between each API, help managers understand the usage of APIs in the system more clearly, and improve work efficiency. By establishing a calling relationship table through an automated process, human intervention is reduced and the error rate is reduced, thereby improving data accuracy and reducing the risk of errors in the API management process.
[0158] See also Figure 8 , Figure 8 A schematic diagram of a structure of a device for constructing a call relationship table provided in an embodiment of the present application. Figure 8 As shown, the construction device of the call relationship table includes:
[0159] A first acquisition unit 801 is used to acquire configuration information of a first target service;
[0160] A first determining unit 802 is used to determine a target network calling tool used by the first target service from the configuration information;
[0161] A scanning unit 803, used to scan the request method annotation and request ID of the target network calling tool;
[0162] A second determining unit 804 is configured to determine the calling application program interface API information of the first target service from an internal interface information table and / or an external interface information table based on the request mode annotation and request ID of the target network calling tool;
[0163] The API call relationship table establishing unit 805 is used to establish an API call relationship table based on the service name of the first target service and the calling API information of the first target service.
[0164] In a possible implementation manner, the device further includes:
[0165] The calling unit is used to call the period solution swagger document of all businesses through scheduled tasks in the API management service;
[0166] A parsing unit, used to parse the swagger documents of all the businesses to obtain multiple internal API information; each internal API information includes an internal interface ID, an internal interface name, an internal interface description, an internal interface path, an internal interface service, an internal interface module, an internal interface request method, an internal interface protocol, an internal interface domain name, and an internal interface calling environment;
[0167] An internal interface information table construction unit, used to construct the internal interface information table based on the multiple pieces of internal API information;
[0168] Wherein, when parsing the new swagger document of all the services, if there is new internal API information, the internal interface information table is updated based on the new internal API information.
[0169] In a possible implementation manner, the device further includes:
[0170] The second acquisition unit is used to acquire one or more external API information entered externally; the external API information includes the external interface name, external interface description, external interface path, external interface belonging system, external interface request method, external interface protocol, external interface domain name and external interface calling environment;
[0171] An external interface ID generating unit, used to generate an external interface ID for each piece of external API information;
[0172] An external interface information table construction unit, configured to construct the external interface information table based on the one or more pieces of external API information and the external API information ID corresponding to each piece of external API information;
[0173] When new external API information input from the outside is obtained, the external interface information table is updated based on the new external API information.
[0174] In a possible implementation manner, the device further includes:
[0175] an identification unit, in response to an interface path call request sent by the second target service through the gateway service, for identifying whether the second target service in the API call relationship table corresponds one-to-one to the target interface path in the interface path call request;
[0176] The forwarding unit is used to forward the interface corresponding to the target interface path to the second target service.
[0177] In a possible implementation manner, the device further includes:
[0178] A third acquisition unit is used to acquire the interface ID and request method of the called interface;
[0179] A setting unit, used to annotate the request mode of the called interface as the request mode of the network calling tool forest, and use the interface ID of the called interface as the request ID of the network calling tool forest, thereby generating the target network calling tool;
[0180] A configuration unit is used to configure the target network calling tool in the configuration information of the first target service.
[0181] In addition, an embodiment of the present application also provides a device for constructing a call relationship table, including: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the method for constructing a call relationship table as described above is implemented.
[0182] In addition, an embodiment of the present application further provides a computer-readable storage medium, in which instructions are stored. When the instructions are executed on a terminal device, the terminal device executes the method for constructing a call relationship table as described above.
[0183] The embodiment of the present application provides a device for constructing a call relationship table, first using a first acquisition unit 801 to obtain the configuration information of the first target business, and using a first determination unit 802 to determine the target network call tool used by the first target business from the configuration information. The scanning unit 803 scans the request method annotation and request ID of the target network call tool. Then, the second determination unit 804 is used to determine the calling application program interface API information of the first target business from the internal interface information table and the external interface information table based on the request method annotation and request ID of the target network call tool, so that the API call relationship table establishment unit 805 establishes an API call relationship table based on the business name of the first target business and the calling API information of the first target business. The present application can generate an intuitive and detailed API call relationship table, clearly showing the mutual call status between each API. This mechanism greatly simplifies the process of API management, so that system managers can quickly obtain the usage of each API without communicating with developers, significantly improving work efficiency. More importantly, through the construction of a fully automated process, the intervention of human operations is reduced, and the risk of inaccurate data or management errors caused by human errors is effectively reduced. This not only ensures the high accuracy of the data, but also further controls the error rate in the management process.
[0184] The above is a detailed introduction to a method, device, equipment and storage medium for constructing a call relationship table provided by the present application. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.
[0185] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0186] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article 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, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
Claims
1. A method for constructing a call relationship table, characterized in that: The method comprises: Acquire configuration information of a first target service, and determine a target network calling tool used by the first target service from the configuration information; Scan the request method annotation and request identity identifier ID of the target network calling tool; Determine the calling application program interface API information of the first target service from the internal interface information table and / or the external interface information table based on the request mode annotation and the request ID of the target network calling tool; An API call relationship table is established based on the service name of the first target service and the calling API information of the first target service.
2. The method according to claim 1, characterized in that The construction process of the internal interface information table includes: In the API management service, call the period solution swagger document of all businesses through scheduled tasks; Parse the swagger documents of all the businesses to obtain multiple internal API information; each internal API information includes an internal interface ID, an internal interface name, an internal interface description, an internal interface path, an internal interface service, an internal interface module, an internal interface request method, an internal interface protocol, an internal interface domain name, and an internal interface calling environment; Based on the multiple pieces of internal API information, construct the internal interface information table; Wherein, when parsing the new swagger document of all the services, if there is new internal API information, the internal interface information table is updated based on the new internal API information.
3. The method according to claim 1, characterized in that The construction process of the external interface information table includes: Obtain one or more external API information entered externally; the external API information includes the external interface name, external interface description, external interface path, the system to which the external interface belongs, the external interface request method, the external interface protocol, the external interface domain name, and the external interface calling environment; Generate an external interface ID for each external API message; Constructing the external interface information table based on the one or more pieces of external API information and the external API information ID corresponding to each piece of external API information; When new external API information input from the outside is obtained, the external interface information table is updated based on the new external API information.
4. The method according to claim 1, characterized in that: The method further comprises: In response to the interface path calling request sent by the second target service through the gateway service, identifying whether the second target service in the API calling relationship table corresponds one-to-one to the target interface path in the interface path calling request; If so, the interface corresponding to the target interface path is forwarded to the second target service.
5. The method according to claim 1, characterized in that The configuration process of the target network calling tool includes: Get the interface ID and request method of the called interface; Annotating the request method of the called interface as the request method of the network calling tool forest, and using the interface ID of the called interface as the request ID of the network calling tool forest, thereby generating the target network calling tool; The target network calling tool is configured in the configuration information of the first target service.
6. A device for constructing an API call relationship table, characterized in that: The device comprises: A first acquisition unit, used to acquire configuration information of a first target service; A first determining unit, configured to determine a target network calling tool used by the first target service from the configuration information; A scanning unit, used for scanning the request method annotation and request identity identifier ID of the target network calling tool; A second determining unit, configured to determine the calling application program interface API information of the first target service from an internal interface information table and / or an external interface information table based on the request mode annotation and the request ID of the target network calling tool; The API call relationship table establishing unit is used to establish an API call relationship table based on the service name of the first target service and the calling API information of the first target service.
7. The device according to claim 6, characterized in that The device also includes: The calling unit is used to call the period solution swagger document of all businesses through scheduled tasks in the API management service; A parsing unit, used to parse the swagger documents of all the businesses to obtain multiple internal API information; each internal API information includes an internal interface ID, an internal interface name, an internal interface description, an internal interface path, an internal interface service, an internal interface module, an internal interface request method, an internal interface protocol, an internal interface domain name, and an internal interface calling environment; An internal interface information table construction unit, used to construct the internal interface information table based on the multiple pieces of internal API information; Wherein, when parsing the new swagger document of all the services, if there is new internal API information, the internal interface information table is updated based on the new internal API information.
8. The device according to claim 6, characterized in that The device also includes: The second acquisition unit is used to acquire one or more external API information entered externally; the external API information includes the external interface name, external interface description, external interface path, external interface belonging system, external interface request method, external interface protocol, external interface domain name and external interface calling environment; An external interface ID generating unit, used to generate an external interface ID for each piece of external API information; An external interface information table construction unit, configured to construct the external interface information table based on the one or more pieces of external API information and the external API information ID corresponding to each piece of external API information; When new external API information input from the outside is obtained, the external interface information table is updated based on the new external API information.
9. A device for constructing a call relationship table, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for constructing a call relationship table according to any one of claims 1 to 5 is implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed on a terminal device, the terminal device executes the method for constructing a call relationship table according to any one of claims 1 to 5.