API intelligent management method and device, storage medium and computer equipment

Through the knowledge graph-driven document generation and generation adversarial network test case generator, combined with deep learning analysis, the problems of inaccurate information, untimely updates and low debugging efficiency in API management are solved, and the accurate and timely updates and testing of API documents are achieved. comprehensiveness and depth.

CN118964218AInactive Publication Date: 2024-11-15NETTHINK TECH CO LTD

Patent Information

Application Number
CN202411442843.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-16
Publication Date
2024-11-15
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing API management methods have problems such as inaccurate information, untimely updates, low debugging efficiency and limited testing coverage, which is difficult to ensure the accuracy of information, timely updates, efficient debugging, and comprehensiveness and in-depth testing.

Method used

Generate API documents using a pre-trained knowledge graph-driven document generation model, generate test cases based on the test case generator of the generative adversarial network, and analyze debugging data through deep learning and machine learning, generate risk assessment results and debugging suggestions, and update the API in real time document.

Benefits of technology

It improves the accuracy and timeliness of API documents, improves debugging efficiency, enhances the coverage and depth of tests, can locate and solve problems more quickly, and reduces the in-depth understanding of system code and manual operation requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118964218A_ABST
    Figure CN118964218A_ABST
Patent Text Reader

Abstract

In the API intelligent management method and device, the storage medium and the computer equipment provided by the invention, in response to an API registration request, API definition data used for API registration are obtained, key features are extracted from the API definition data, then API registration is carried out, and a target API is obtained; according to the API definition data, generating an API document by adopting a document generation model driven by a knowledge graph; generating an API test case by adopting a test case generator based on a generative adversarial network according to the API document, and executing the API test case according to the test strategy to obtain a test result of the target API; when the test result is not consistent with the expected result and the target API is debugged, analyzing debugging data of the target API and generating a risk assessment result and a debugging suggestion; and if the target API starts to run after being debugged, updating the API document according to the running data of the target API. Therefore, the API can be effectively managed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to an API intelligent management method, device, storage medium and computer equipment. Background Art

[0002] In the modern software development process, API (Application Programming Interface) plays a vital role as a bridge between different software components, facilitating the interoperability and modularity of the system. However, with the increasing complexity of software systems, API management also faces many challenges. Currently, API management mainly relies on manual documentation, code-based debugging, and simple automated testing tools.

[0003] However, each of these methods has obvious shortcomings. First, although manual documentation can provide a detailed functional description of the API, this method is prone to inaccurate, incomplete, and untimely updates. Second, code-based debugging methods require developers to have a deep understanding of the system code and insert print statements or use debugging tools to track the execution process and intermediate results of the API. This method is inefficient, especially when faced with complex systems. It is difficult to quickly locate problems and solve them effectively. Finally, although simple automated testing tools can perform basic functional testing on APIs, their test scenario coverage is limited and they cannot perform comprehensive and in-depth testing on APIs.

[0004] Therefore, the problem faced by existing API management methods is how to effectively manage APIs to ensure the accuracy of information, timely updating, efficient debugging, and comprehensiveness and depth of testing. Summary of the invention

[0005] The purpose of this application is to solve at least one of the above-mentioned technical defects, especially the technical defects in the prior art of how to effectively manage APIs to ensure the accuracy of information, timely updating, efficient debugging, and comprehensiveness and depth of testing.

[0006] In a first aspect, the present application provides an API intelligent management method, the method comprising:

[0007] In response to the API registration request, obtain API definition data for API registration, extract key features from the API definition data, perform API registration, and obtain a target API;

[0008] Generate API documentation based on API definition data using a pre-trained knowledge graph-driven document generation model;

[0009] Generate API test cases based on API documents using a test case generator based on a generative adversarial network, and execute the API test cases according to a predetermined test strategy to obtain test results for the target API.

[0010] When the test results do not match the expected results, when debugging the target API, analyze the debugging data of the target API and generate risk assessment results and debugging suggestions;

[0011] If the target API starts running after debugging, update the API document based on the running data of the target API.

[0012] In one embodiment, the step of obtaining API definition data for API registration includes:

[0013] Obtain natural language used to describe the API and use a natural language model to analyze the natural language to identify API registration intent;

[0014] Extract key information from natural language based on API registration intent, and initiate an inquiry dialogue based on the key information and preset API definition template to obtain complete information required for API registration;

[0015] Build API definition data based on the answers and key information from the inquiry dialogue.

[0016] In one embodiment, the training process of the knowledge graph-driven document generation model includes:

[0017] Get multiple API definition sample data;

[0018] Identify multiple entity data and the relationship between each entity data from each API definition sample data, and build an API knowledge graph based on each entity data and the relationship between each entity data;

[0019] Extract the feature vector of each API definition sample data;

[0020] The graph neural network model is trained according to the API knowledge graph and each feature vector, and the trained graph neural network model is evaluated according to the generated sample API document until the trained graph neural network model reaches the preset training end condition to obtain a knowledge graph-driven document generation model.

[0021] In one embodiment, the process of determining the test strategy includes:

[0022] According to the API definition data and preset business logic, a test strategy model based on deep reinforcement learning is used to generate test strategies.

[0023] In one embodiment, the step of analyzing API debugging data and generating risk assessment results and debugging recommendations includes:

[0024] When it is determined that there is an error code in the API debugging data, the error type of the target API is determined according to a pre-established error type library, and the error log of the target API is obtained;

[0025] Generate debugging suggestions based on the error type and error log of the target API using a machine learning-based error analysis model.

[0026] Extract error data, call data, and performance data from API debug data;

[0027] Based on API definition data, error data, call data and performance data, a deep learning-based risk assessment model is used to generate risk assessment results.

[0028] In one embodiment, the method further comprises:

[0029] The target API is monitored through a lightweight monitoring agent, which is deployed on key nodes of the API server and network transmission paths.

[0030] In one embodiment, the method further comprises:

[0031] When the target API version changes, detect the difference between the target API before and after the version change, and update the corresponding API documentation and API test cases.

[0032] In a second aspect, the present application provides an API intelligent management device, the device comprising:

[0033] The target API acquisition module is used to respond to the API registration request, acquire API definition data used for API registration, and perform API registration after extracting key features from the API definition data to obtain the target API;

[0034] API document generation module, which is used to generate API documents based on API definition data using a pre-trained knowledge graph-driven document generation model;

[0035] A test result acquisition module is used to generate API test cases according to the API document using a test case generator based on a generative adversarial network, and execute the API test cases according to a predetermined test strategy to obtain the test results of the target API;

[0036] The risk assessment result generation module is used to analyze the debugging data of the target API and generate risk assessment results and debugging suggestions when the test results do not match the expected results and the target API is debugged;

[0037] The API document update module is used to update the API document according to the running data of the target API when the target API starts running after debugging.

[0038] In a third aspect, the present application provides a storage medium: the storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the API intelligent management method in any of the above embodiments.

[0039] In a fourth aspect, the present application provides a computer device, comprising: one or more processors, and a memory;

[0040] Computer-readable instructions are stored in the memory. When the computer-readable instructions are executed by one or more processors, the steps of the API intelligent management method in any of the above embodiments are performed.

[0041] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:

[0042] In the API intelligent management method, device, storage medium and computer equipment provided in this application, by using a pre-trained knowledge graph-driven document generation model, documents are automatically generated from API definition data to ensure the accuracy and timeliness of the document content. At the same time, by continuously updating the document during the operation of the API, the delays and errors caused by manual maintenance can be avoided. When the test results do not meet expectations, the debugging data is automatically analyzed to generate debugging suggestions and risk assessment results, which greatly improves the efficiency of debugging and reduces the need for developers to have an in-depth understanding of the system code and manual operations, so that problems can be located more quickly and solutions can be provided. The use of a test case generator based on a generative adversarial network can generate more diverse and complex test scenarios, making the coverage of API testing wider, the test results more comprehensive and in-depth, and helping to discover hidden potential problems. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the embodiments of the present application or the technical solutions in 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 paying creative labor.

[0044] Figure 1 A flowchart of an API intelligent management method provided in an embodiment of the present application;

[0045] Figure 2 An example diagram of a knowledge graph-driven document generation model provided in an embodiment of the present application;

[0046] Figure 3 An example diagram of an API intelligent management system provided in an embodiment of the present application;

[0047] Figure 4 A schematic diagram of the structure of the API intelligent management device provided in the embodiment of the present application;

[0048] Figure 5 A schematic diagram of the internal structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0049] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions 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 are within the scope of protection of this application.

[0050] The present application provides an API intelligent management method. The following embodiments are described by taking the method applied to a computer device as an example. It can be understood that the computer device can be any device with data processing functions, including but not limited to a single server, a server cluster, a personal laptop computer, a desktop computer, etc. Figure 1 As shown, the method includes:

[0051] S101: In response to an API registration request, obtain API definition data for API registration, extract key features from the API definition data, perform API registration, and obtain a target API.

[0052] Among them, API is a set of definitions, protocols, and tools used to build communications between software applications, allowing different software applications to interact through a defined request / response protocol. The API registration request is intended to register new API information to a platform or system so that other developers or systems can recognize and use this API. The API definition data contains detailed information and specifications of the API, such as the API URL, request method (GET, POST, etc.), request parameters, response format, authentication method, etc. Key features: refers to information in the API definition data that is critical to the API registration process, such as API name, version, security requirements, resource path, etc. The target API is an API that has been registered and successfully added to the registration center or management platform, and other systems or developers can call it in a standard way.

[0053] In this step, when an API registration request is received, the API definition data is received and parsed to ensure that it complies with the expected format and specifications. The API definition data is traversed to extract key information such as API name, version number, request path, request method, security requirements, response format, etc. Using the extracted key features, a new API entry is created in the API management system. The metadata of the API is configured, such as description, tags, document links, etc. The access rights and security policies of the API are set. After the registration is completed, the unique identifier and status information of the API can be returned.

[0054] S102: Generate API documentation based on the API definition data using a pre-trained knowledge graph-driven document generation model.

[0055] Among them, knowledge graph is a structured data representation method used to store and express the relationship between entities.

[0056] In this step, the knowledge graph can contain relevant knowledge in the API field, such as API types, common parameters, error codes, etc. The pre-trained knowledge graph-driven document generation model is a machine learning model that uses a pre-trained model and knowledge graph to automatically generate documents. The model can understand the API definition data and combine the information in the knowledge graph to generate a well-structured and rich API document. API documentation is a document that describes how an API is used and works, and usually includes information such as an overview of the API, request examples, response formats, error handling, and authentication requirements.

[0057] In this step, the pre-built knowledge graph is loaded, the API definition data is converted into a format that the model can understand, the pre-processed API definition data is input into the pre-trained document generation model, and the API document is automatically generated using the information in the API definition data and the knowledge graph.

[0058] It can be understood that the use of automated document generation methods can significantly improve the efficiency of document generation and reduce the time and cost of manual document writing. The pre-trained knowledge graph-driven document generation model can generate high-quality documents based on a large amount of data and knowledge, reducing human errors and omissions.

[0059] S103: Generate API test cases according to the API document using a test case generator based on a generative adversarial network, and execute the API test cases according to a predetermined test strategy to obtain a test result of the target API.

[0060] Among them, Generative Adversarial Networks (GAN) is a deep learning model that generates realistic data through the competition between generators and discriminators. In test case generation, GAN can be used to generate diverse and unpredictable test inputs. The test case generator is a tool that automatically generates test cases based on a specific algorithm or model, and uses GAN to generate test cases for APIs. The test strategy is the principles and methods that guide the testing process, including the scope, sequence, conditions, etc. of the test. The predetermined test strategy helps ensure the comprehensiveness and effectiveness of the test. API test cases are test cases designed for APIs to verify whether the API's functions, performance, security, etc. meet expectations. The test results are the output obtained after executing the test case, which is used to evaluate the quality of the API.

[0061] In this step, read the API document, parse its content, extract key information such as API input and output specifications, request methods, parameter lists, response formats, etc., and use the trained GAN model to generate new test cases that cover various possible inputs and boundary conditions of the API while maintaining a certain degree of novelty and diversity. Load the predetermined test strategy, including requirements for test order, concurrency, error handling, etc. Use appropriate testing tools or frameworks (such as Postman, JMeter, etc.) to execute the generated API test cases. Record the execution results of each test case, including key information such as request time, response status code, response content, etc.

[0062] Specifically, for the test case generator, first, load the existing valid test case samples into the memory. These samples will be used as input data for GAN model training, and organize the boundary values ​​and outlier ranges of the API. According to the characteristics of the API documentation and the dataset, configure the generator and discriminator of the GAN model. The generator is responsible for generating new test cases, while the discriminator is responsible for evaluating the similarity between these test cases and real test cases. Set the training parameters of the model, such as learning rate, number of iterations, batch size, etc. Use the existing valid test case samples as training data to start the training process of the GAN model. During the training process, the generator continuously tries to generate new test cases, while the discriminator continuously evaluates the authenticity of these test cases. The two gradually improve the quality and diversity of generated test cases through mutual competition.

[0063] Furthermore, test execution data is collected and recorded in real time, such as response time, resource consumption, and real-time load of the system. Real-time data is analyzed using machine learning models to dynamically adjust test execution parameters and strategies to improve test execution efficiency and resource utilization. Anomalies in test execution, such as long response time and abnormal resource consumption, are detected through machine learning models, and timely alarms or corresponding measures are taken. The execution results of each test case are recorded in detail, including key information such as request time, response status code, and response content. Natural language processing and knowledge graph technology are used to automatically understand and parse test results. Test results are associated with the system's knowledge base and problem solution library to identify potential problems and corresponding solutions. The analysis results are converted into easy-to-understand reports, including test overview, test result summary, problem analysis, and solution recommendations.

[0064] It can be understood that the test cases generated by GAN are diverse and unpredictable, which helps to discover potential problems in APIs and improve the coverage and effectiveness of tests.

[0065] S104: When the test result does not match the expected result, when debugging the target API, the debugging data of the target API is analyzed and a risk assessment result and debugging suggestions are generated.

[0066] Among them, the expected result is the expected output defined according to the API specification or business logic before testing. Debugging is the process of locating and solving problems or errors in software. Debugging data is information collected during debugging and used to analyze the behavior and causes of errors in the API. Risk assessment results are an assessment of the possible impact and consequences of problems found in the API. Debugging suggestions are solutions or improvement suggestions for the problems found.

[0067] In this step, when the test results do not match the expected results, the debugging process is automatically started. First, the debugging data generated by the API during the test execution process is deeply collected and analyzed, including but not limited to response time, resource consumption, system logs, and any exception information. Subsequently, the collected data is thoroughly analyzed using built-in algorithms and machine learning models to identify the specific reasons that caused the deviation in the test results. On this basis, the impact scope and potential risks of the problem are comprehensively evaluated to generate risk assessment results, clearly pointing out the severity of the problem and the possible consequences. Finally, based on the analysis results, debugging suggestions are put forward, including modifying the API configuration, optimizing the code logic, adding exception handling mechanisms, etc., to guide developers to quickly locate and solve problems and ensure that the stability and performance of the API meet expectations.

[0068] S105: When the target API starts running after debugging is completed, the API document is updated according to the running data of the target API.

[0069] Among them, operation data refers to the data generated by the API during normal operation, including but not limited to performance indicators, user interaction records, error logs, etc.

[0070] In this step, when the target API is debugged and successfully deployed, its operation data is automatically collected and analyzed, including performance monitoring indicators, user request processing, exception records, etc. Based on this data, changes in API behavior and potential improvements are identified. Subsequently, these changes and newly discovered information are integrated into the API documentation, and the interface description, parameter description, error handling suggestions, etc. are updated to ensure that the documentation is consistent with the actual operation status of the API.

[0071] It is understandable that API documentation is an important basis for users to understand and use APIs. As APIs are debugged and updated, their functions and behaviors may change, so the documentation needs to be updated in a timely manner to reflect these changes.

[0072] In the above embodiment, by using a pre-trained knowledge graph-driven document generation model, documents are automatically generated from API definition data to ensure the accuracy and timeliness of the document content. At the same time, by continuously updating the documents during the API operation process, the delays and errors caused by manual maintenance can be avoided. When the test results do not meet expectations, the debugging data is automatically analyzed to generate debugging suggestions and risk assessment results, which greatly improves the efficiency of debugging and reduces the need for developers to have an in-depth understanding of the system code and manual operations, so that problems can be located more quickly and solutions can be provided. The use of a test case generator based on a generative adversarial network can generate more diverse and complex test scenarios, making the API test coverage wider, the test results more comprehensive and in-depth, and helping to discover hidden potential problems.

[0073] In one embodiment, the step of obtaining API definition data for API registration includes:

[0074] Obtain natural language used to describe the API and use a natural language model to analyze the natural language to identify API registration intent;

[0075] Extract key information from natural language based on API registration intent, and initiate an inquiry dialogue based on the key information and preset API definition template to obtain complete information required for API registration;

[0076] Build API definition data based on the answers and key information from the inquiry dialogue.

[0077] Among them, natural language is the language used by humans, such as Chinese, English, etc., which is used to describe the functions and uses of APIs. The natural language model can understand and analyze natural language text and extract semantic information from it. API registration intent is extracted from the natural language description, which is the clear purpose or requirement for registering the API. Key information is the information points identified from the natural language description that are critical to the API registration process, such as API name, service type, etc. The preset API definition template is a predefined template that contains the information fields required for API definition, which is used to guide information collection and the construction of API definition. Inquiry dialogue is an interactive method that collects additional or missing information through questions and answers to meet the needs of API registration.

[0078] Specifically, it first receives the natural language text used to describe the API, and then uses the built-in natural language model to analyze the text to identify the user's API registration intention. Then, based on the identified registration intention, key information is extracted from the text, such as the name and purpose of the API. Subsequently, using this key information and the preset API definition template, a series of inquiry dialogues are automatically generated to further obtain the complete information required for API registration. Finally, based on the answers to the inquiry dialogue and the key information extracted previously, the complete API definition data is constructed.

[0079] In one example, intelligent dialogue can be introduced, and developers only need to describe the expected functions and basic requirements of the API in natural language. Using natural language processing technology and pre-trained language models, the developer's intentions are understood, and the developer is gradually guided to clarify the key information of the API, such as name, path, request method, parameters, etc. For example, the developer enters: "I want to create an API to obtain user information, support the GET method, and require the user ID as a parameter." After that, further details are asked, such as the data type of the user ID, whether there are other optional parameters, etc., and finally a complete and accurate API definition is generated.

[0080] In another example, a machine learning algorithm is used to extract and analyze features of the API descriptions provided by developers. By learning from a large amount of existing API definition data, the model can automatically identify and extract the key features of the API and automatically register it based on these features. At the same time, the API is classified and labeled based on the extracted features to facilitate subsequent management and retrieval. For example, for an API used to obtain product details, the system will automatically classify it into the "Product Management" category and label relevant keywords such as "product", "details", "obtain", etc.

[0081] Furthermore, in another example, after the developer completes the API definition and registration, real-time intelligent verification is immediately performed. The accuracy and completeness of the API definition are ensured by simulating calls and performing logical checks on the defined parameters, methods, etc. If potential problems or irregularities are found, detailed optimization suggestions and examples are provided to help developers correct and improve the API definition in a timely manner. For example, the developer is prompted that the value range of a certain parameter is set unreasonably, or a more efficient request method is recommended. In addition, suitable API definition templates can be adaptively recommended based on the developer's historical operations and preferences, as well as the currently defined API types and functions. These templates are based on the study and summary of a large number of excellent API designs, and can provide reference and inspiration for developers to improve the quality and efficiency of API definitions. For example, if a developer is defining an API related to user authentication, the system will recommend related common parameter settings, return value formats, and error handling methods.

[0082] In this embodiment, through natural language analysis and inquiry dialogue, it is possible to ensure that accurate and complete API definition information is collected from users to avoid omissions or misunderstandings. Automatically identifying registration intentions, extracting key information, and initiating inquiry dialogues can greatly shorten the process and time of API registration.

[0083] In one embodiment, the training process of the knowledge graph-driven document generation model includes:

[0084] Get multiple API definition sample data;

[0085] Identify multiple entity data and the relationship between each entity data from each API definition sample data, and build an API knowledge graph based on each entity data and the relationship between each entity data;

[0086] Extract the feature vector of each API definition sample data;

[0087] The graph neural network model is trained according to the API knowledge graph and each feature vector, and the trained graph neural network model is evaluated according to the generated sample API document until the trained graph neural network model reaches the preset training end condition to obtain a knowledge graph-driven document generation model.

[0088] Among them, API definition sample data refers to sample data containing detailed information of the API, usually including the name, description, request parameters, response format, etc. of the API. Entity data refers to data items in the API definition that can be independently identified and have clear meanings, such as API name, request method, parameter type, etc. The connection or interaction between entity data, such as the association between parameters and APIs, the correspondence between request methods and responses, etc. The API knowledge graph is a graph structure built based on the entity data in the API definition and the relationship between them, which is used to represent the complex information and structure of the API. The feature vector is a numerical vector used to represent the key features or attributes of the API definition sample data, which is convenient for machine learning model processing. The graph neural network model is a neural network model that can process graph structure data and is suitable for processing graph data such as API knowledge graphs. The preset training end condition is the stop condition set during the model training process, such as reaching a certain accuracy rate, number of iterations, or training time.

[0089] Specifically, first, multiple API definition sample data are obtained from the data source. Next, each API definition sample data is parsed to identify the entity data therein, such as API name, parameters, etc., as well as the relationship between these entity data, such as the association between parameters and APIs. Based on this information, an API knowledge graph is constructed, in which nodes represent entity data and edges represent the relationship between entities. Subsequently, the feature vector of each API definition sample data is extracted to represent the key information of the API and used as the input of the graph neural network model.

[0090] After preparing the data and model input, start training the graph neural network model. During the training process, the model will learn how to generate documents describing the API based on the API knowledge graph and feature vectors. In order to evaluate the performance of the model, the generated sample API documents can be compared with the real API documents, and the corresponding evaluation indicators such as accuracy and recall can be calculated. In an example, the evaluation of the sample API document can be document accuracy, which indicates the degree of conformity between the document content and the actual functions of the API, calculated as the number of correctly described API features / total number of API features; it can also be document completeness, which indicates the comprehensiveness of the document covering the key information of the API, calculated as the number of key information contained in the document / the number of key information expected to be included; it can also be document logic, which indicates whether the organization and presentation of the document content have a clear logical structure, which can be scored by the logical rationality of expert evaluation or user feedback.

[0091] The training process will continue until the model reaches the preset training end conditions. These conditions may include the model's performance on the validation set reaching a preset threshold, the number of training iterations reaching an upper limit, or the training time exceeding a limit. Once these conditions are met, the training process will stop and the final knowledge graph-driven document generation model will be obtained.

[0092] In one example, if Figure 2 As shown in the figure, the model builds a text graph based on API relationships, deeply mines the inherent logic and association relationships in the knowledge graph, and combines the text sequence mining capability of the BERT model and the knowledge fusion capability of the graph neural network to learn and reason about the knowledge graph, thereby generating more structured and logical API document content.

[0093] It can be understood that by obtaining and analyzing API definition sample data, we can deeply understand the structure and characteristics of the API; by building an API knowledge graph, complex API information can be represented in the form of a graph structure to facilitate model learning; by extracting feature vectors and training graph neural network models, the model can learn the mapping relationship from the API knowledge graph to the API document; finally, by evaluating and adjusting the model, it can be ensured that the generated API document has high accuracy and practicality.

[0094] In this embodiment, since the API document is automatically generated based on the API definition data, the consistency of the document content and the API implementation can be ensured, reducing errors caused by human negligence. When the API changes, only the API definition data needs to be updated and the model retrained to quickly generate a new API document without manually modifying a large amount of text. At the same time, the automated generation of API documents can greatly reduce the time and cost of manually writing documents.

[0095] In one embodiment, the process of determining the test strategy includes:

[0096] According to the API definition data and preset business logic, a test strategy model based on deep reinforcement learning is used to generate test strategies.

[0097] Among them, the preset business logic is the business process, rules or conditions pre-defined during system design, which is used to guide how the API generates specific outputs or responses based on input data. Deep reinforcement learning is a method that combines deep learning and reinforcement learning. It allows the intelligent agent to continuously learn through trial and error in the environment, with the goal of maximizing cumulative rewards, so as to learn the optimal behavior strategy. The test strategy model is a model built based on deep reinforcement learning. It is used to generate strategies or methods that should be followed when testing APIs, aiming to efficiently discover potential errors or situations that do not conform to the preset business logic.

[0098] Specifically, the API definition data and preset business logic are first received and parsed. Next, the deep reinforcement learning test strategy model is initialized using this data. During the model training process, the model simulates the execution of API tests and evaluates the test results. It continuously adjusts its strategy based on feedback and selects test methods that are more likely to find problems. As the training progresses, the model will gradually learn the optimal test strategy. Finally, when the model converges to a stable state, the test strategy generated by the model is used as the final output. These test strategies will guide subsequent API testing work to ensure that the tests can comprehensively and efficiently cover the various functions and business logic of the API.

