CN119960938A - Interface calling method, device, computer equipment and storage medium - Google Patents
Interface calling method, device, computer equipment and storage medium Download PDFInfo
- Publication number
- CN119960938A CN119960938A CN202510021120.8A CN202510021120A CN119960938A CN 119960938 A CN119960938 A CN 119960938A CN 202510021120 A CN202510021120 A CN 202510021120A CN 119960938 A CN119960938 A CN 119960938A
- Authority
- CN
- China
- Prior art keywords
- code
- target
- information
- interface
- document
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Machine Translation (AREA)
Abstract
The embodiment of the application belongs to the field of data processing and relates to an interface calling method, an interface calling device, computer equipment and a storage medium, wherein the method comprises the following steps of performing natural language processing on text information requested by a user to obtain semantic representation and key entity information; the method comprises the steps of carrying out semantic matching on request semantic representation and key entity information according to an interface knowledge graph to obtain a target program interface document, carrying out structural analysis and information extraction on the target program interface document to obtain document key information, carrying out code generation according to the document key information and the request semantic representation based on a code generation model to obtain a target calling code, testing the target calling code to obtain a code test result, adjusting the code generation model according to the code test result to generate an adjustment target code, and applying the adjustment target code to a target program interface to carry out interface call. The application can realize accurate and effective application program interface calling according to the request text input by the user.
Description
Technical Field
The present application relates to the field of data processing technologies, and in particular, to the field of digital medical treatment, and in particular, to an interface calling method, an interface calling device, a computer device, and a storage medium.
Background
In the fields of financial science and technology and digital medical treatment, with the rapid development of artificial intelligence and big data technology, the requirement of generating AP I call information based on natural language requests is increasingly urgent. This is not limited to automated operations of financial transaction systems, such as intelligent consultation, risk management, etc., but also relates to digital medical scenarios such as medical diagnosis assistance, medical record management, etc. However, in implementing this process, the technical challenges are significant.
The user may make complex and varying requests in natural language form, such as "query the total amount of credit card consumed this month" or "get the latest physical examination report of three. Matching these requests exactly to the corresponding AP I documents is a major challenge, as AP I documents tend to be numerous and in various formats, ranging from RESTfu l to SOAP. Furthermore, even if a match is successful, how to accurately generate AP I call information is a big challenge. Problems such as parameter deletion, wrong calling sequence, mismatching of data types and the like frequently occur, so that the calling result of the AP I is different from the expected result.
Disclosure of Invention
The embodiment of the application aims to provide an interface calling method, an interface calling device, computer equipment and a storage medium, which are used for solving the problem that accurate and effective application program interface calling cannot be performed according to an input request text.
In order to solve the above technical problems, an embodiment of the present application provides an interface calling method, which adopts the following technical scheme:
Acquiring user request text information, and performing natural language processing on the user request text information to obtain request semantic representation and key entity information;
Carrying out semantic matching on the request semantic representation and the key entity information according to a pre-constructed interface knowledge graph to obtain a target program interface document;
Carrying out structural analysis and information extraction on the target program interface document to obtain document key information;
Code generation is carried out according to the document key information and the request semantic representation based on a pre-trained code generation model, so that a target calling code is obtained;
performing static analysis and dynamic test on the target call code to obtain a code test result;
And adjusting the code generation model according to the code test result to obtain an effective code generation model, generating an adjustment target code according to the effective code generation model, and applying the adjustment target code to a target program interface for interface call.
Further, the step of performing natural language processing on the text information requested by the user to obtain a request semantic representation and key entity information specifically includes:
Performing word segmentation processing on the text information of the user request based on a preset word segmentation algorithm to obtain a request keyword;
performing part-of-speech tagging on the request keywords based on a pre-constructed part-of-speech tagging model to obtain tagged keywords;
performing dependency analysis on the labeling keywords to obtain keyword dependency;
constructing a semantic representation according to the request keywords and the keyword dependency relationship, and taking the semantic representation as the request semantic representation;
And carrying out key entity identification on the semantic representation to obtain the key entity information.
Further, the step of performing semantic matching on the request semantic representation and the key entity information according to the pre-constructed interface knowledge graph to obtain a target program interface document specifically includes:
extracting semantic vector representations of corresponding nodes from the interface knowledge graph according to the key entity information;
calculating the similarity of the semantic vector representation and the request semantic representation to obtain a similarity score;
Sorting the nodes in the interface knowledge graph according to the similarity score to obtain the most relevant target nodes;
and extracting the target program interface document from a preset document database according to the most relevant target node.
Further, the step of performing structural analysis and information extraction on the target program interface document to obtain the document key information specifically includes:
preprocessing the target program interface document to obtain an effective program interface document;
carrying out semantic analysis on the effective program interface document to obtain a document key sentence and a document key paragraph;
And carrying out structural representation on the document key sentences and the document key paragraphs to obtain the document key information.
Further, the step of generating the code based on the pre-training code generation model according to the document key information and the request semantic representation to obtain the target calling code specifically includes:
matching is carried out in a predefined rule base according to the request semantic representation, and a parameter type matching rule, a necessary parameter checking rule and a return value processing rule are obtained;
Extracting a parameter list from the document key information, and performing type checking and conversion processing on the parameter list according to the parameter type matching rule to obtain an effective parameter list;
checking the effective parameter list according to the necessary parameter checking rule to obtain effective parameter information;
identifying a target code type corresponding to the request semantic representation, and inputting the target code type and the effective parameter information into the code generation model to obtain an initial calling code;
And adding return value processing logic to the initial calling code according to the return value processing rule to obtain the target calling code.
Further, the step of performing static analysis and dynamic test on the target call code to obtain a code test result specifically includes:
Judging whether the grammar of the target calling code is correct or not according to a static analysis method;
And if the grammar of the target calling code is correct, acquiring a preset test case set, and executing the test case set to dynamically run the target calling code to obtain the code test result.
Further, the step of adjusting the code generation model according to the code test result to obtain an effective code generation model specifically includes:
acquiring a preset standard test result, and judging whether the code test result accords with the standard test result;
If the code test result accords with the standard test result, taking a code generation model corresponding to the code test result as the effective code generation model;
If the code test result does not accord with the standard test result, obtaining a difference item between the code test result and the standard test result, extracting correction information from a preset difference correction table according to the difference item, adjusting the code generation model based on the correction information, re-obtaining the adjusted code test result, and continuously repeating the steps of obtaining the difference item until the code generation model is adjusted until the adjusted code test result accords with the standard test result, so as to obtain the effective code generation model.
In order to solve the above technical problems, the embodiment of the present application further provides an interface calling device, which adopts the following technical scheme:
The information processing module is used for acquiring user request text information, and carrying out natural language processing on the user request text information to obtain request semantic representation and key entity information;
The semantic matching module is used for carrying out semantic matching on the request semantic representation and the key entity information according to a pre-constructed interface knowledge graph to obtain a target program interface document;
The information extraction module is used for carrying out structural analysis and information extraction on the target program interface document to obtain document key information;
The code generation module is used for generating codes according to the document key information and the request semantic representation based on a pre-trained code generation model to obtain a target calling code;
The code testing module is used for carrying out static analysis and dynamic testing on the target calling code to obtain a code testing result;
And the code adjustment module is used for adjusting the code generation model according to the code test result to obtain an effective code generation model, generating an adjustment target code according to the effective code generation model, and applying the adjustment target code to a target program interface for interface call.
In order to solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the following technical schemes:
A computer device comprising a memory having stored therein computer readable instructions which when executed by a processor implement the steps of the interface invocation method of any of the preceding claims.
In order to solve the above technical problems, an embodiment of the present application further provides a computer readable storage medium, which adopts the following technical schemes:
a computer readable storage medium having stored thereon computer readable instructions which when executed by a processor implement the steps of the interface invoking method as claimed in any of the preceding claims.
Compared with the prior art, the method and the device have the advantages that the user request text information is obtained, natural language processing is conducted on the user request text information to obtain request semantic representation and key entity information, semantic matching is conducted on the request semantic representation and the key entity information according to a pre-built interface knowledge graph to obtain a target program interface document, structural analysis and information extraction are conducted on the target program interface document to obtain document key information, code generation is conducted according to the document key information and the request semantic representation based on a pre-trained code generation model to obtain a target calling code, static analysis and dynamic testing are conducted on the target calling code to obtain a code testing result, adjustment is conducted on the code generation model according to the code testing result to obtain an effective code generation model, adjustment target codes are generated according to the effective code generation model, and the adjustment target codes are applied to a target program interface to conduct interface calling. Therefore, accurate and effective application program interface calling is effectively realized according to the request text input by the user, and the accuracy and the effectiveness of the interface calling are improved.
Drawings
In order to more clearly illustrate the solution of the present application, a brief description will be given below of the drawings required for the description of the embodiments of the present application, it being apparent that the drawings in the following description are some embodiments of the present application, and that other drawings may be obtained from these drawings without the exercise of inventive effort for a person of ordinary skill in the art.
FIG. 1 is an exemplary system architecture diagram in which the present application may be applied;
FIG. 2 is a flow chart of one embodiment of an interface invocation method according to the present application;
FIG. 3 is a flow chart of one embodiment of step S10 of FIG. 2;
FIG. 4 is a flow chart of one embodiment of step S20 of FIG. 2;
FIG. 5 is a flow chart of one embodiment of step S30 of FIG. 2;
FIG. 6 is a flow chart of one embodiment of step S40 of FIG. 2;
FIG. 7 is a flow chart of one embodiment of step S50 of FIG. 2;
FIG. 8 is a flow chart of one embodiment of step S60 of FIG. 2;
FIG. 9 is a schematic diagram illustrating the construction of one embodiment of an interface call apparatus in accordance with the present application;
FIG. 10 is a schematic structural view of one embodiment of a computer device according to the present application.
Detailed Description
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs, the terms used in the description herein are used for the purpose of describing particular embodiments only and are not intended to limit the application, and the terms "comprising" and "having" and any variations thereof in the description of the application and the claims and the above description of the drawings are intended to cover non-exclusive inclusions. The terms first, second and the like in the description and in the claims or in the above-described figures, are used for distinguishing between different objects and not necessarily for describing a sequential or chronological order.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are non-related or alternative embodiments mutually exclusive of other embodiments. Those of skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments.
In order to make the person skilled in the art better understand the solution of the present application, the technical solution of the embodiment of the present application will be clearly and completely described below with reference to the accompanying drawings.
As shown in fig. 1, the system architecture 100 may include a terminal device 101, a network 102, and a server 103, where the terminal device 101 may be a notebook 1011, a tablet 1012, or a cell phone 1013. Network 102 is the medium used to provide communication links between terminal device 101 and server 103. Network 102 may include various connection types such as wired, wireless communication links, or fiber optic cables.
A user may interact with the server 103 via the network 102 using the terminal device 101 to receive or send messages or the like. Various communication client applications, such as a web browser application, a shopping class application, a search class application, an instant messaging tool, a mailbox client, social platform software, and the like, may be installed on the terminal device 101.
The terminal device 101 may be various electronic devices having a display screen and supporting web browsing, and the terminal device 101 may be an electronic book reader, an MP3 player (Moving Picture Experts Group Audio Layer III, moving picture experts compression standard audio layer III), an MP4 (Moving Picture Experts Group Audio Layer IV, moving picture experts compression standard audio layer IV) player, a laptop portable computer, a desktop computer, or the like, in addition to the notebook 1011, the tablet 1012, or the mobile phone 1013.
The server 103 may be a server providing various services, such as a background server providing support for pages displayed on the terminal device 101.
It should be noted that, the interface calling method provided by the embodiment of the present application is generally executed by a server/terminal device, and accordingly, the interface calling device is generally disposed in the server/terminal device.
It should be understood that the number of terminal devices, networks and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to FIG. 2, a flow chart of one embodiment of a method of interface invocation according to the present application is shown. The interface calling method comprises the following steps:
Step S10, acquiring user request text information, and performing natural language processing on the user request text information to obtain request semantic representation and key entity information;
In this embodiment, the user request text information is a request text submitted by a user in a natural language form, for example, a query text paragraph input by the user in a search engine, and natural language processing of the user request text information includes word segmentation processing, part-of-speech tagging, dependency analysis, and semantic representation graph construction.
Step S20, carrying out semantic matching on the request semantic representation and the key entity information according to a pre-constructed interface knowledge graph to obtain a target program interface document;
In this embodiment, the interface knowledge graph includes structured information such as a name, a function description, a parameter description, a return value type, and the like of an Application Program Interface (API), where nodes represent entities such as the API, parameters, and return value types, and edges represent relationships between the entities (e.g., which parameters the API contains, what types of parameters are, and the like). Semantic matching is achieved by identifying the similarity between semantic vector representations corresponding to nodes in the interface knowledge graph and the request semantic representations. And carrying out matching query extraction on the most relevant target nodes obtained after the target program interface documents are matched through semantics in a preset document database.
Step S30, carrying out structural analysis and information extraction on the target program interface document to obtain document key information;
In this embodiment, the information extraction refers to semantic analysis of a target program structure (API) document, and the structural analysis refers to structural representation of information obtained after the semantic analysis. The information extraction comprises text sentence segmentation, keyword extraction, semantic role labeling, keyword sentence and paragraph recognition and the like, and the structured representation comprises keyword information extraction, data cleaning, structured storage and the like. And carrying out structural analysis and information extraction comprising the steps, so that the key information of the document is effectively obtained.
Step S40, code generation is carried out according to the document key information and the request semantic representation based on a pre-trained code generation model, and a target calling code is obtained;
In this embodiment, the pre-trained code generation model may employ a sequence-to-sequence (Seq 2 Seq) model, such as a transducer's GPT model. The extracted document key information and the request semantic representation are used as input and transmitted to a pre-trained code generation model, so that the model firstly encodes the input information, and then gradually decodes the input information to generate codes, thereby realizing a sequence-to-sequence process and obtaining the target calling code.
S50, performing static analysis and dynamic test on the target call code to obtain a code test result;
In this embodiment, static analysis is a method for finding potential problems by checking information such as syntax, structure, data flow, control flow, etc. of code without executing the code, wherein the static analysis can be implemented by means of a static analysis tool. Dynamic testing is a method of verifying the function, performance and stability of code by executing the code, which executes target calling code through a pre-designed test case, thereby realizing collection of code test results.
And step S60, adjusting the code generation model according to the code test result to obtain an effective code generation model, generating an adjustment target code according to the effective code generation model, and applying the adjustment target code to a target program interface for interface call.
In this embodiment, the code generation model is adjusted according to the difference between the code test result and the standard test result, and when adjustment is completed, the document key information and the request semantic representation are input to the adjusted effective code generation model to obtain the adjustment target code, and then the adjustment target code is applied to the target program interface of the system to realize the interface calling function.
In this embodiment, the method may be applied to a medical service system, where a target program interface in the system is invoked by inputting a request text. Specifically, the medical service system in this embodiment may be one or more of a medical insurance system and a disease insurance system, the interface knowledge graph is graph information including an Application Program (API) interface of the medical system, the interface knowledge graph and the code generation model are stored in the medical insurance system and the disease insurance system and acquired from databases of the systems, and the adjustment target code is generated by the systems through processing by the method in this embodiment and is applied to the target program interface of the systems to be called.
According to the embodiment, natural language processing is conducted on user request text information to obtain request semantic representation and key entity information, semantic matching is conducted on the request semantic representation and the key entity information according to a pre-built interface knowledge graph to obtain a target program interface document, structural analysis and information extraction are conducted on the target program interface document to obtain document key information, code generation is conducted on the basis of a pre-trained code generation model according to the document key information and the request semantic representation to obtain target calling codes, static analysis and dynamic testing are conducted on the target calling codes to obtain code test results, adjustment is conducted on the code generation model according to the code test results to obtain an effective code generation model, adjustment target codes are generated according to the effective code generation model, and the adjustment target codes are applied to a target program interface to conduct interface call. Therefore, accurate and effective application program interface calling is effectively realized according to the request text input by the user, and the accuracy and the effectiveness of the interface calling are improved.
Referring to fig. 3, in some alternative implementations of the present embodiment, step S10 includes the steps of:
step S101, word segmentation processing is carried out on the text information of the user request based on a preset word segmentation algorithm, and a request keyword is obtained;
In this embodiment, the preset word segmentation algorithm may use a dictionary-based word segmentation algorithm, such as a maximum matching method, by pre-constructing a dictionary containing common words, and then scanning the text of the text information requested by the user from left to right, each time trying to match the longest word with a length not exceeding the preset maximum length from the current position. If the match is successful, the vocabulary is used as a part of the word segmentation result and the match is continued from the next character, and if the match is failed, the match length is gradually reduced until a matched vocabulary is found or a minimum match length (usually 1 character) is reached. And after the matching step is completed, obtaining the request keywords.
Step S102, part-of-speech tagging is carried out on the request keywords based on a pre-constructed part-of-speech tagging model, and tagged keywords are obtained;
In this embodiment, the pre-constructed part-of-speech labeling model may employ a Hidden Markov Model (HMM), and the HMM model is trained using a labeled corpus (i.e., the known vocabulary and the text corresponding to the part of speech). The step of part-of-speech tagging based on the HMM model includes defining a set of states, one part-of-speech for each state in the HMM model. Thus, a state set needs to be defined, containing all possible parts of speech. Defining an observation set, wherein the observation set contains all possible vocabularies. Initializing model parameters by using the trained HMM model parameters. And calculating an optimal path, namely calculating the most probable part-of-speech tagging sequence (namely the optimal path) by using dynamic programming methods such as a Viterbi algorithm and the like for a given request keyword sequence. In this process, the probability of each state (part of speech) at each position needs to be calculated, and the path with the highest probability is selected as the final part of speech tagging result. Generating labeled keywords, namely combining the calculated part-of-speech labeling sequence with the request keyword sequence to generate a labeled keyword list, wherein each labeled keyword comprises an original vocabulary and a corresponding part-of-speech label.
Step S103, performing dependency relationship analysis on the labeling keywords to obtain keyword dependency relationship;
In this embodiment, the dependency analysis is a task of identifying dependencies among words in a sentence, and the dependency analysis may employ a rule-based analysis method, where the step of analyzing the dependencies of labeled keywords specifically includes traversing a labeled keyword list, and attempting to match each vocabulary with rules in a rule set. When a word is successfully matched with a certain rule, the dependency relationship between the word and the dependent word is constructed according to the definition of the rule. The dependency includes determining the type of dependency (e.g., master predicate, guest predicate, etc.) and the direction of the dependency (e.g., which vocabulary depends on which vocabulary). And performing dependency analysis on the labeling keywords through the dependency analysis step to obtain keyword dependency.
Step S104, a semantic representation is constructed according to the request keywords and the keyword dependency relationship, and the semantic representation is used as the request semantic representation;
in this embodiment, the nodes of the semantic representation graph are designated as request keywords, and the dependency relationships of the keywords are designated as edges of the semantic representation graph, so as to construct a graph structure representation representing the semantic structure requested by the user, where the graph structure representation is the semantic representation graph.
Step S105, carrying out key entity identification on the semantic representation to obtain the key entity information.
In this embodiment, the nodes in the semantic representation graph (i.e., the request keywords) are identified by the key entity identification algorithm to obtain a vocabulary or phrase with a specific meaning and importance, which is the key entity information. The key entity recognition algorithm can adopt a rule-based method, and each node in the semantic representation graph is matched by constructing a rule base with lexical rules, syntactic rules, context rules and the like so as to recognize key entity information.
According to the embodiment, word segmentation is conducted on the user request text information based on a preset word segmentation algorithm to obtain a request keyword, part-of-speech tagging is conducted on the request keyword based on a pre-built part-of-speech tagging model to obtain a tagging keyword, dependency relationship analysis is conducted on the tagging keyword to obtain a keyword dependency relationship, a semantic representation diagram is built according to the request keyword and the keyword dependency relationship, the semantic representation diagram is used as the request semantic representation, and key entity recognition is conducted on the semantic representation diagram to obtain the key entity information. Therefore, the extraction of the request semantic representation and the key entity information according to the keyword part of speech and the dependency relationship of the user request text information is effectively realized, and the subsequent semantic matching processing is facilitated.
Referring to fig. 4, in some alternative implementations of the present embodiment, step S20 includes the steps of:
step S201, extracting semantic vector representation of a corresponding node from the interface knowledge graph according to the key entity information;
In the embodiment, the extraction of the semantic vector representation comprises knowledge graph node positioning and semantic vector extraction, wherein the knowledge graph node positioning comprises node searching, namely, in an interface knowledge graph, using key entity information as a query condition, searching a node matched with the key entity information can be realized by matching labels, attributes or relations of the nodes in the graph. And confirming the nodes which are matched with the key entity information best according to the context information or the additional verification step from the search results. Semantic vector extraction involves vector representation selection, which selects or computes its semantic vector representation on the identified nodes, which can be obtained by using pre-trained Word vector models (e.g., word2Vec, BERT, etc.) or atlas embedding techniques (e.g., transE, deepWalk, etc.).
Step S202, calculating the similarity of the semantic vector representation and the request semantic representation to obtain a similarity score;
In this embodiment, the cosine similarity calculation is performed on the semantic vector representation and the request semantic representation, so as to obtain the corresponding similarity score. Cosine similarity is a commonly used metric that evaluates the similarity of two vectors by calculating their angle cosine values in a multidimensional space. Before the cosine similarity is calculated, the vectors typically need to be normalized to ensure that they have the same scale when calculated. The normalization formula is V ^ = V/V/, where V/is the modulus (length) of the vector. The cosine similarity is calculated by cos (θ) =v ^sem·V^req/∥V^sem∥∥V^ req. But since the vector has been normalized, the modulus is 1 and the formula can be reduced to cos (θ) =v ^sem·V^ req. The point multiplication (·) here represents the sum of the products of the two vector corresponding elements. When the value range of the cosine similarity obtained by the calculation is [ -1,1], wherein the closer the value is to 1, the more similar the two vectors are semantically, the closer the value is to-1, the more opposite the two vectors are semantically, and the value is to 0, and the two vectors are relatively independent or irrelevant semantically.
Step S203, sorting the nodes in the interface knowledge graph according to the similarity score to obtain the most relevant target nodes;
In this embodiment, the similarity scores corresponding to the calculated nodes are ranked according to the order from high to low, so as to obtain a similarity score ranking table, and then a first similarity score with the highest score is selected from the similarity score ranking table, and the node corresponding to the first similarity score is determined as the most relevant target node.
Step S204, extracting the target program interface document from a preset document database according to the most relevant target node.
In this embodiment, the preset document database is a preset database storing detailed documents of the respective program interfaces. And traversing and inquiring in a preset document database as an inquiring condition according to the information of the most relevant target node so as to extract the corresponding target program interface document.
According to the method, semantic vector representations of corresponding nodes are extracted from the interface knowledge graph according to the key entity information, similarity between the semantic vector representations and the request semantic representations is calculated to obtain similarity scores, the nodes in the interface knowledge graph are ordered according to the similarity scores to obtain most relevant target nodes, and the target program interface document is extracted from a preset document database according to the most relevant target nodes. Therefore, the target program structure document is effectively acquired, and subsequent steps of structural analysis and information extraction are facilitated.
Referring to fig. 5, in some alternative implementations of the present embodiment, step S30 includes the steps of:
step S301, preprocessing the target program interface document to obtain an effective program interface document;
In this embodiment, preprocessing the target program interface document includes denoising, i.e., removing irrelevant content in the document. Formatting, namely unifying typesetting and format of the document and ensuring definition and consistency of information. And removing stop words, namely removing common words which have small contributions to the key information of the document, such as 'yes'.
Step S302, carrying out semantic analysis on the effective program interface document to obtain a document key sentence and a document key paragraph;
In the embodiment, semantic analysis comprises text sentence segmentation, keyword extraction, semantic role labeling, key sentence and paragraph recognition and the like, wherein sentence segmentation is to divide a document into independent sentences so as to facilitate subsequent analysis. Keyword extraction is the extraction of keywords in documents using natural language processing techniques, which are typically closely related to the functions, parameters, return values, etc. of the interface. Semantic role labeling is to analyze semantic relationships in sentences, identify key components such as subjects, predicates, objects and the like, and logically connect the key components. The key sentence and paragraph identification is to identify sentences and paragraphs containing key information based on the results of the key word and semantic role labels. Through the semantic analysis steps, the document key sentences and the document key paragraphs are obtained effectively.
And step S303, carrying out structural representation on the document key sentences and the document key paragraphs to obtain the document key information.
In this embodiment, the structured representation includes key information extraction, data cleansing, structured storage, and the like. The information extraction is to extract key information such as the name, the function description, the parameter list, the return value type and the like of the interface from key sentences and paragraphs. And the data cleaning is to check and clean the extracted information to ensure the accuracy and consistency of the data. The structured storage is to store the cleaned information in a structured mode, such as JSON, XML and other formats, so that the subsequent use is convenient. The document key information is effectively obtained by carrying out the structured representation processing comprising the steps on the document key sentences and the document key paragraphs.
According to the method, the device and the system, the target program interface document is preprocessed to obtain the effective program interface document, semantic analysis is conducted on the effective program interface document to obtain the document key sentences and the document key paragraphs, and structural representation is conducted on the document key sentences and the document key paragraphs, so that document key information in which the key sentences and the key paragraphs included in the target program structure document are structurally represented is effectively obtained, and the subsequent code generation processing is facilitated.
With continued reference to fig. 6, in some alternative implementations of the present embodiment, step S40 includes the steps of:
Step S401, matching is carried out in a predefined rule base according to the request semantic representation, and parameter type matching rules, necessary parameter checking rules and return value processing rules are obtained;
In this embodiment, the request semantic representation is used as a query condition to perform traversal matching in a predefined rule base, so as to query and obtain a parameter type matching rule, an optional parameter checking rule and a return value processing rule. Parameter type matching rules for determining the data type to which each parameter in the request should conform. And (5) checking rules of the necessary parameters, namely listing the parameters which must be contained in the request. Return value processing rules describing how return values for called functions or APIs are processed.
Step S402, extracting a parameter list from the document key information, and performing type checking and conversion processing on the parameter list according to the parameter type matching rule to obtain an effective parameter list;
In this embodiment, the content of the key information of the document is read, the information (including the parameter name, the type, the description, the default value, etc.) related to the parameter is identified from the read information through the regular expression, and the identified parameter information is arranged into a parameter list. The parameter list is a data structure (e.g., array, dictionary, or object) in which each element represents a parameter. The parameter type matching rule is specifically a parameter type matching mapping table, and the type checking of each parameter in the parameter list through the parameter type matching mapping table can be realized by verifying whether the actual data type of the parameter matches the expected data type. And performing type conversion on parameters with non-matched types through a parameter type matching mapping table, wherein the type conversion comprises conversion of character strings into integers, floating point numbers, dates and the like.
Step S403, checking the effective parameter list according to the necessary parameter checking rule to obtain effective parameter information;
In this embodiment the step of checking the list of valid parameters comprises traversing the list of parameters by traversing each parameter in the list of valid parameters to check if it is a mandatory parameter. Matching the mandatory parameters by checking for each mandatory parameter whether it exists in the list of valid parameters. If a parameter exists, it is further checked whether its value meets the constraints defined in the rule (e.g. data type, value range, etc.). Recording missing or unsatisfactory parameters if a certain mandatory parameter is found not to be present in the list of valid parameters or its value does not meet the rule requirements, recording the error. Filtering the effective parameters, namely filtering out missing or unsatisfactory parameters from an effective parameter list according to the checking result of the necessary parameters, and taking the rest parameters as effective parameter information.
Step S404, identifying the object code type corresponding to the request semantic representation, and inputting the object code type and the effective parameter information into the code generation model to obtain an initial calling code;
In this embodiment, the semantic analysis is performed on the semantic representation of the request to understand the request intention, so that the matched target code type is searched in a predefined code type mapping table or rule base according to the understood intention, wherein the target code type includes a programming language (such as Python, java, javaScr I pt, etc.), a framework (such as Django, spri ng, etc.), or a calling mode of a specific AP I. By constructing an input data structure containing object code type and valid parameter information, and inputting the input data structure into a code generation model to obtain an initial call code for model output, the code generation model can adopt a pre-trained sequence-to-sequence (Seq 2 Seq) model, and the sequence-to-sequence model is a model commonly used for natural language processing tasks, and can convert one sequence (such as text) into another sequence (such as code), wherein the sequence-to-sequence model can be specifically obtained by training by adopting a transducer-based model (such as GPT).
And step S405, adding return value processing logic to the initial calling code according to the return value processing rule to obtain the target calling code.
In this embodiment, the initial call code is extended according to the return value processing rules to add appropriate return value processing logic, where the return value processing logic includes error handling, result parsing, data conversion, and the like. And after the return value processing logic is added to the initial calling code, obtaining the final target calling code.
The method comprises the steps of carrying out matching in a predefined rule base according to the request semantic representation to obtain a parameter type matching rule, a necessary parameter checking rule and a return value processing rule, extracting a parameter list from the document key information, carrying out type checking and conversion processing on the parameter list according to the parameter type matching rule to obtain an effective parameter list, checking the effective parameter list according to the necessary parameter checking rule to obtain effective parameter information, identifying a target code type corresponding to the request semantic representation, inputting the target code type and the effective parameter information into the code generation model to obtain an initial call code, and adding return value processing logic to the initial call code according to the return value processing rule to effectively obtain a target call code generated based on the document key information and the request semantic representation, so that accuracy and effectiveness of the target call code are improved, and static analysis and dynamic test processing are facilitated.
With continued reference to fig. 7, in some alternative implementations of the present embodiment, step S50 includes the steps of:
Step S501, judging whether the grammar of the target calling code is correct or not according to a static analysis method;
In this embodiment, static analysis is a method of discovering potential errors by examining the source code of code without executing the code. The static analysis step may be performed by a static analysis tool, and the static analysis performed according to the static analysis tool includes word segmentation by dividing the string of code into a series of labels (tokens), typically keywords, identifiers, literal amounts, operators, separators, etc. in the code. Constructing a grammar tree, namely constructing a grammar tree (AST, abstract grammar tree) of codes according to the result of lexical analysis by using rules and regulations (generally defined in grammar files, such as BNF, EBNF and the like). And (3) verifying the grammar tree, namely checking whether the grammar tree accords with the grammar rule of the target programming language. It is possible to verify whether the type, the number of child nodes, the type, and the like of each node conform to expectations by traversing the syntax tree. Verifying the tokens, checking whether each token is legitimate, i.e. whether they are valid components of the target programming language. Therefore, whether the target calling code is correct or not is effectively judged.
Step S502, if the grammar of the target calling code is correct, a preset test case set is obtained, the target calling code is dynamically operated by executing the test case set, and the code test result is obtained;
In this embodiment, the test case set is a preset set of test cases, which should cover the main functions and boundary conditions of the code. By configuring the necessary test environments, including dependency libraries, database connections, file systems, etc. And executing each test case in the test case set by using the test framework or the tool. Each test case should contain input data and expected output. As each test case is executed, the actual output and any anomaly or error information is recorded. The actual output is compared to the expected output to determine if the test case passes. And obtaining code test results according to the execution results of all the test cases. After the code test result is obtained, a code test result report can be generated according to the code test result, and the test result report can contain information such as passing conditions, failure reasons (if any), code coverage rate and the like of the test cases.
Step S503, if the grammar of the target calling code is incorrect, inputting the target calling code into a pre-trained grammar correction model for correction processing to obtain a correction target substitute code, and re-judging whether the grammar of the correction target calling code is correct or not until the grammar of the correction target calling code is correct.
In this embodiment, the grammar correction model may use a Conditional Random Field (CRF), and the pre-trained grammar correction model is obtained by performing grammar error labeling (marking the position and type of the grammar error) on the collected sample code, and then training and optimizing the CRF model according to the labeled sample code.
The method comprises the steps of judging whether grammar of the target calling code is correct or not according to a static analysis method, if the grammar of the target calling code is correct, obtaining a preset test case set, executing the test case set to dynamically run the target calling code, and obtaining a code test result. If the grammar of the target calling code is incorrect, inputting the target calling code into a pre-trained grammar correction model for correction processing to obtain a correction target substitute code, and re-judging whether the grammar of the correction target calling code is correct or not until the grammar of the correction target calling code is correct. Therefore, effective analysis and test of the target calling code are realized, so that a corresponding code test result is obtained, and subsequent adjustment processing of a code generation model is facilitated.
With continued reference to fig. 8, in some alternative implementations of the present embodiment, step S60 includes the steps of:
S601, acquiring a preset standard test result, and judging whether the code test result accords with the standard test result;
In this embodiment, the standard test result is preset test result information, and each parameter in the standard test result corresponds to a parameter of the code test result, where the standard test result may include an expected output, such as an output that the code should generate under a specific input, performance indexes, such as execution time, memory usage, resource consumption, and the like, and behavior features, such as whether the code throws a specific exception, whether all boundary conditions are handled, and the like.
S602, if the code test result accords with the standard test result, taking a code generation model corresponding to the code test result as the effective code generation model;
In this embodiment, a code generation model with code test results conforming to standard test results is used as an effective code generation model, so as to obtain a model capable of effectively outputting qualified target call codes.
And S603, if the code test result does not accord with the standard test result, acquiring a difference item between the code test result and the standard test result, extracting correction information from a preset difference correction table according to the difference item, adjusting the code generation model based on the correction information, re-acquiring the adjusted code test result, and continuously repeating the steps of acquiring the difference item until the adjusted code test result accords with the standard test result, so as to obtain the effective code generation model.
In this embodiment, by comparing each parameter of the code test result and each parameter of the standard test result one by one, a difference item with a difference is identified, and then correction information is extracted from a preset difference correction table according to the identified difference item, where the difference correction table may be a preset database or knowledge base including common errors and correction schemes thereof. And after the correction information containing the correction scheme is obtained, corresponding parameters and structures of the model are adjusted according to the correction information, so that an adjusted code generation model is obtained. And then, continuously iterating based on the adjusted code generation model so that the adjusted code generation model can finally output the target calling code which accords with the standard test result.
The method comprises the steps of obtaining a preset standard test result, judging whether the code test result accords with the standard test result, taking a code generation model corresponding to the code test result as the effective code generation model if the code test result accords with the standard test result, obtaining a difference item of the code test result and the standard test result if the code test result does not accord with the standard test result, extracting correction information from a preset difference correction table according to the difference item, adjusting the code generation model based on the correction information, re-obtaining the adjusted code test result, and continuously repeating the steps of obtaining the difference item and adjusting the code generation model until the adjusted code test result accords with the standard test result to obtain the effective code generation model. Therefore, accurate adjustment of the code generation model according to the difference item of the code test result and the standard test result is effectively realized, the adjustment efficiency of the code generation model is improved, and an effective code generation model capable of outputting target calling codes conforming to the standard test result is obtained.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by computer readable instructions stored in a computer readable storage medium that, when executed, may comprise the steps of the embodiments of the methods described above. The storage medium may be a nonvolatile storage medium such as a magnetic disk, an optical disk, a Read-Only Memory (ROM), or a random access Memory (Random Access Memory, RAM).
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited in order and may be performed in other orders, unless explicitly stated herein. Moreover, at least some of the steps in the flowcharts of the figures may include a plurality of sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, the order of their execution not necessarily being sequential, but may be performed in turn or alternately with other steps or at least a portion of the other steps or stages.
With further reference to fig. 9, as an implementation of the method shown in fig. 1, the present application provides an embodiment of an interface calling device, where an embodiment of the device corresponds to the embodiment of the method shown in fig. 1, and the device may be specifically applied to various electronic devices.
As shown in fig. 9, the interface calling device 700 according to the present embodiment includes an information processing module 701, a semantic matching module 702, an information extraction module 703, a code generation module 704, a code test module 705, and a code adjustment module 706. Wherein:
the information processing module 701 is configured to obtain user request text information, and perform natural language processing on the user request text information to obtain a request semantic representation and key entity information;
the semantic matching module 702 is configured to perform semantic matching on the request semantic representation and the key entity information according to a pre-constructed interface knowledge graph, so as to obtain a target program interface document;
The information extraction module 703 is configured to perform structural analysis and information extraction on the target program interface document to obtain document key information;
the code generation module 704 is used for generating codes according to the document key information and the request semantic representation based on a pre-trained code generation model to obtain a target calling code;
The code test module 705 is configured to perform static analysis and dynamic test on the target call code to obtain a code test result;
and the code adjustment module 706 is configured to adjust the code generation model according to the code test result, obtain an effective code generation model, generate an adjustment target code according to the effective code generation model, and apply the adjustment target code to a target program interface for interface call.
According to the method, the device and the system for generating the interface, the user request text information can be obtained, natural language processing is conducted on the user request text information to obtain request semantic representation and key entity information, semantic matching is conducted on the request semantic representation and the key entity information according to a pre-built interface knowledge graph to obtain a target program interface document, structural analysis and information extraction are conducted on the target program interface document to obtain document key information, code generation is conducted according to the document key information and the request semantic representation based on a pre-trained code generation model to obtain target calling codes, static analysis and dynamic testing are conducted on the target calling codes to obtain code testing results, adjustment is conducted on the code generation model according to the code testing results to obtain an effective code generation model, adjustment target codes are generated according to the effective code generation model, and the adjustment target codes are applied to a target program interface to conduct interface calling. Therefore, accurate and effective application program interface calling is effectively realized according to the request text input by the user, and the accuracy and the effectiveness of the interface calling are improved.
In order to solve the technical problems, the embodiment of the application also provides computer equipment. Referring specifically to fig. 10, fig. 10 is a basic structural block diagram of a computer device according to the present embodiment.
The computer device 8 comprises a memory 81, a processor 82, a network interface 83 communicatively connected to each other via a system bus. It should be noted that only computer device 8 having components 81-83 is shown in the figures, but it should be understood that not all of the illustrated components are required to be implemented and that more or fewer components may be implemented instead. It will be appreciated by those skilled in the art that the computer device herein is a device capable of automatically performing numerical calculation and/or information processing according to a preset or stored instruction, and its hardware includes, but is not limited to, a microprocessor, an Application SPECIFIC INTEGRATED Circuit (ASIC), a Programmable gate array (Field-Programmable GATE ARRAY, FPGA), a digital Processor (DIGITAL SIGNAL Processor, DSP), an embedded device, and the like.
The computer equipment can be a desktop computer, a notebook computer, a palm computer, a cloud server and other computing equipment. The computer equipment can perform man-machine interaction with a user through a keyboard, a mouse, a remote controller, a touch pad or voice control equipment and the like.
The memory 81 includes at least one type of readable storage medium including flash memory, hard disk, multimedia card, card memory (e.g., SD or DX memory, etc.), random Access Memory (RAM), static Random Access Memory (SRAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), programmable Read Only Memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the storage 81 may be an internal storage unit of the computer device 8, such as a hard disk or a memory of the computer device 8. In other embodiments, the memory 81 may also be an external storage device of the computer device 8, such as a plug-in hard disk, a smart memory card (SMART MEDIA CARD, SMC), a Secure Digital (SD) card, a flash memory card (FLASH CARD) or the like, which are provided on the computer device 8. Of course, the memory 81 may also comprise both an internal memory unit of the computer device 8 and an external memory device. In this embodiment, the memory 81 is typically used to store an operating system and various application software installed on the computer device 8, such as computer readable instructions for interface calling methods. Further, the memory 81 may be used to temporarily store various types of data that have been output or are to be output.
The processor 82 may be a central processing unit (Central Processing Unit, CPU), controller, microcontroller, microprocessor, or other data processing chip in some embodiments. The processor 82 is typically used to control the overall operation of the computer device 8. In this embodiment, the processor 82 is configured to execute computer readable instructions stored in the memory 81 or process data, such as computer readable instructions for executing the interface calling method.
The network interface 83 may comprise a wireless network interface or a wired network interface, which network interface 83 is typically used to establish a communication connection between the computer device 8 and other electronic devices.
According to the embodiment, the computer equipment is adopted, user request text information can be obtained, natural language processing is conducted on the user request text information to obtain request semantic representation and key entity information, semantic matching is conducted on the request semantic representation and the key entity information according to a pre-built interface knowledge graph to obtain a target program interface document, structural analysis and information extraction are conducted on the target program interface document to obtain document key information, code generation is conducted according to the document key information and the request semantic representation based on a pre-trained code generation model to obtain target calling codes, static analysis and dynamic testing are conducted on the target calling codes to obtain code testing results, the code generation model is adjusted according to the code testing results to obtain an effective code generation model, adjustment target codes are generated according to the effective code generation model, and the adjustment target codes are applied to a target program interface to conduct interface calling. Therefore, accurate and effective application program interface calling is effectively realized according to the request text input by the user, and the accuracy and the effectiveness of the interface calling are improved.
The present application also provides another embodiment, namely, a computer-readable storage medium storing computer-readable instructions executable by at least one processor to cause the at least one processor to perform the steps of the interface invoking method as described above.
According to the embodiment, the computer readable storage medium is adopted, user request text information can be obtained, natural language processing is conducted on the user request text information to obtain request semantic representation and key entity information, semantic matching is conducted on the request semantic representation and the key entity information according to a pre-built interface knowledge graph to obtain a target program interface document, structural analysis and information extraction are conducted on the target program interface document to obtain document key information, code generation is conducted according to the document key information and the request semantic representation based on a pre-trained code generation model to obtain target calling codes, static analysis and dynamic testing are conducted on the target calling codes to obtain code testing results, adjustment is conducted on the code generation model according to the code testing results to obtain an effective code generation model, adjustment target codes are generated according to the effective code generation model, and the adjustment target codes are applied to a target program interface to conduct interface call. Therefore, accurate and effective application program interface calling is effectively realized according to the request text input by the user, and the accuracy and the effectiveness of the interface calling are improved.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present application.
It is apparent that the above-described embodiments are only some embodiments of the present application, but not all embodiments, and the preferred embodiments of the present application are shown in the drawings, which do not limit the scope of the patent claims. This application may be embodied in many different forms, but rather, embodiments are provided in order to provide a thorough and complete understanding of the present disclosure. Although the application has been described in detail with reference to the foregoing embodiments, it will be apparent to those skilled in the art that modifications may be made to the embodiments described in the foregoing description, or equivalents may be substituted for elements thereof. All equivalent structures made by the content of the specification and the drawings of the application are directly or indirectly applied to other related technical fields, and are also within the scope of the application.
The non-native company software tools or components present in the embodiments of the present application are presented by way of example only and are not representative of actual use.
Claims (10)
1. An interface calling method, which is characterized by comprising the following steps:
Acquiring user request text information, and performing natural language processing on the user request text information to obtain request semantic representation and key entity information;
Carrying out semantic matching on the request semantic representation and the key entity information according to a pre-constructed interface knowledge graph to obtain a target program interface document;
Carrying out structural analysis and information extraction on the target program interface document to obtain document key information;
Code generation is carried out according to the document key information and the request semantic representation based on a pre-trained code generation model, so that a target calling code is obtained;
performing static analysis and dynamic test on the target call code to obtain a code test result;
And adjusting the code generation model according to the code test result to obtain an effective code generation model, generating an adjustment target code according to the effective code generation model, and applying the adjustment target code to a target program interface for interface call.
2. The method for calling the interface according to claim 1, wherein the step of performing natural language processing on the text information requested by the user to obtain the requested semantic representation and the key entity information specifically comprises:
Performing word segmentation processing on the text information of the user request based on a preset word segmentation algorithm to obtain a request keyword;
performing part-of-speech tagging on the request keywords based on a pre-constructed part-of-speech tagging model to obtain tagged keywords;
performing dependency analysis on the labeling keywords to obtain keyword dependency;
constructing a semantic representation according to the request keywords and the keyword dependency relationship, and taking the semantic representation as the request semantic representation;
And carrying out key entity identification on the semantic representation to obtain the key entity information.
3. The interface calling method according to claim 1, wherein the step of performing semantic matching on the request semantic representation and the key entity information according to the pre-constructed interface knowledge graph to obtain a target program interface document specifically comprises:
extracting semantic vector representations of corresponding nodes from the interface knowledge graph according to the key entity information;
calculating the similarity of the semantic vector representation and the request semantic representation to obtain a similarity score;
Sorting the nodes in the interface knowledge graph according to the similarity score to obtain the most relevant target nodes;
and extracting the target program interface document from a preset document database according to the most relevant target node.
4. The method for calling interface according to claim 1, wherein the steps of performing structural analysis and information extraction on the target program interface document to obtain the document key information specifically include:
preprocessing the target program interface document to obtain an effective program interface document;
carrying out semantic analysis on the effective program interface document to obtain a document key sentence and a document key paragraph;
And carrying out structural representation on the document key sentences and the document key paragraphs to obtain the document key information.
5. The interface calling method according to claim 1, wherein the step of generating the target calling code by the pre-trained code generation model according to the document key information and the request semantic representation specifically comprises the steps of:
matching is carried out in a predefined rule base according to the request semantic representation, and a parameter type matching rule, a necessary parameter checking rule and a return value processing rule are obtained;
Extracting a parameter list from the document key information, and performing type checking and conversion processing on the parameter list according to the parameter type matching rule to obtain an effective parameter list;
checking the effective parameter list according to the necessary parameter checking rule to obtain effective parameter information;
identifying a target code type corresponding to the request semantic representation, and inputting the target code type and the effective parameter information into the code generation model to obtain an initial calling code;
And adding return value processing logic to the initial calling code according to the return value processing rule to obtain the target calling code.
6. The method for calling an interface according to claim 1, wherein the step of performing static analysis and dynamic test on the target calling code to obtain a code test result specifically comprises:
Judging whether the grammar of the target calling code is correct or not according to a static analysis method;
And if the grammar of the target calling code is correct, acquiring a preset test case set, and executing the test case set to dynamically run the target calling code to obtain the code test result.
7. The method for calling an interface according to claim 1, wherein the step of adjusting the code generation model according to the code test result to obtain an effective code generation model specifically comprises:
acquiring a preset standard test result, and judging whether the code test result accords with the standard test result;
If the code test result accords with the standard test result, taking a code generation model corresponding to the code test result as the effective code generation model;
If the code test result does not accord with the standard test result, obtaining a difference item between the code test result and the standard test result, extracting correction information from a preset difference correction table according to the difference item, adjusting the code generation model based on the correction information, re-obtaining the adjusted code test result, and continuously repeating the steps of obtaining the difference item until the code generation model is adjusted until the adjusted code test result accords with the standard test result, so as to obtain the effective code generation model.
8. An interface calling device, comprising:
The information processing module is used for acquiring user request text information, and carrying out natural language processing on the user request text information to obtain request semantic representation and key entity information;
The semantic matching module is used for carrying out semantic matching on the request semantic representation and the key entity information according to a pre-constructed interface knowledge graph to obtain a target program interface document;
The information extraction module is used for carrying out structural analysis and information extraction on the target program interface document to obtain document key information;
The code generation module is used for generating codes according to the document key information and the request semantic representation based on a pre-trained code generation model to obtain a target calling code;
The code testing module is used for carrying out static analysis and dynamic testing on the target calling code to obtain a code testing result;
And the code adjustment module is used for adjusting the code generation model according to the code test result to obtain an effective code generation model, generating an adjustment target code according to the effective code generation model, and applying the adjustment target code to a target program interface for interface call.
9. A computer device comprising a memory and a processor, the memory having stored therein computer readable instructions which when executed by the processor implement the steps of the interface invocation method of any of claims 1 to 7.
10. A computer readable storage medium having stored thereon computer readable instructions which when executed by a processor implement the steps of the interface invoking method as claimed in any of claims 1 to 7.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202510021120.8A CN119960938B (en) | 2025-01-06 | 2025-01-06 | Interface calling method, device, computer equipment and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202510021120.8A CN119960938B (en) | 2025-01-06 | 2025-01-06 | Interface calling method, device, computer equipment and storage medium |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN119960938A true CN119960938A (en) | 2025-05-09 |
| CN119960938B CN119960938B (en) | 2025-10-10 |
Family
ID=95599463
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202510021120.8A Active CN119960938B (en) | 2025-01-06 | 2025-01-06 | Interface calling method, device, computer equipment and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN119960938B (en) |
Cited By (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN120579555A (en) * | 2025-08-04 | 2025-09-02 | 江苏中天科技股份有限公司 | Interface management method, device, electronic device and storage medium based on industrial Internet platform |
| CN120723207A (en) * | 2025-06-24 | 2025-09-30 | 广州工程技术职业学院 | Natural language and code conversion method, system, device and storage medium |
| CN120762806A (en) * | 2025-09-09 | 2025-10-10 | 浙江宇丰信息技术有限公司 | Industrial HMI generation method and system based on large model |
| CN120892088A (en) * | 2025-09-28 | 2025-11-04 | 北京搜狐互联网信息服务有限公司 | Android system version upgrade code adaptation methods and related devices |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114942889A (en) * | 2022-06-16 | 2022-08-26 | 平安普惠企业管理有限公司 | Interface calling test method, device, equipment and storage medium |
| CN115827417A (en) * | 2021-09-16 | 2023-03-21 | 腾讯科技(深圳)有限公司 | Interface testing method, related equipment, storage medium and program product |
| CN117311856A (en) * | 2022-06-24 | 2023-12-29 | 北京顺源开华科技有限公司 | Method and device for generating interface calling code |
| CN118964218A (en) * | 2024-10-16 | 2024-11-15 | 网思科技股份有限公司 | API intelligent management method, device, storage medium and computer equipment |
-
2025
- 2025-01-06 CN CN202510021120.8A patent/CN119960938B/en active Active
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN115827417A (en) * | 2021-09-16 | 2023-03-21 | 腾讯科技(深圳)有限公司 | Interface testing method, related equipment, storage medium and program product |
| CN114942889A (en) * | 2022-06-16 | 2022-08-26 | 平安普惠企业管理有限公司 | Interface calling test method, device, equipment and storage medium |
| CN117311856A (en) * | 2022-06-24 | 2023-12-29 | 北京顺源开华科技有限公司 | Method and device for generating interface calling code |
| CN118964218A (en) * | 2024-10-16 | 2024-11-15 | 网思科技股份有限公司 | API intelligent management method, device, storage medium and computer equipment |
Non-Patent Citations (1)
| Title |
|---|
| 宋文灏等: ""一种有效的API搜索算法"", 《计算机与现代化》, no. 04, 15 April 2016 (2016-04-15), pages 63 - 68 * |
Cited By (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN120723207A (en) * | 2025-06-24 | 2025-09-30 | 广州工程技术职业学院 | Natural language and code conversion method, system, device and storage medium |
| CN120579555A (en) * | 2025-08-04 | 2025-09-02 | 江苏中天科技股份有限公司 | Interface management method, device, electronic device and storage medium based on industrial Internet platform |
| CN120762806A (en) * | 2025-09-09 | 2025-10-10 | 浙江宇丰信息技术有限公司 | Industrial HMI generation method and system based on large model |
| CN120892088A (en) * | 2025-09-28 | 2025-11-04 | 北京搜狐互联网信息服务有限公司 | Android system version upgrade code adaptation methods and related devices |
| CN120892088B (en) * | 2025-09-28 | 2026-01-27 | 北京搜狐互联网信息服务有限公司 | Android system version upgrade code adaptation methods and related devices |
Also Published As
| Publication number | Publication date |
|---|---|
| CN119960938B (en) | 2025-10-10 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN119960938B (en) | Interface calling method, device, computer equipment and storage medium | |
| US8924197B2 (en) | System and method for converting a natural language query into a logical query | |
| CN113779062B (en) | SQL statement generation method, device, storage medium and electronic device | |
| US9754083B2 (en) | Automatic creation of clinical study reports | |
| WO2023278052A1 (en) | Automated troubleshooter | |
| CN105378731A (en) | Correlating corpus/corpora value from answered questions | |
| CN111143556A (en) | Software function point automatic counting method, device, medium and electronic equipment | |
| CN117252261A (en) | Knowledge graph construction methods, electronic devices and storage media | |
| CN119719321A (en) | Query statement generation method, device, equipment and storage medium | |
| EP3815026A1 (en) | Systems and methods for identifying and linking events in structured proceedings | |
| CN119441443A (en) | Automatic prompt construction method based on human-computer dialogue history and semantic retrieval | |
| CN111126073B (en) | Semantic retrieval method and device | |
| US11947530B2 (en) | Methods and systems to automatically generate search queries from software documents to validate software component search engines | |
| US11983506B2 (en) | Hybrid translation system using a general-purpose neural network machine translator | |
| US12282513B2 (en) | Optimistic facet set selection for dynamic faceted search | |
| CN115098642A (en) | Data processing method and device, computer equipment and storage medium | |
| CN120029604A (en) | Training data generation method, device, equipment and medium | |
| CN119884473A (en) | Service information retrieval method, device and storage medium | |
| CN120011385A (en) | Database query method, device, equipment and medium based on natural language | |
| CN116383412B (en) | Function point amplification method and system based on knowledge graph | |
| CN117435189A (en) | Test case analysis method, device, equipment and medium of financial system interface | |
| CN115618872A (en) | Triple construction method, apparatus, computer device and medium | |
| CN118445312A (en) | Method for constructing grammar tree and method for generating search statement | |
| CN119884315A (en) | Text retrieval method based on knowledge graph and related equipment | |
| CN121070926A (en) | Automatic table building method and system based on large language model and knowledge graph |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |