Application programming interface marked student model training method and device

By acquiring API interface pipeline information and utilizing short text semantic matching and knowledge distillation training methods of large language models, a target student model is generated, which solves the problem of insufficient API tagging data in existing technologies and achieves more accurate and flexible API tagging.

CN120930753APending Publication Date: 2025-11-11AGRICULTURAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511059189.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-30
Publication Date
2025-11-11

AI Technical Summary

Technical Problem

The lack of high-quality API tagging data in existing technologies makes it impossible to accurately generate API tags during the API tagging process. In particular, when faced with complex and dynamically changing API interface information, existing methods are inflexible and cannot provide efficient and accurate tagging.

Method used

By acquiring the API pipeline information, identifying key information, using a pre-set short text semantic matching model for similarity matching, determining similar tag types, performing knowledge distillation through a large language model, and training the basic model with teacher model knowledge, a target student model is generated.

Benefits of technology

It improves the accuracy and flexibility of API tagging, provides rich semantic information, enhances the recognition performance of student models, and solves the problem of lack of high-quality data in existing technologies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120930753A_ABST
    Figure CN120930753A_ABST
Patent Text Reader

Abstract

The invention discloses a student model training method and device of application programming interface marking. The method is characterized by comprising the following steps: acquiring at least one piece of interface flow information of an application programming interface, and identifying interface key information corresponding to each piece of interface flow information; for each piece of interface key information, performing similarity matching on the interface key information based on a preset short text semantic matching model, and determining two similar tag types; for each piece of interface key information, knowledge distillation is carried out based on two similar label types and the interface key information through a large language model, and interface labels and teacher model knowledge are determined; and training the basic model based on all the interface key information, the interface labels and the teacher model knowledge to obtain a target student model. According to the invention, a large model can be used as a teacher model, when the label information of the interface is output, rich semantic information can be provided, and the model performance of the student model and the identification effect of the student model are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of API processing technology, and in particular to a method and apparatus for training a student model using application programming interface (API) tags. Background Technology

[0002] With the development of modern software and network technologies, APIs (Application Programming Interfaces) have become the core link for data exchange and functional integration. However, because they are exposed to the internet, they have also become targets for attackers. Once an attacker breaches an API, they may obtain a large amount of user information, sensitive data, trade secrets, and even tamper with critical system business data, leading to incalculable losses. In API management, API asset tagging can provide more contextual information to security software, allowing downstream businesses to analyze network attack characteristics. The effectiveness of API tagging often determines the effectiveness of security protection. High-quality API tagging often requires a large number of high-quality labeled datasets, but currently, high-quality labeled datasets are lacking. Existing API tagging systems rely on fixed text rules, using manually written rules to identify and tag relevant API information. While this method can handle simple API information, it lacks flexibility and adaptability, and struggles to provide efficient and accurate tagging for complex API interface information and dynamically changing API parameters. Summary of the Invention

[0003] This invention provides a student model training method and apparatus for API tagging, in order to solve the technical problem in the prior art that the lack of high-quality API tagging data leads to the inability to accurately generate API tags during the API tagging process.

[0004] According to one aspect of the present invention, a method for training a student model using an application programming interface (API) tag is provided, comprising:

[0005] Obtain at least one interface pipeline information of the application programming interface, and identify the key interface information corresponding to each interface pipeline information;

[0006] For each of the key information of the interface, the key information of the interface is matched for similarity based on a preset short text semantic matching model to determine two similar label types;

[0007] For each of the key information of the interface, knowledge distillation is performed using a large language model based on two similar label types and the key information of the interface to determine the interface label and teacher model knowledge;

[0008] Based on all the key information of the interfaces, the interface labels, and the teacher model knowledge training base model, the target student model is obtained.

[0009] According to another aspect of the present invention, a student model training apparatus marked with an application programming interface is provided, comprising:

[0010] An interface processing module is used to obtain at least one interface pipeline information of an application programming interface and identify the key interface information corresponding to each interface pipeline information.

[0011] The matching module is used to perform similarity matching on each of the interface key information based on a preset short text semantic matching model to determine two similar label types.

[0012] The teacher module is used to determine the interface label and teacher model knowledge by performing knowledge distillation based on two similar label types and the interface key information for each of the aforementioned interface key information using a large language model.

[0013] The student training module is used to train a basic model based on all the key information of the interfaces, the interface labels, and the teacher model knowledge to obtain the target student model.

[0014] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0015] At least one processor; and

[0016] A memory communicatively connected to the at least one processor; wherein,

[0017] The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the student model training method marked by the application programming interface as described in any embodiment of the present invention.

[0018] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the student model training method marked by the application programming interface as described in any embodiment of the present invention.

[0019] The technical solution of this invention involves acquiring at least one interface pipeline information of an application programming interface (API), identifying key interface information corresponding to each interface pipeline information, and for each key interface information, performing similarity matching based on a preset short text semantic matching model to determine two similar tag types. For each key interface information, a large language model is used to perform knowledge distillation based on the two similar tag types and the key interface information to determine interface tags and teacher model knowledge. A base model is trained based on all the key interface information, the interface tags, and the teacher model knowledge to obtain a target student model. This solves the technical problem in existing technologies where the lack of high-quality API tagging data leads to the inability to accurately generate API tags during the API tagging process. This invention can utilize a large model as a teacher model, providing rich semantic information when outputting interface tagging information, thereby improving the model performance and recognition effect of the student model.

[0020] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0021] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0022] Figure 1 A flowchart of a student model training method using application programming interface (API) tags is provided as an embodiment of the present invention;

[0023] Figure 2 A flowchart illustrating a student model training method using an application programming interface (API) tag, as provided in this embodiment of the invention;

[0024] Figure 3 A flowchart illustrating a student model training method using an application programming interface (API) tag, as provided in this embodiment of the invention;

[0025] Figure 4 This is a schematic diagram of the structure of a student model training device with an application programming interface (API) tag, provided in an embodiment of the present invention.

[0026] Figure 5 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. Detailed Implementation

[0027] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0028] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0029] Figure 1 This invention provides a flowchart of a student model training method for API-tagged models. This embodiment is applicable to specific methods for training student models that tag APIs. This method can be executed by an API-tagged student model training device, which can be implemented in hardware and / or software and can be configured in an electronic device. Figure 1 As shown, the method includes:

[0030] S110. Obtain at least one interface pipeline information of the application programming interface, and identify the key interface information corresponding to each interface pipeline information.

[0031] Application Programming Interface (API) is used to connect to software components or hardware.

[0032] Specifically, API log information can be information that records detailed API call logs during the API call and interaction process. It should be noted that API log information records structured information about API calls, API responses, and API business behavior.

[0033] Optionally, the interface pipeline information mainly consists of interface identification information, call process information, business behavior information, and interface logs. In this invention, the interface pipeline information also records the URL, API method response path, API request method, and API output parameters. The URL (Uniform Resource Locator), API method relative path, API request method, and API output parameters constitute the key interface information. This key interface information serves as semantic input data for interface tagging.

[0034] Specifically, obtain at least one interface pipeline information corresponding to multiple application programming interfaces, perform structured parsing on each interface pipeline information, extract the URL, API method response path, API request method, and API output parameters from each interface pipeline information, and use the URL, API method response path, API request method, and API output parameters as interface key information to obtain at least one interface key information.

[0035] Optionally, in another optional embodiment of the present invention, identifying the interface key information corresponding to each of the interface pipeline information includes:

[0036] Keyword extraction is performed on the interface flow information based on string matching method to determine the key information of the interface corresponding to the interface flow information.

[0037] Among these methods, string matching can be used to extract key information. For example, the string matching method can be at least one of regular expressions, keyword matching, and pattern matching.

[0038] Optionally, since URLs, API method response paths, API request methods, and API output parameters have fixed characteristic information, when matching strings, URLs can be matched using http: / / or https: / / , API method response paths can be matched using version numbers and business paths starting with / , API request methods can be matched using fixed values ​​such as GET / POST / PUT / DELETE, and API output parameters can be matched using characteristic data corresponding to the business scenario. For example, for bank amounts, numbers with decimal points can be selected.

[0039] Specifically, keyword extraction is performed on the interface flow information based on string matching methods to determine the key information of the interface corresponding to the interface flow information.

[0040] S120. For each of the interface key information, perform similarity matching on the interface key information based on a preset short text semantic matching model to determine two similar label types.

[0041] The preset short text semantic matching model can be a pre-set model for semantic matching. It should be noted that the short text semantic matching model can be pre-trained or an open-source model; this invention does not limit its use. For example, the short text semantic matching model can be the open-source SimNet model.

[0042] Among them, similar tag types can be the two tag types in an open-source external tag library that have the highest similarity to the key information of the interface.

[0043] Optionally, an open-source external tag library can be a tag collection library provided externally and that can be called; based on the open-source external tag library, APIs can be standardized and categorized. In the open-source external tag library, tag collections of multiple tag types can be provided, and the tag collections under each tag type include multiple tags.

[0044] Among them, two similar tag types can be the two tag types in an open-source external tag library that have the highest similarity to the key information of the interface.

[0045] Optionally, in this invention, for each interface key information, each interface key information is used as the input text of the short text semantic matching model, and the tag set corresponding to each tag type of the open-source external tag library is used as the candidate tag. Based on the semantics of the input text and the candidate tags, the short text semantic matching model maps them to text vectors and tag vectors. The similarity between the text vectors and tag vectors is calculated by cosine distance, and the tag types corresponding to the two candidate tags with the highest similarity are used as similar tag types.

[0046] For example, a short text semantic matching model could be the open-source SimNet model, with the input text using T... input To represent, candidate labels use L _i The representation is performed by mapping it to a text vector V using the open-source SimNet model. text =f p (T input ) and label vector V i =f p (L _i ), f p The representation layer mapping of SimNet is shown below. Cosine distance is used to calculate the similarity between text vectors and label vectors, as shown in the formula below:

[0047]

[0048] Specifically, for each of the interface key information, a similarity match is performed on the interface key information based on a preset short text semantic matching model to determine two similar tag types for each interface key information.

[0049] S130. For each of the interface key information, knowledge distillation is performed using a large language model based on the two similar label types and the interface key information to determine the interface label and teacher model knowledge.

[0050] The interface tag can be a tag for key information about the interface. For example, taking the key information of a money transfer interface as an example, similar tag types could be bank function tags, and the interface tag could be a money transfer tag.

[0051] Optionally, the knowledge distillation process for each interface key information is as follows: input the interface key information and two similar label types of the interface key information into the large language model. The large language model will perform knowledge distillation based on the interface key information and the two similar label types. Based on the semantic analysis and label matching of the interface key information and the two similar label types, the output interface label matching the interface key information is generated.

[0052] The teacher model knowledge can be semantic information from the key information of the large language model's output interface. It should be noted that the large language model, as the teacher model in this invention, is capable of outputting teacher model knowledge based on the key information of the interface.

[0053] Optionally, the large language model can be any large language model connected to DeepSeek. The large language model can be set up locally or connected to the network.

[0054] Specifically, for each key piece of interface information, knowledge distillation is performed using a large language model based on the two similar label types and the key piece of interface information to determine the corresponding interface label and teacher model knowledge for each key piece of interface information.

[0055] S140. Based on all the key information of the interface, the interface label and the teacher model knowledge training basic model, the target student model is obtained.

[0056] The base model can be a pre-trained language model built on the Transformer architecture. For example, the base model can be built using BERT (Bidirectional Encoder Representations from Transformers) or DeBERTa (Decoding-enhanced BERT with Disentangled Attention).

[0057] The target student model can be a student model trained based on the base model. It should be noted that the target student model has the ability to assign labels to APIs. When API pipeline information is input into the target student model, it identifies the API pipeline information based on an open-source external label library and assigns labels to the pipeline information.

[0058] Specifically, the target student model is obtained by training the basic model based on all key interface information, interface labels, and teacher model knowledge.

[0059] The technical solution of this invention involves acquiring at least one interface pipeline information of an application programming interface (API), identifying key interface information corresponding to each interface pipeline information, and for each key interface information, performing similarity matching based on a preset short text semantic matching model to determine two similar tag types. For each key interface information, a large language model is used to perform knowledge distillation based on the two similar tag types and the key interface information to determine interface tags and teacher model knowledge. A base model is trained based on all the key interface information, the interface tags, and the teacher model knowledge to obtain a target student model. This solves the technical problem in existing technologies where the lack of high-quality API tagging data leads to the inability to accurately generate API tags during the API tagging process. This invention can utilize a large model as a teacher model, providing rich semantic information when outputting interface tagging information, thereby improving the model performance and recognition effect of the student model.

[0060] Figure 2 This is a flowchart illustrating a student model training method using an application programming interface (API) tag, as provided in this embodiment of the invention. The relationship between this embodiment and the previous embodiments is that this method represents a specific method for knowledge distillation of a teacher model. Figure 2 As shown, the method includes:

[0061] S210. Obtain at least one interface pipeline information of the application programming interface, and identify the key interface information corresponding to each interface pipeline information.

[0062] S220. For each of the interface key information, perform similarity matching on the interface key information based on a preset short text semantic matching model to determine two similar label types.

[0063] S230. Construct large model input information based on two similar label types and the key information of the interface using preset dialogue requirement information.

[0064] The dialogue requirements information can be the prompts for constructing the large language model. It should be noted that the dialogue requirements information mainly consists of seven aspects: task role, role capabilities, task background, task objective, workflow, output example, and additional requirements. The task role clarifies the identity or role the large language model needs to play in the dialogue task, defining the scope of the model's language style, knowledge reserves, and perspective. Role capabilities clarify the role's professional skills, knowledge domain, and experience level. The task objective clarifies the desired final result or purpose through the dialogue task. The workflow clarifies the steps, processes, or operational sequence required for the task, providing a clear execution path for the large language model, ensuring orderly task progress, and avoiding omissions or logical inconsistencies. The output example provides one or more expected output samples, demonstrating the format, content style, and structure of the final result. Additional requirements are additional restrictions or supplementary explanations for the task output.

[0065] The large model input information can be dialogue prompts constructed based on dialogue requirements by combining two similar label types and key interface information. For example, the large model input information is constructed based on seven aspects: Task Role: You are a bank interface label analysis engineer, focusing on the label analysis and selection of individual bank interfaces. You are able to accurately match labels for interface information from similar label types, contributing to the standardized management of bank interfaces.

[0066] Role Capabilities: Familiar with the business logic and technical characteristics of various bank interfaces; possesses strong semantic analysis capabilities; can accurately grasp the semantic relationship between interface information and tag types; understands the principles and methods of tag selection; can clearly explain the reasons for selection; and ensures the rationality and accuracy of tag selection.

[0067] Task Background: During the standardization management of interfaces, banks are refining the tagging system for individual key interfaces (such as account query interfaces). Given two similar tag types (business attribute tags and technical attribute tags) and related information for the interface, the task is to use semantic analysis to select appropriate tags for the interface information from these two similar tag types to improve interface recognition and management efficiency.

[0068] Task objective: Given two similar tag types (business attribute tags and technical attribute tags) and information from a single interface (account query interface), perform semantic analysis to clarify the matching logic between tags and interface information, and finally select the most appropriate tag for the interface information from the two similar tag types.

[0069] Workflow: Define two similar tag types: business attribute tags mainly involve business-level content such as the interface's business functions and application scenarios; technical attribute tags mainly focus on technical-level content such as the interface's technical implementation and data transmission methods. Organize the information for the account query interface: including support for real-time account balance queries, use of XML data format, and verification of the queryer's identity.

[0070] Perform semantic analysis on tag types and interface information: Analyze the core semantics of each interface message to determine whether it better matches business attributes or technical attributes. Based on semantic matching, select the corresponding tag for each interface message from two similar tag types. Explain the reasons for the selection to ensure its rationality.

[0071] Output Example: Similar Tag Types: Business Attribute Tags (reflecting the interface's business functions, application scenarios, etc.), Technical Attribute Tags (reflecting the interface's technical implementation, data format, etc.). Interface Information: The account query interface includes support for real-time account balance queries, use of XML data format, and requirement to verify the queryer's identity information. Semantic Analysis: "Supports real-time account balance queries" describes the core business function of the interface, which highly matches the semantics of the business attribute tags; "Uses XML data format" reflects the interface's data transmission format, belonging to the technical implementation level, and is closely related to the semantics of the technical attribute tags; "Requires verification of the queryer's identity information" is for ensuring business security, belonging to an important part of the business process, and is even closer to the semantics of the business attribute tags. Tag Selection Results: Tags corresponding to the account query interface information: Business Attribute Tags (supports real-time account balance queries, requires verification of the queryer's identity information), Technical Attribute Tags (uses XML data format).

[0072] Reasons for selection: The business attribute tags focus on the business functions and processes of the interface. The selected "Supports real-time account balance query" and "Requires verification of the queryer's identity information" directly reflect the characteristics and requirements of the interface at the business level. The technical attribute tags focus on the technical implementation details of the interface. "Uses XML data format" accurately reflects the technical characteristics of the interface and has the highest semantic matching degree with the technical attribute tags.

[0073] Additional requirements: Semantic analysis should deeply analyze the core meaning of the interface information and clearly show the relationship with the tag type; tag selection must be based on semantic matching degree to avoid subjective arbitrariness; the expression should be concise and standardized, in line with the style of bank technical documents; the tag corresponding to each interface information should be unique and accurate, without duplication or errors.

[0074] Specifically, the input information of the large model is constructed based on two similar label types and the key information of the interface, using preset dialogue requirements.

[0075] S240. Input the large model input information into the large language model for knowledge distillation to determine the interface label and semantic information.

[0076] Among them, semantic information can be the core meaning of key information in the large language model analysis interface.

[0077] Optionally, semantic information can be additional supervised samples output by the large language model as the teacher model, and the base model as the learning model can learn more knowledge representations based on semantic information. Semantic information enhances the recognition accuracy and generalization ability of the student model.

[0078] Specifically, the large model input information is input into the large language model for knowledge distillation to determine the interface labels and semantic information.

[0079] S250. If the interface label and the semantic information satisfy the preset training objective, the semantic information is determined as the teacher model knowledge.

[0080] The training objective can be pre-set requirements for the correctness of the output results and inference steps of the large language model. It should be noted that a large language model equipped with DeepSeek will display the logical inference steps that generate the results when outputting them. By setting the training objective, the correctness of these logical inference steps can be detected. After the large language model outputs interface labels for key information of each interface, the accuracy rate of the output is identified, and it is determined whether the accuracy rate meets the accuracy threshold set by the training objective. Furthermore, the semantic recognition accuracy of the output semantic information is assessed, and it is determined whether the semantic recognition accuracy meets the semantic correctness threshold set by the training objective.

[0081] Optionally, by identifying the logical reasoning steps of the large language model, it can be determined whether the logical reasoning steps are the same as the steps set in the training objective, and the accuracy rate and semantic recognition accuracy rate of the output interface labels of the large language model can be identified. If the steps are the same and the accuracy rate and semantic recognition accuracy rate of the interface labels meet the accuracy threshold and semantic accuracy threshold, then the interface labels and semantic information are considered to meet the preset training objective, and the semantic information is identified as teacher model knowledge.

[0082] Optionally, in another optional embodiment of the present invention, after inputting the large model input information into the large language model for knowledge distillation to determine the interface label and semantic information, the method further includes:

[0083] If the interface label and the semantic information do not meet the preset training objective, the process returns to the step of constructing large model input information based on two similar label types and the interface key information using preset dialogue requirement information, until the interface label and the semantic information meet the preset training objective.

[0084] Optionally, by identifying the logical reasoning steps of the large language model, it is determined whether the logical reasoning steps are the same as the steps set in the training objective, and the accuracy rate and semantic recognition accuracy of the output interface labels of the large language model are identified. If the steps are different, but the accuracy rate of the interface labels and the semantic recognition accuracy rate meet the accuracy threshold and semantic accuracy threshold, it is considered that the interface labels and semantic information do not meet the preset training objective. The process returns to the step of constructing the input information of the large model based on two similar label types and the interface key information using preset dialogue requirement information, until the interface labels and the semantic information meet the preset training objective.

[0085] Optionally, by identifying the logical reasoning steps of the large language model, it is determined whether the logical reasoning steps are the same as the steps set in the training objective, and the accuracy of the output interface labels and semantic recognition accuracy of the large language model are identified. If the steps are the same, but the accuracy of the interface labels and semantic recognition accuracy do not meet the accuracy threshold and semantic accuracy threshold, it is considered that the interface labels and semantic information do not meet the preset training objective. The process returns to the step of constructing the input information of the large model based on two similar label types and the interface key information using preset dialogue requirement information, until the interface labels and semantic information meet the preset training objective.

[0086] S260. Based on all the key information of the interface, the interface label and the teacher model knowledge training base model, the target student model is obtained.

[0087] The technical solution of this invention involves acquiring at least one interface pipeline information of an application programming interface (API), identifying key interface information corresponding to each interface pipeline information, and for each key interface information, performing similarity matching based on a preset short text semantic matching model to determine two similar tag types. For each key interface information, a large language model is used to perform knowledge distillation based on the two similar tag types and the key interface information to determine interface tags and teacher model knowledge. A base model is trained based on all the key interface information, the interface tags, and the teacher model knowledge to obtain a target student model. This solves the technical problem in existing technologies where the lack of high-quality API tagging data leads to the inability to accurately generate API tags during the API tagging process. This invention can utilize a large model as a teacher model, providing rich semantic information when outputting interface tagging information, thereby improving the model performance and recognition effect of the student model.

[0088] Figure 3 This is a flowchart illustrating a student model training method using an application programming interface (API) tag, as provided in this embodiment of the invention. The relationship between this embodiment and the previous embodiments explains the specific method for training the base model. Figure 3As shown, the method includes:

[0089] S310. Obtain at least one interface pipeline information of the application programming interface, and identify the key interface information corresponding to each interface pipeline information.

[0090] S320. For each of the interface key information, perform similarity matching on the interface key information based on a preset short text semantic matching model to determine two similar label types.

[0091] S330. For each of the interface key information, knowledge distillation is performed using a large language model based on the two similar label types and the interface key information to determine the interface label and teacher model knowledge.

[0092] S340. Construct a model training set for the basic model based on the key information of each interface, the interface label, and the teacher model knowledge.

[0093] Optionally, after each output of the interface tags and teacher model knowledge of the key interface information by the large language model, the null values ​​and unmatched fields in the interface tags and teacher model knowledge are identified, thereby obtaining the cleaned interface tags and teacher model knowledge.

[0094] Optionally, each interface key information, along with the interface label and teacher model knowledge of that interface key information, constitutes the model training data, and multiple model training data constitute the model training set.

[0095] Specifically, a model training set for the basic model is constructed based on key information of each interface, interface tags, and teacher model knowledge.

[0096] Optionally, in another optional embodiment of the present invention, the step of constructing the model training set of the basic model based on each of the interface key information, the interface label, and the teacher model knowledge includes:

[0097] For each of the key information of the interface, English sentences are constructed based on preset English sentence generation rules to obtain English interface information; each of the English interface information, the corresponding interface tag, and the teacher model knowledge are determined as the model training data to construct the model training set.

[0098] Among them, the English sentence generation rules can be pre-set sentence generation rules for constructing English sentences.

[0099] The English API information can include key API information in English. For example, a typical example is: "The API endpoint *at *uses *request method have Input Parameters: *", where the four asterisks represent the URL, the relative path of the API method, the request method, and the output parameters, respectively.

[0100] Optionally, the English statement generation rules will use the URL information of the key interface information, the relative path of the interface method, the request method, and the output parameters as elements to construct the statement, following the English grammatical structure, and construct the English interface information.

[0101] Optionally, each key information of the interface is used to construct corresponding English interface information based on English sentence generation rules. Each English interface information, along with interface tags and teacher model knowledge, is combined to form model training data, and multiple model training data are combined to form a model training set.

[0102] Specifically, for each of the key interface information, English sentences are constructed based on preset English sentence generation rules to obtain English interface information; each of the English interface information, the corresponding interface tag, and the teacher model knowledge are determined as the model training data to construct the model training set.

[0103] S350. Input each model training data in the model training set into the base model in sequence to train the model and obtain the target student model.

[0104] Optionally, when training using the training data of each model in the training set, for each training data set, text processing logic is performed on the training data based on the pre-trained BERT-base-uncased tokenizer. This generates a vocabulary index, valid tokens, and different tagging information for labeled text pairs. Based on the vocabulary index, valid tokens, and different tagging information for labeled text pairs, the base model is input for feature extraction. The base model processes the input sequence through a multi-layer Transformer structure, combining dynamic positional biases to capture semantic relationships between tokens, generating contextual features for each token, extracting semantic feature information from the text, performing label classification based on semantic features, and finally outputting a feature sentence. The feature sentence records the semantic feature information and labels of the model training data.

[0105] Optionally, during the training of the base model, the model parameters can be adjusted by using the cross-entropy loss function to calculate the loss based on the semantic feature information and labels of the model training data, the real interface labels, and the teacher model knowledge, in order to balance and reduce the semantic and label losses in the training of the base model.

[0106] Optionally, after each round of training the base model using the model training set, the model performance of the base model is verified. If the performance of the base model improves, the model training set is used to continue training the base model. If the performance of the base model does not change after multiple rounds of training, the base model is used as the target student model.

[0107] Specifically, each model training data in the model training set is sequentially input into the base model for model training to obtain the target student model.

[0108] The technical solution of this invention involves acquiring at least one interface pipeline information of an application programming interface (API), identifying key interface information corresponding to each interface pipeline information, and for each key interface information, performing similarity matching based on a preset short text semantic matching model to determine two similar tag types. For each key interface information, a large language model is used to perform knowledge distillation based on the two similar tag types and the key interface information to determine interface tags and teacher model knowledge. A base model is trained based on all the key interface information, the interface tags, and the teacher model knowledge to obtain a target student model. This solves the technical problem in existing technologies where the lack of high-quality API tagging data leads to the inability to accurately generate API tags during the API tagging process. This invention can utilize a large model as a teacher model, providing rich semantic information when outputting interface tagging information, thereby improving the model performance and recognition effect of the student model.

[0109] Figure 4 This is a schematic diagram of a student model training device with an application programming interface (API) tag, provided as an embodiment of the present invention. Figure 4 As shown, the device includes: an interface processing module 410, a matching module 420, a teacher module 430, and a student training module 440; wherein,

[0110] The interface processing module 410 is used to obtain at least one interface pipeline information of the application programming interface and identify the key interface information corresponding to each interface pipeline information.

[0111] The matching module 420 is used to perform similarity matching on each of the interface key information based on a preset short text semantic matching model to determine two similar label types.

[0112] Teacher module 430 is used to determine the interface label and teacher model knowledge by performing knowledge distillation based on two similar label types and the interface key information through a large language model for each of the interface key information.

[0113] The student training module 440 is used to train a basic model based on all the key information of the interface, the interface labels and the teacher model knowledge to obtain the target student model.

[0114] The technical solution of this invention involves acquiring at least one interface pipeline information of an application programming interface (API), identifying key interface information corresponding to each interface pipeline information, and for each key interface information, performing similarity matching based on a preset short text semantic matching model to determine two similar tag types. For each key interface information, a large language model is used to perform knowledge distillation based on the two similar tag types and the key interface information to determine interface tags and teacher model knowledge. A base model is trained based on all the key interface information, the interface tags, and the teacher model knowledge to obtain a target student model. This solves the technical problem in existing technologies where the lack of high-quality API tagging data leads to the inability to accurately generate API tags during the API tagging process. This invention can utilize a large model as a teacher model, providing rich semantic information when outputting interface tagging information, thereby improving the model performance and recognition effect of the student model.

[0115] Optionally, teacher module 430 is specifically used for:

[0116] The input information for a large model is constructed based on two similar label types and the key information of the interface, using preset dialogue requirements.

[0117] The input information of the large model is input into the large language model for knowledge distillation to determine the interface tags and semantic information;

[0118] If the interface label and the semantic information meet the preset training objective, the semantic information is determined as the teacher model knowledge.

[0119] Optionally, teacher module 430 is also specifically used for:

[0120] If the interface label and the semantic information do not meet the preset training objective, the process returns to the step of constructing large model input information based on two similar label types and the interface key information using preset dialogue requirement information, until the interface label and the semantic information meet the preset training objective.

[0121] Optionally, the student training module 440 is specifically used for:

[0122] The model training set of the basic model is constructed based on the key information of each interface, the interface label, and the teacher model knowledge;

[0123] The training data of each model in the model training set is sequentially input into the base model for model training to obtain the target student model.

[0124] Optionally, the student training module 440 is also specifically used for:

[0125] For each of the key information of the interface, English sentences are constructed based on preset English sentence generation rules to obtain English interface information;

[0126] Each English interface information, along with its corresponding interface label and the teacher model knowledge, is determined as the model training data to construct the model training set.

[0127] Optionally, the interface processing module 410 is specifically used for:

[0128] Keyword extraction is performed on the API flow chart using string matching methods to determine the key information corresponding to the API flow chart. This key information includes the URL, the relative path of the API method, the request method, and the output parameters.

[0129] The application programming interface (API)-marked student model training device provided in this embodiment of the invention can execute the application programming interface (API)-marked student model training method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0130] Figure 5 A schematic diagram of an electronic device 10, which can be used to implement embodiments of the present invention, is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their patterns are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0131] like Figure 5As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 may also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0132] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of monitors, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer grids such as the Internet and / or various telecommunications grids.

[0133] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as the student model training method marked by the application programming interface.

[0134] In some embodiments, the application programming interface (API)-marked student model training method can be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or mounted on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the API-marked student model training method described above can be performed. Alternatively, in other embodiments, processor 11 can be configured to execute the API-marked student model training method by any other suitable means (e.g., by means of firmware).

[0135] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0136] Computer programs used to implement the methods of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the patterns / operations specified in the flowcharts and / or block diagrams to be implemented. The computer programs can be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0137] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0138] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0139] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or grid browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication grid). Examples of communication grids include local area networks (LANs), wide area networks (WANs), blockchain grids, and the Internet.

[0140] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0141] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0142] This embodiment provides a computer-readable storage medium storing a computer program thereon. When executed by a processor, the program implements the steps of a student model training method marked with an application programming interface as provided in any embodiment of the present invention. The method includes:

[0143] Obtain at least one interface pipeline information of the application programming interface, and identify the key interface information corresponding to each interface pipeline information;

[0144] For each of the key information of the interface, the key information of the interface is matched for similarity based on a preset short text semantic matching model to determine two similar label types;

[0145] For each of the key information of the interface, knowledge distillation is performed using a large language model based on two similar label types and the key information of the interface to determine the interface label and teacher model knowledge;

[0146] Based on all the key information of the interfaces, the interface labels, and the teacher model knowledge training base model, the target student model is obtained.