[0099] It can be understood that deep reinforcement learning technology can automatically generate efficient and comprehensive testing strategies, improve the pertinence and effectiveness of testing, reduce manual intervention and errors, and speed up testing to ensure that the quality of the API meets expectations.

[0100] In this embodiment, deep reinforcement learning technology is used to automatically generate test strategies, which can automatically learn the optimal test methods from complex API definition data and business logic, significantly improving the efficiency and accuracy of the test. The automated test strategy generation method reduces the time and cost of manually formulating test strategies, while more comprehensively covering the functions and business logic of the API, ensuring the stability and reliability of the API.

[0101] In one embodiment, the steps of analyzing API debugging data and generating risk assessment results and debugging suggestions include:

[0102] When it is determined that there is an error code in the API debugging data, the error type of the target API is determined according to a pre-established error type library, and the error log of the target API is obtained;

[0103] Generate debugging suggestions based on the error type and error log of the target API using a machine learning-based error analysis model.

[0104] Extract error data, call data, and performance data from API debug data;

[0105] Based on API definition data, error data, call data and performance data, a deep learning-based risk assessment model is used to generate risk assessment results.

[0106] Among them, the error code is the code in the API response that indicates an operation failure or a specific error condition. The error type library is a pre-defined set of error types and corresponding error codes used to quickly identify the nature of API errors. The error log is a file or data set that records error and exception information that occurs during the execution of the API. Machine learning is an artificial intelligence technology that enables computer systems to learn from data and improve their performance without explicit programming. The error analysis model is a model built based on machine learning technology, which is used to analyze error logs and error types to generate debugging suggestions. Performance data is data that describes the efficiency of API operation, such as response time, throughput, etc. The risk assessment model is a model built based on deep learning technology, which is used to assess the potential risks of the API, such as stability, security, etc.

[0107] Specifically, first, receive and parse the API debugging data. During the parsing process, pay attention to whether there is an error code, because this is a key indicator to determine whether the API is running normally. Once the error code is determined, immediately refer to the pre-established error type library to quickly determine the error type of the target API by comparing the error code. Next, retrieve the error logs related to the error type, which will provide detailed error context and possible causes.

[0108] After obtaining the error type and error log, the machine learning-based error analysis model is launched. The model will deeply analyze the key information in the error log and combine the characteristics of the error type to infer the possible cause and solution of the error. The output of the model will be a series of targeted debugging suggestions, which are designed to help developers quickly locate the problem and fix it.

[0109] At the same time, error data, call data, and performance data are extracted from the API debugging data. These data will be used as inputs to the risk assessment model to evaluate the overall performance and potential risks of the API. The risk assessment model comprehensively considers multiple dimensions such as the API definition, error history, call pattern, and performance, and finally generates a comprehensive risk assessment result through complex calculations and analysis. This result will include evaluations and suggestions on API stability, security, performance bottlenecks, etc.

[0110] In an example, the risk assessment result can be a risk assessment score, which represents a comprehensive assessment value of the potential risks of the API. The higher the score, the greater the risk. The calculation method is based on the output result of the deep learning model, taking into account the weights and characteristics of various data items. It can also be a risk type identification accuracy rate, which represents the proportion of risk types accurately identified by the model. The calculation method is the number of correctly identified risk types / the total number of risk types. It can also be a risk prediction lead time, which represents the time interval for the model to predict the occurrence of risks in advance. The calculation method is the actual occurrence time of the risk-model prediction time.

[0111] It is understandable that by analyzing the error codes and error logs in the debugging data, problems can be quickly located and debugging suggestions can be generated. At the same time, by comprehensively evaluating the API's error data, call data, and performance data, the operating status and potential risks of the API can be fully understood, providing strong support for subsequent optimization and maintenance.

[0112] In this embodiment, automated error analysis and debugging suggestion generation can significantly reduce the time cost of manual error troubleshooting and improve the efficiency of problem solving. At the same time, the risk assessment model based on deep learning can comprehensively and accurately assess the potential risks of the API.

[0113] In one embodiment, the method further comprises:

[0114] The target API is monitored through a lightweight monitoring agent, which is deployed on key nodes of the API server and network transmission paths.

[0115] Among them, a lightweight monitoring agent is a software or program with low resource consumption, which is used to monitor the status, performance or security of the target system (such as API) in real time and send the monitoring data back to the central monitoring system. Key nodes are nodes or components in the API server or network architecture that have a significant impact on system performance, stability or security. The network transmission path is the network link that data passes through from the source point to the destination point, including network devices such as routers and switches.

[0116] Specifically, first, identify the key nodes of the target API server. These nodes may include system resources such as CPU, memory, disk I / O, as well as API entry points, key business logic processing modules, etc. By deeply understanding the API architecture and business processes, accurately locate these key nodes. Next, deploy lightweight monitoring agents on these key nodes. These agents will continuously monitor the node's operating status, performance indicators, and potential security threats. In order to minimize the impact on the API server's performance, you can choose monitoring agent software with low resource usage and fast response speed. At the same time, pay attention to the monitoring of network transmission paths. Deploy additional monitoring agents on key nodes of the network (such as routers and switches) to monitor network performance indicators such as data packet transmission delay and packet loss rate. These data will identify network bottlenecks and potential security risks. Finally, configure the monitoring agent to regularly send monitoring data to the central monitoring system. These data will include performance indicators of key nodes, abnormal event records, network transmission status, etc. By analyzing these data in real time, problems in API operation can be discovered and solved in a timely manner.

[0117] It can be understood that by real-time monitoring of the operating status of key nodes and the performance indicators of network transmission paths, potential problems and bottlenecks can be discovered in a timely manner, so that necessary measures can be taken to optimize the performance and security of the API.

[0118] In this embodiment, a lightweight monitoring agent is deployed to monitor the target API, which can provide real-time, comprehensive performance and security monitoring data, and timely discover and solve problems. It can not only improve the stability and reliability of the API, reduce the risk of service interruption and data loss caused by failures, but also optimize the performance of the API and improve user experience and satisfaction. At the same time, through continuous monitoring and analysis of data, it can also provide strong data support for future system upgrades and expansions.

[0119] In one example, AI-based data collection may include intelligent perception agents. Specifically, intelligent perception agents are deployed at key nodes of API calls. These agents have self-learning and adaptability capabilities and can dynamically adjust collection strategies according to the traffic patterns and characteristics of the APIs. It may also include edge computing fusion. Specifically, edge computing technology is used to perform preliminary data processing and screening on edge devices close to the data source, and only valuable data is transmitted to the central server, reducing data transmission volume and latency. It may also include deep learning-driven sampling. Specifically, deep learning models are used to predict peak and trough periods of API calls, as well as key scenarios where anomalies may occur, and more intensive data sampling is performed during these periods and scenarios, while sparse sampling is performed during regular periods, so as to reduce collection costs while ensuring data quality.

[0120] In another example, AI-based data collection may include real-time anomaly detection, specifically, using an anomaly detection model based on autoencoders and generative adversarial networks (GANs) to analyze the collected data in real time, and immediately issue an alarm once a deviation between the data pattern and the normal pattern is found; it may also include trend prediction, specifically, using long short-term memory networks (LSTMs) to learn historical data, predict API performance and call trends, and discover possible performance bottlenecks or call volume surges in advance; it may also include multi-dimensional correlation analysis, specifically, through graph neural networks (GNNs) to model and analyze the call relationships and data dependencies between APIs, and discover potential associated anomalies and risk propagation paths; and it may include intelligent alarm grading, specifically, based on decision trees and random forest algorithms, intelligently grade alarms according to factors such as the severity, scope of impact, and duration of the anomaly to ensure that important alarms can be handled in a timely manner.

[0121] Furthermore, in one example, data storage and processing can be a distributed storage architecture, specifically, using distributed file systems and databases, such as HDFS and HBase in the Hadoop ecosystem, to ensure reliable storage and fast retrieval of massive data; it can also be a combination of stream processing and batch processing, specifically, using stream processing frameworks such as Flink to quickly process and analyze real-time data, while using batch processing frameworks such as Spark to deeply mine and train models for historical data; it can also be feature engineering automation, specifically, using automatic feature engineering technology to automatically extract meaningful features from raw data, providing high-quality data input for subsequent monitoring and analysis.

[0122] In one embodiment, the method further comprises:

[0123] When the target API version changes, detect the difference between the target API before and after the version change, and update the corresponding API documentation and API test cases.

[0124] Among them, the target API version change refers to the update or modification of the target API during the development process to add new functions, fix errors or improve performance. These changes usually lead to changes in the API interface definition, behavior or data format. API differences refer to the differences in API interface definition, request parameters, response data, error handling, etc. between different versions.

[0125] Specifically, when a version change of the target API is detected, the new version information of the API is captured through automated tools or scripts and compared with the old version. The API metadata, request and response examples, etc. can be parsed to identify changes in interface definitions, parameters, response data, etc. Update the API documentation based on the differences, including modifying the interface description, parameter description, response data format, etc. to ensure that the documentation is consistent with the actual behavior of the API. Finally, write or update the API test cases based on the new API version. These test cases will cover all change points to ensure that the new version of the API meets the requirements in terms of functionality, performance, and stability.

[0126] In this embodiment, by timely updating API documents and test cases, the availability and reliability of the API can be improved and compatibility issues caused by version changes can be reduced.

[0127] To facilitate understanding of the solution of the present application, specific examples are provided below for illustration.

[0128] In one example, if Figure 3As shown, an API intelligent management system can be designed according to the solution of this application, aiming to provide a comprehensive, efficient and intelligent API management and testing solution. By integrating multiple advanced technologies, refined management and automated testing of the entire API life cycle can be achieved to ensure the quality, stability and security of the API.

[0129] Specifically, the data collection layer is used to deploy a series of monitoring agents on the API server and the calling client to collect API operation data in real time, including request parameters, response time, return status code, etc. It is also used to use network packet capture technology to capture API data packets in network transmission, parse the key information, and provide a rich data foundation for subsequent analysis and management.

[0130] The AI ​​processing layer is used to build a deep learning-based model to analyze and process the collected data. For example, the long short-term memory network (LSTM) is used to perform time series analysis on the historical operation data of the API to predict performance problems and errors that may occur in the future. It is also used to train a natural language processing model to understand and parse text information such as API documents, comments, and developer communication records, extract key technical details and business logic, and assist in generating more accurate test cases and documents.

[0131] The management and test control layer is used to develop a visual management console to facilitate developers and managers to monitor and manage the status of the API. The console provides real-time performance indicator charts, error alarm information, and test progress and results. It is also used to design an automated test scheduler to automatically trigger API test tasks according to preset rules and strategies. For example, tests can be performed after the API code is updated, when the server load changes significantly, or at regular intervals.

[0132] The application interaction layer is used to build a high-performance database system to store API operation data, test results, document information, parameters of artificial intelligence models, and training data. It is also used to provide a rich API interface to facilitate integration and interaction with other systems. For example, it can be connected to the continuous integration / continuous deployment (CI / CD) system to realize automated API publishing and testing processes.

[0133] In another example, the API documentation generation and management workflow is as follows:

[0134] Developers define new APIs in detail in the API definition and registration module, including key information such as function description, parameter information, and expected return values, and submit them. The system's legality and compliance checking mechanism not only ensures the accuracy of general information, but also verifies whether the submitted document structure and format meet the standards, laying the foundation for subsequent automated document generation.

[0135] When the API is called, the dedicated monitoring submodule in the data collection and monitoring module will accurately capture key data related to the API document, such as the actual value range of the request parameters, the actual type and content of the return value, etc. Advanced asynchronous data collection technology is used to record the changes in this data in real time without affecting the normal response speed of the API.

[0136] The automatic document generation module automatically updates the API documents based on the collected detailed data and the initial API definition, using intelligent data integration and analysis technology. By combining with natural language processing technology, it can not only ensure the accuracy and completeness of the document content, but also automatically generate multilingual versions of the document according to the needs of different users to meet the reference needs of global users. Through this series of processes, the problems of lag in traditional manual document updates, information omissions, and the difficulty of document information to accurately reflect the actual situation when multiple threads concurrently access the API are solved.

[0137] The workflow of API debugging function is as follows:

[0138] When developers need to debug an API, they can use a dedicated debugging tool module that allows developers to enter various request parameters and provides real-time result display and detailed tracking of intermediate data.

[0139] The debugging tool module works closely with the data collection and monitoring module. When problems occur during API operation, the data collection and monitoring module will quickly collect relevant error information and operation data, such as error codes, response time, system resource usage, etc.