[0147] The computer storage medium of this invention can be any combination of one or more computer-readable media. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. For example, a computer-readable storage medium can be, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0148] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of sending, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device.

[0149] Program code contained on a computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0150] Computer program code for performing the operations of this invention can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of mesh, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0151] Those skilled in the art will understand that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a grid of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby allowing them to be stored in a storage device for execution by a computing device, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.

[0152] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0153] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A student model training method using application programming interface (API) tags, characterized in that, include: Obtain at least one interface pipeline information of the application programming interface, and identify the key interface information corresponding to each interface pipeline information; For each of the key information of the interface, the key information of the interface is matched for similarity based on a preset short text semantic matching model to determine two similar label types; For each of the key information of the interface, knowledge distillation is performed using a large language model based on two similar label types and the key information of the interface to determine the interface label and teacher model knowledge; Based on all the key information of the interfaces, the interface labels, and the teacher model knowledge training base model, the target student model is obtained.

2. The method according to claim 1, characterized in that, The method of determining teacher model knowledge through knowledge distillation based on two similar label types and the interface key information using a large language model includes: The input information for a large model is constructed based on two similar label types and the key information of the interface, using preset dialogue requirements. The input information of the large model is input into the large language model for knowledge distillation to determine the interface tags and semantic information; If the interface label and the semantic information meet the preset training objective, the semantic information is determined as the teacher model knowledge.