[0140] The intelligent error analysis submodule automatically analyzes possible causes based on the collected information, combined with a pre-established rich error pattern library and machine learning algorithms. The analysis results are then presented to developers in a clear and easy-to-understand manner, while providing detailed solution suggestions and relevant code examples to help developers quickly locate and solve problems. This workflow effectively solves the problem of quickly and accurately locating problems in large-scale and complex API call networks, and improves developers' debugging efficiency.

[0141] The relevant workflow of the API automated testing system is as follows:

[0142] The automated testing module automatically performs comprehensive testing on the API at preset time intervals or under specific trigger conditions (such as API code updates, system environment changes, etc.).

[0143] During the testing process, the test module will use an advanced testing framework that integrates test plug-ins for different protocols (such as HTTP, RPC, etc.), which can perform unified and effective testing on various types of APIs.

[0144] The test data generation submodule will automatically generate test data that meets the actual situation according to different test scenarios and business requirements. During the test execution process, the data can be dynamically adjusted according to the real-time test situation to cover more boundary conditions and abnormal conditions.

[0145] After the test is completed, the test module will provide detailed test results to the developer in the form of a professional report. The report not only includes the execution of the test cases, but also clearly points out the problems found and provides targeted suggestions for improvement measures. At the same time, the version management module will strictly manage and control different versions when the API changes. It automatically detects the differences between versions and performs compatibility analysis to ensure the smooth launch of the new version and the smooth transition of the old version. Through this series of operations, a comprehensive and intelligent API automation testing system is built to solve the complex problems of unified testing of APIs with different protocols and test data generation and management, and improve the quality and stability of the API.

[0146] In another example, suppose there is an API based on a cloud-native online trading platform for obtaining product information. In the prior art, developers may need to manually write documents to describe the parameters and return values ​​of this API, and need to insert print statements in the code to view the results when debugging. Using the system of this patent, developers only need to register the basic information of this API in the system, and the system will automatically collect call data and generate detailed documents. When debugging is required, developers can enter parameters in the visual debugging interface and immediately see the response results and intermediate data. At the same time, the automated testing module will regularly test this API, use artificial intelligence algorithms to optimize test cases, and find potential problems. The version management module can ensure a smooth transition between the old and new versions when the API changes to avoid affecting the business.

[0147] Furthermore, in one example, security measures can be configured, including access control and authentication. Specifically, a strict API access control mechanism is established, and a role-based access control (RBAC) model is adopted to ensure that only authorized users and applications can access the API; multiple authentication methods are implemented, such as API key authentication, OAuth2.0 authentication, etc., to ensure the security of API calls. At the same time, the authentication process is monitored in real time and risk assessment is performed to prevent malicious attacks and illegal access. It can also include data encryption and transmission security. Specifically, the data transmitted by the API is encrypted and advanced encryption algorithms such as AES-256 are adopted to ensure the security of data during network transmission; a secure communication channel is established, such as using the HTTPS protocol for API calls to prevent data from being stolen and tampered with. At the same time, the communication process is monitored in real time to promptly discover and prevent network attacks. It can also include security vulnerability detection and repair. Specifically, the API is regularly scanned and evaluated for security vulnerabilities, and artificial intelligence models and professional security testing tools are used to discover potential security risks and vulnerabilities; a rapid vulnerability repair mechanism is established, and when security issues are found, developers can be notified in a timely manner, and detailed repair suggestions and solutions are provided. At the same time, the repaired API is tested and verified again to ensure that the security issues are completely resolved.

[0148] The following describes the API intelligent management device provided in the embodiment of the present application. The API intelligent management device described below and the API intelligent management method described above can be referred to in correspondence with each other. Figure 4 As shown, the present application provides an API intelligent management device, the device comprising:

[0149] The target API acquisition module 201 is used to respond to the API registration request, acquire API definition data used for API registration, and perform API registration after extracting key features from the API definition data to obtain the target API;

[0150] An API document generation module 202, used to generate API documents according to API definition data using a pre-trained knowledge graph driven document generation model;

[0151] A test result acquisition module 203 is used to generate API test cases according to the API document using a test case generator based on a generative adversarial network, and execute the API test cases according to a predetermined test strategy to obtain a test result of the target API;

[0152] The risk assessment result generating module 204 is used to analyze the debugging data of the target API and generate risk assessment results and debugging suggestions when the test result does not match the expected result and the target API is debugged;

[0153] The API document updating module 205 is used to update the API document according to the running data of the target API when the target API starts running after debugging.

[0154] In one embodiment, the target API acquisition module 201 includes:

[0155] A natural language acquisition unit, used to acquire natural language used to describe the API, and analyze the natural language using a natural language model to identify the API registration intention;

[0156] The complete information acquisition unit is used to extract key information in natural language according to the API registration intention, and initiate an inquiry dialogue based on the key information and the preset API definition template to obtain the complete information required for API registration;

[0157] The API definition data construction unit is used to construct the API definition data according to the answers and key information of the inquiry dialogue.

[0158] In one embodiment, the API document generation module 202 includes:

[0159] A sample data acquisition unit, used for acquiring multiple API definition sample data;

[0160] An API knowledge graph construction unit, used to identify multiple entity data and the relationship between each entity data from each API definition sample data, and to construct an API knowledge graph based on each entity data and the relationship between each entity data;

[0161] A characteristic phasor extraction unit, used to extract characteristic vectors of each API definition sample data;

[0162] The document generation model acquisition unit is used to train the graph neural network model according to the API knowledge graph and each feature vector, and evaluate the trained graph neural network model according to the generated sample API document until the trained graph neural network model reaches the preset training end condition, thereby obtaining a knowledge graph-driven document generation model.

[0163] In one embodiment, the test result acquisition module 203 includes:

[0164] The test strategy generation unit is used to generate test strategies according to API definition data and preset business logic, using a test strategy model based on deep reinforcement learning.

[0165] In one embodiment, the risk assessment result generating module 204 includes:

[0166] An error log acquisition unit, configured to determine the error type of the target API according to a pre-established error type library and acquire the error log of the target API when it is determined that there is an error code in the API debugging data;

[0167] A debugging suggestion generation unit, which is used to generate debugging suggestions based on the error type and error log of the target API and an error analysis model based on machine learning;

[0168] A data extraction unit, used to extract error data, call data and performance data from API debugging data;

[0169] The risk assessment result generation unit is used to generate risk assessment results according to API definition data, error data, call data and performance data by adopting a risk assessment model based on deep learning.

[0170] In one embodiment, the apparatus further comprises:

[0171] The target API monitoring module is used to monitor the target API through a lightweight monitoring agent. The monitoring agent is deployed on the key nodes of the API server and the network transmission path.

[0172] In one embodiment, the apparatus further comprises:

[0173] The API test case update module is used to detect the difference between the target API before and after the version change when the target API version changes, and to update the corresponding API documents and API test cases.

[0174] In one embodiment, the present application also provides a storage medium, which stores computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the API intelligent management method described in any of the above embodiments.

[0175] In one embodiment, the present application also provides a computer device having computer-readable instructions stored therein. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the API intelligent management method as described in any one of the above embodiments.

[0176] Indicatively, Figure 5 As shown, Figure 5 This is a schematic diagram of the internal structure of a computer device provided in an embodiment of the present application. The computer device 300 may be provided as a server. Figure 5, the computer device 300 includes a processing component 302, which further includes one or more processors, and a memory resource represented by a memory 301, for storing instructions executable by the processing component 302, such as an application. The application stored in the memory 301 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 302 is configured to execute instructions to perform the API intelligent management method of any of the above embodiments.

[0177] The computer device 300 may further include a power supply component 303 configured to perform power management of the computer device 300, a wired or wireless network interface 304 configured to connect the computer device 300 to a network, and an input / output (I / O) interface 305. The computer device 300 may operate based on an operating system stored in the memory 301, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, or the like.

[0178] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0179] Finally, it should 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 that there is any such actual relationship or order between these entities or operations. Moreover, the term "include", "comprise" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements not only includes those elements, but also includes other elements not clearly listed, or also includes elements inherent to such process, method, article or equipment. In the absence of more restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or equipment including the elements. Herein, "one", "one", "said", "the" and "it" may also include plural forms, unless the context clearly indicates another way. A plurality refers to at least two cases, such as 2, 3, 5 or 8, etc. "And / or" includes any and all combinations of the relevant listed items.

[0180] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can refer to each other.

[0181] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. An API intelligent management method, characterized in that: The method comprises: In response to the API registration request, obtain API definition data for API registration, extract key features from the API definition data, perform API registration, and obtain a target API; Generate API documentation using a pre-trained knowledge graph-driven document generation model based on the API definition data; Generate an API test case according to the API document using a test case generator based on a generative adversarial network, and execute the API test case according to a predetermined test strategy to obtain a test result of the target API; When the test result does not match the expected result, when debugging the target API, analyzing the debugging data of the target API and generating a risk assessment result and debugging suggestions; If the target API starts running after debugging is completed, the API document is updated according to the running data of the target API.

2. The API intelligent management method according to claim 1, characterized in that: The step of obtaining API definition data for API registration includes: Obtaining natural language for describing the API, and analyzing the natural language using a natural language model to identify API registration intent; According to the API registration intention, extract key information in the natural language, and initiate an inquiry dialogue based on the key information and a preset API definition template to obtain complete information required for API registration; The API definition data is constructed according to the answer to the inquiry dialogue and the key information.

3. The API intelligent management method according to claim 1, characterized in that: The training process of the knowledge graph-driven document generation model includes: Get multiple API definition sample data; Identify multiple entity data and the relationship between each entity data from each of the API definition sample data, and construct an API knowledge graph based on each of the entity data and the relationship between each of the entity data; Extracting a feature vector of each of the API definition sample data; The graph neural network model is trained according to the API knowledge graph and each of the feature vectors, and the trained graph neural network model is evaluated according to the generated sample API document until the trained graph neural network model reaches a preset training end condition, thereby obtaining the knowledge graph-driven document generation model.

4. The API intelligent management method according to claim 1, characterized in that: The process of determining the test strategy includes: According to the API definition data and preset business logic, a test strategy model based on deep reinforcement learning is adopted to generate the test strategy.

5. The API intelligent management method according to claim 1, characterized in that: The step of analyzing the API debugging data and generating risk assessment results and debugging suggestions includes: When it is determined that there is an error code in the API debugging data, determining the error type of the target API according to a pre-established error type library, and obtaining an error log of the target API; Generate the debugging suggestion by using a machine learning-based error analysis model according to the error type and error log of the target API; extracting error data, call data, and performance data from the API debugging data; According to the API definition data, the error data, the call data and the performance data, a risk assessment model based on deep learning is used to generate the risk assessment result.

6. The API intelligent management method according to any one of claims 1 to 5, characterized in that: The method further comprises: The target API is monitored by a lightweight monitoring agent, which is deployed on key nodes of the API server and network transmission paths.

7. The API intelligent management method according to any one of claims 1 to 5, characterized in that: The method further comprises: When the target API version changes, the difference between the target API before and after the version change is detected, and the corresponding API documents and API test cases are updated.

8. An API intelligent management device, characterized in that: The device comprises: A target API acquisition module is used to respond to an API registration request, acquire API definition data used for API registration, and perform API registration after extracting key features from the API definition data to obtain a target API; An API document generation module, used to generate API documents according to the API definition data using a pre-trained knowledge graph-driven document generation model; A test result acquisition module, used to generate an API test case according to the API document using a test case generator based on a generative adversarial network, and execute the API test case according to a predetermined test strategy to obtain a test result of the target API; A risk assessment result generating module, used for analyzing the debugging data of the target API and generating a risk assessment result and a debugging suggestion when the test result does not match the expected result and the target API is debugged; The API document updating module is used to update the API document according to the running data of the target API when the target API starts running after debugging is completed.

9. A storage medium, characterized in that: The storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the API intelligent management method as described in any one of claims 1 to 7.

10. A computer device, characterized in that: include: one or more processors, and memory; The memory stores computer-readable instructions, and when the computer-readable instructions are executed by the one or more processors, the steps of the API intelligent management method according to any one of claims 1 to 7 are performed.

Citation Information

Patent Citations

  • API on-line debugging method

    CN108959076A

  • Interface document generation method, apparatus and device, and computer storage medium

    CN110955416A

  • Method for unified management and release of security API interface in ERP system

    CN112612461A

  • API life cycle management system, method and device

    CN116302037A

  • Interface document generation method and device, electronic equipment and storage medium

    CN117193850A

Cited By

  • Interface calling method and device, computer equipment and storage medium

    CN119960938A

  • Automatic interface testing method and related device

    CN120596394A

  • Method and system for identifying the app launch type

    TWI922276B