3. The method according to claim 2, characterized in that, After inputting the large model input information into the large language model for knowledge distillation to determine the interface labels and semantic information, the method further includes: If the interface label and the semantic information do not meet the preset training objective, the process returns to the step of constructing large model input information based on two similar label types and the interface key information using preset dialogue requirement information, until the interface label and the semantic information meet the preset training objective.

4. The method according to claim 1, characterized in that, The target student model is obtained by training a basic model based on all the key information of the interfaces, the interface tags, and the teacher model knowledge, including: The model training set of the basic model is constructed based on the key information of each interface, the interface label, and the teacher model knowledge; The training data of each model in the model training set is sequentially input into the base model for model training to obtain the target student model.

5. The method according to claim 4, characterized in that, The model training set, which constructs the basic model based on the key information of each interface, the interface label, and the teacher model knowledge, includes: For each of the key information of the interface, English sentences are constructed based on preset English sentence generation rules to obtain English interface information; Each English interface information, along with its corresponding interface label and the teacher model knowledge, is determined as the model training data to construct the model training set.

6. The method according to claim 1, characterized in that, The identification of the key interface information corresponding to each interface pipeline information includes: Keyword extraction is performed on the interface flow information based on string matching method to determine the key information of the interface corresponding to the interface flow information.

7. The method according to claim 6, characterized in that, The key information of the interface includes the URL, the relative path of the interface method, the request method, and the output parameters.

8. A student model training device with an application programming interface (API) tag, characterized in that, include: An interface processing module is used to obtain at least one interface pipeline information of an application programming interface and identify the key interface information corresponding to each interface pipeline information. The matching module is used to perform similarity matching on each of the interface key information based on a preset short text semantic matching model to determine two similar label types. The teacher module is used to determine the interface label and teacher model knowledge by performing knowledge distillation based on two similar label types and the interface key information for each of the aforementioned interface key information using a large language model. The student training module is used to train a basic model based on all the key information of the interfaces, the interface labels, and the teacher model knowledge to obtain the target student model.

9. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the student model training method marked by the application programming interface as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the student model training method marked by the application programming interface as described in any one of claims 1-7.