Interface analysis method, electronic device, storage medium and program product
By extracting and analyzing the demand data of software projects, combined with large models and technical means to enhance the generation model, the problem of difficulty changing the interface change analysis is solved, the rapid identification interface changes are achieved, and the efficiency and quality of software delivery are improved. Essence
Patent Information
- Application Number
- CN202411630908.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-14
- Publication Date
- 2025-01-28
AI Technical Summary
During the iteration of software projects, changes in demand lead to changes in interfaces of multiple functions and service modules, making it difficult for R&D personnel to quickly analyze and identify interfaces involving changes, resulting in slow software delivery and low quality.
Through information extraction of demand data, and using the first largest model for preliminary analysis, combined with retrieval to enhance the generating model in the pre -constructed interface information library, obtain the first interface information of the relevant interface involved in the demand data.
Quickly identify the interfaces that may involve changes, guide R & D and testers to confirm the scope of modification and testing, improve work efficiency, reduce software delivery time, and improve the quality of delivery.
Smart Images

Figure CN119377307A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to artificial intelligence technology, and in particular to an interface analysis method, electronic device, storage medium and program product. Background Art
[0002] During the iteration process of a software project, a change in requirements often involves changes to multiple functions, which in turn involves changes to multiple service modules and numerous interfaces. The complexity of business logic continues to increase with project iterations, and the number of service interfaces continues to increase. When requirements change, it is difficult for relevant R&D personnel to quickly analyze and identify the interfaces that may be changed in this requirement change. It often takes a lot of time to sort out and confirm with relevant R&D testers. However, even so, there will still be omissions in analysis and sorting, resulting in slow software delivery and low delivery quality. Summary of the invention
[0003] In view of the above problems in the prior art, embodiments of the present disclosure provide an interface analysis method, an electronic device, a storage medium, and a program product.
[0004] A first aspect of an embodiment of the present disclosure provides an interface analysis method, including:
[0005] Get demand data for a specified project;
[0006] Extracting functional information of specified items from demand data;
[0007] Input the functional information into the first large model, and output the preliminary analysis results of the relevant interfaces involved in the demand data through processing by the first large model;
[0008] Based on the preliminary analysis result, the interface information library of the pre-built designated project is searched through the retrieval enhancement generation model to obtain the first interface information of the relevant interface involved in the demand data.
[0009] As a possible implementation of the first aspect, obtaining demand data of a specified project includes:
[0010] Receive demand data links for specified projects uploaded by users;
[0011] According to the demand data link, obtain the demand data of the specified project.
[0012] As a possible implementation of the first aspect, extracting function information of a specified project from demand data includes:
[0013] According to the format tags in the demand data, invalid data is removed from the demand data and the functional information of the specified project is extracted.
[0014] As a possible implementation of the first aspect, the function information is input into the first large model, and the first large model processes and outputs a preliminary analysis result of the relevant interface involved in the demand data, including:
[0015] Obtaining a preset first prompt word;
[0016] The functional information and the first prompt word are input into the first large model, and the first large model processes and outputs a preliminary analysis result.
[0017] As a possible implementation of the first aspect, the process of pre-building an interface information library of a specified project includes:
[0018] Build a vocabulary based on the interface documentation of the specified project;
[0019] By using a text vectorization model and a vocabulary, the second interface information of all interfaces in the interface description document is converted into corresponding vectors to obtain an interface information library of a specified project.
[0020] As a possible implementation of the first aspect, based on the preliminary analysis result, the interface information library of the pre-built designated project is searched by the retrieval enhancement generation model to obtain first interface information of the relevant interface involved in the requirement data, including:
[0021] Vectorizing the third interface information of the relevant interface in the preliminary analysis result as a retrieval vector;
[0022] Through the retrieval enhancement generation model, the retrieval vector is matched with the vector in the interface information library for similarity;
[0023] The vector with the highest similarity to the search vector in the interface information database is used as the searched target vector;
[0024] The second interface information corresponding to the target vector in the interface description document of the specified project is used as the first interface information of the relevant interface involved in the demand data.
[0025] As a possible implementation of the first aspect, the method further includes:
[0026] The search scope is determined according to the address information and the service information in the third interface information, so that the search enhancement generation model searches in the interface information library according to the search scope.
[0027] As a possible implementation manner of the first aspect, after obtaining first interface information of a related interface involved in the demand data, the method further includes:
[0028] The first interface information, the preliminary analysis result, and the preset second prompt word are input into the second large model, and the second large model processes and outputs the change parameters corresponding to the first interface information.
[0029] As a possible implementation of the first aspect, the method further includes:
[0030] In response to the user's confirmation operation on the first interface information, the first interface information is updated to the interface description document of the designated project.
[0031] A second aspect of the present disclosure provides an interface analysis device, including:
[0032] An acquisition unit, used to: acquire demand data of a specified project;
[0033] An extraction unit, used to: extract function information of a specified item from the demand data;
[0034] The first processing unit is used to: input the function information into the first large model, and output the preliminary analysis results of the relevant interfaces involved in the demand data through processing by the first large model;
[0035] The retrieval unit is used to: based on the preliminary analysis result, retrieve the interface information library of the pre-built designated project through the retrieval enhancement generation model to obtain the first interface information of the relevant interface involved in the demand data.
[0036] As a possible implementation manner of the second aspect, the acquiring unit is configured to:
[0037] Receive demand data links for specified projects uploaded by users;
[0038] According to the demand data link, obtain the demand data of the specified project.
[0039] As a possible implementation manner of the second aspect, the extraction unit is used to:
[0040] According to the format tags in the demand data, invalid data is removed from the demand data and the functional information of the specified project is extracted.
[0041] As a possible implementation manner of the second aspect, the first processing unit is configured to:
[0042] Obtaining a preset first prompt word;
[0043] The functional information and the first prompt word are input into the first large model, and the first large model processes and outputs a preliminary analysis result.
[0044] As a possible implementation manner of the second aspect, the apparatus further includes a construction unit, configured to pre-construct an interface information library of a specified project, specifically configured to:
[0045] Build a vocabulary based on the interface documentation of the specified project;
[0046] By using a text vectorization model and a vocabulary, the second interface information of all interfaces in the interface description document is converted into corresponding vectors to obtain an interface information library of a specified project.
[0047] As a possible implementation manner of the second aspect, the retrieval unit is configured to:
[0048] Vectorizing the third interface information of the relevant interface in the preliminary analysis result as a retrieval vector;
[0049] Through the retrieval enhancement generation model, the retrieval vector is matched with the vector in the interface information library for similarity;
[0050] The vector with the highest similarity to the search vector in the interface information database is used as the searched target vector;
[0051] The second interface information corresponding to the target vector in the interface description document of the specified project is used as the first interface information of the relevant interface involved in the demand data.
[0052] As a possible implementation manner of the second aspect, the retrieval unit is further configured to:
[0053] The search scope is determined according to the address information and the service information in the third interface information, so that the search enhancement generation model searches in the interface information library according to the search scope.
[0054] As a possible implementation manner of the second aspect, the apparatus further includes a second processing unit, configured to:
[0055] After obtaining the first interface information of the relevant interface involved in the demand data, the first interface information, the preliminary analysis results, and the preset second prompt words are input into the second large model, and the second large model processes and outputs the change parameters corresponding to the first interface information.
[0056] As a possible implementation manner of the second aspect, the apparatus further includes an updating unit, configured to:
[0057] In response to the user's confirmation operation on the first interface information, the first interface information is updated to the interface description document of the designated project.
[0058] A third aspect of the present disclosure provides an electronic device, including:
[0059] a memory for storing a computer program product;
[0060] The processor is used to execute a computer program product stored in the memory, and when the computer program product is executed, the method of any one of the above-mentioned first aspects is implemented.
[0061] A fourth aspect of an embodiment of the present disclosure provides a computer-readable storage medium having computer program instructions stored thereon. When the computer program instructions are executed by a processor, the method of any one of the above-mentioned first aspects is implemented.
[0062] The fifth aspect of the present disclosure provides a computer program product, including computer program instructions, which implement any of the methods described in the first aspect when executed by a processor. Based on the embodiments of the present disclosure, by extracting information from the demand data, preliminarily processing the first large model, and searching the interface information library by the retrieval enhancement generation model, the first interface information of the related interface that may be modified in the demand data is obtained, so as to quickly identify the interface that may be modified in this demand update, and guide R&D personnel and testers to confirm the modification scope and test scope of this demand update, effectively improve work efficiency, reduce software delivery time, and improve software delivery quality.
[0063] The technical solution of the present disclosure is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] The accompanying drawings, which constitute a part of the specification, illustrate embodiments of the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0065] The present disclosure may be more clearly understood from the following detailed description with reference to the accompanying drawings, in which:
[0066] Figure 1 A flowchart of an embodiment of the interface analysis method disclosed herein;
[0067] Figure 2 A flowchart of an embodiment of the interface analysis method disclosed herein;
[0068] Figure 3 An example diagram of an original requirement document for an embodiment of the interface analysis method disclosed herein;
[0069] Figure 4 An example diagram of an interface description document of an embodiment of the interface analysis method disclosed herein;
[0070] Figure 5 A flowchart of an embodiment of the interface analysis method disclosed herein;
[0071] Figure 6 A flowchart of an embodiment of the interface analysis method disclosed herein;
[0072] Figure 7This is an example diagram of interface information of an embodiment of the interface analysis method disclosed herein;
[0073] Figure 8 This is a schematic diagram of the structure of an embodiment of the interface analysis device disclosed in the present invention;
[0074] Fig. 9 This is a schematic diagram of the structure of an embodiment of the interface analysis device disclosed in the present invention;
[0075] Fig.10 A block diagram of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0076] The following first introduces the existing method, and then introduces the technical solution of the present application in detail.
[0077] In the iteration process of software projects, a change in requirements often involves changes in multiple functions, and then involves changes in multiple service modules and numerous interfaces. When requirements change, it is difficult for relevant R&D personnel to quickly analyze and identify the interfaces and interface parameters that may be changed in this requirement change. It often takes a lot of time to sort out and confirm, and there are omissions in analysis and sorting, resulting in slow software delivery and low delivery quality.
[0078] In related technologies, interfaces affected by requirement changes are analyzed based on big models. However, since big models lack relevant business background knowledge, the inferred interfaces may not exist in the project at all, and the accuracy is low. It may even bring identification costs to related personnel, resulting in a decrease in work efficiency, and the above technical problems cannot be effectively solved.
[0079] In summary, the existing technology has the following defects: changes in project requirements involve changes in many interfaces, and the resulting large amount of work leads to slow software delivery and low delivery quality.
[0080] Based on the technical problems existing in the above-mentioned prior art, an embodiment of the present application provides an interface analysis method, which obtains the first interface information of the related interfaces that may be modified in the requirement data by extracting information from the requirement data, performing preliminary processing of the first large model, and searching the interface information library by the retrieval enhancement generation model, so as to quickly identify the interfaces that may be modified in this requirement update, and guide R&D personnel and testers to confirm the modification scope and test scope of this requirement update, effectively improving work efficiency, reducing software delivery time, and improving software delivery quality, thereby solving the technical problems mentioned in the prior art that software delivery is slow and the delivery quality is low due to the changes in many interfaces involved in the requirement changes.
[0081] Figure 1 FIG. 1 is a flow chart of an embodiment of the interface analysis method disclosed in the present invention. Figure 1As shown, it may specifically include:
[0082] Step S110, obtaining the requirement data of the specified project. During the iteration process of the software project, when the requirements change, the user usually uploads the original requirement document to a pre-set specified storage directory. The original requirement document includes the requirement data corresponding to the requirement change, for example, it may include the function list of the project. Figure 1 and Figure 2 In step S110, the original requirement document of the specified project can be first obtained from the specified storage directory, and the requirement data corresponding to the current requirement change can be obtained from the original requirement document.
[0083] Step S120: extracting the functional information of the specified project from the demand data. The functional information of the specified project may include the key demand information recorded in the demand document of the specified project. Figure 1 and Figure 2 , extract the key information of the requirements document of the specified project. Among them, the key information of the requirements may include: service environment address information, code GIT information, basic project information, and functional information of this requirement. Among them, the service environment address information may include the website domain name of the service provided by the software; the code GIT information may include the GIT address where the code is stored. Git is an open source distributed version control system that can effectively and quickly handle version management of projects from very small to very large; the basic information of the project may include the functions of the services provided by the project, and the service categories to which the services provided by the project belong, such as front-end services, back-end services, algorithm services, etc.; the functional information of this requirement may include which functions are added or modified in this requirement change, such as adding a sharing function to the service this time.
[0084] Step S130, input the function information into the first large model, and the first large model processes and outputs the preliminary analysis results of the relevant interfaces involved in the demand data. Figure 2 , a structured prompt can be designed first, and the functional information extracted in step S120 is input into the first large model LLM (Large Language Model) in combination with the structured prompt, and the first large model is used to sort out the preliminary analysis results of the related interfaces that may be affected by this demand change. In an example, the output results of the first large model are expressed in a JSON (JavaScript Object Notation) structure, which may specifically include the services affected by this demand, code GIT information, service domain names, and interface functions described in natural language.
[0085] In one example, the sharing interface of a detail page in a specified project involves a demand change, specifically including adding sharing to Moments and Weibo. The first large model can determine that the sharing interface is provided by service A based on the service environment address information extracted in step S120. The services affected by this demand output by the first large model can include relevant information about service A.
[0086] In another example, the designated project is developing service A, and this requirement change may add a sharing interface under service A. When it is necessary to obtain the information of the sharer, the sharing interface may rely on user authentication and may call the user query interface. Therefore, the addition of the sharing interface may also affect the user query interface, that is, it may affect the upstream and downstream interfaces of the sharing interface. The services affected by this requirement output by the first model above may include information corresponding to the changed interface and the upstream and downstream interfaces of the changed interface.
[0087] Step S140: Based on the preliminary analysis result, the interface information library of the pre-built designated project is searched through the search enhancement generation model to obtain the first interface information of the relevant interface involved in the demand data.
[0088] See also Figure 1 and Figure 2 , based on the preliminary analysis results obtained in step S130, that is, the preliminary analysis results of the relevant interfaces affected by the requirements analyzed by the AI (artificial intelligence) large model, the interface information library is searched through the RAG (Retrieval augmented Generation) model. Specifically, according to the output results of the first large model expressed in the above-mentioned JSON structure, the first interface information of the relevant interface involved in the requirement data is obtained from the interface document space of the service involved in the requirement through RAG retrieval. Among them, the interface document space contains all interface information under the service involved in the requirement. In the interface management platform of the specified project, the information of all interfaces in the interface document space can be vectorized and stored in advance to form an interface information library. See Figure 2 The knowledge base in includes the interface information base. The preliminary analysis results are matched with the interface information in the knowledge base by RAG retrieval, and the real interface corresponding to the preliminary analysis results is found in the knowledge base.
[0089] In the above step S130, the functional information of the specified project is first analyzed based on the demand, and the functions affected by the demand change are analyzed, and the interface functions described in natural language are output through the first large model. For example, the interface functions described in natural language output may include the following: whether to add an interface for the sharing function to the specified project, and whether the addition of the interface has an impact on the original function; or the specified project originally has a sharing function, but only shares to WeChat friends and QQ friends, and this demand change adds sharing to Weibo or Moments.
[0090] In the above, the first large model is used to analyze the interface affected by this demand change, and then RAG is used to query whether there is a shared interface in the specified project. If there is a shared interface in the specified project, this shared interface needs to be changed; if there is no shared interface in the specified project, this function is newly added and needs to be added. In the above example, the preliminary analysis results obtained by the AI large model analysis are compared with the first interface information retrieved by RAG. It can be seen that the AI large model only analyzes that this demand change may affect the shared interface, but the large model cannot output the specific information of the shared interface. After that, the specific information of the shared interface that actually exists in the specified project can be determined through RAG retrieval. In other words, if RAG retrieval is not performed, the AI large model may only give inaccurate interface information based on analysis, and this information may not be completely consistent with the actual interface information in the specified project. By matching the preliminary analysis results with the actual interface information in the interface information library through RAG retrieval, accurate interface information can be obtained, and accurate analysis and identification of interfaces affected by demand changes can be achieved through the above method.
[0091] For example, the preliminary analysis results of the relevant interfaces analyzed by the AI big model only give a natural language description of the interface function, and may not give a specific PATH (path). Under normal circumstances, the description of an interface in the interface description document may include the following information: which service the interface belongs to, the code GIT information corresponding to the interface, the interface function description (such as sharing interface, retrieval interface, details page, etc.), the PATH path of the interface, the request body of the interface (for example, it may include various parameters carried in the request), and the above is the overall information of a real interface in the interface description document. However, in the above embodiment, the AI big model may analyze that only the demand change affects the sharing interface. For the specific information of the sharing interface, the AI big model may output the name of the sharing interface as "SHARE interface", but the real name of the interface in the specified project may be "detail / SHARE". Therefore, through RAG, the interface information library of the specified project is searched, the preliminary analysis results analyzed by the AI big model are matched with the real information in the interface information library, and the interface information closest to the preliminary analysis results is retrieved, and the real specific information of the sharing interface can be returned.
[0092] Based on the disclosed embodiments, by extracting information from the requirement data, performing preliminary processing of the first large model, and searching the interface information library using the retrieval enhancement generation model, the first interface information of the related interfaces that may be subject to modification in the requirement data is obtained, thereby quickly identifying the interfaces that may be subject to modification in this requirement update, and guiding R&D personnel and testers to confirm the modification scope and test scope of this requirement update, thereby effectively improving work efficiency, reducing software delivery time, and improving software delivery quality.
[0093] In one embodiment, Figure 1 Step S110 in the embodiment of the present invention is to obtain the demand data of the specified project, including:
[0094] Receive demand data links for specified projects uploaded by users;
[0095] According to the demand data link, obtain the demand data of the specified project.
[0096] When the requirements change, users usually upload the requirement data link of the specified project to a pre-set designated storage directory. According to the requirement data link, the original requirement document can be obtained, which records the requirement data of the specified project. The document content can be obtained through the interface provided by the document space platform. For example, the document obtained according to the link may be in HTML format or PDF format. The content can be processed and extracted for different format types of documents. For documents in PDF format, PDF document content can be obtained through Python's PyPDF2 library and pdfminer library. Specifically, first use the PyPDF2 library to open the PDF file and read its content, and then use the pdfminer library to convert the PDF content into a readable text format.
[0097] In one embodiment, extracting function information of a specified project from demand data includes:
[0098] According to the format tags in the demand data, invalid data is removed from the demand data and the functional information of the specified project is extracted.
[0099] For documents in HTML format, the demand data is written in HTML code. The user uploads the demand data link, opens the HTML file through the link, and reads the HTML code in it. According to the format tags in the HTML file, invalid data is removed from the demand data, the functional information of the specified project is extracted, and the specific content of the original demand document is obtained. Figure 3 In the example of a transaction-related project shown, a portion of the specific content of the original requirement document may include a function list, in which specific function points may include consumption, cancellation, return, transaction inquiry, order closing, etc.
[0100] An exemplary information extraction process includes the following steps:
[0101] 1) Data processing. For documents in HTML format, you can use tags (for example:
[0102] <h2> <strong> ) Search for titles, paragraphs, tables, keywords, etc., remove invalid data, split paragraphs, process tables, and process paragraph levels. HTML documents include many tags, such as title tags, paragraph tags, table tags, etc. The tags themselves are invalid data without content, and the content contained in the tags needs to be extracted and processed. For example, if a table tag is found in the HTML document, it means that the document content includes a table. The table tag is removed as invalid data, and the specific content in the table is extracted. For another example, if a paragraph tag is found in the HTML document, it means that the document content includes a paragraph. The paragraph tag is removed as invalid data, and the content between the paragraph tag is extracted.
[0103] 2) Extraction of key information of requirements. Extract key information of the requirements data processed in the previous step according to the title level and keywords, including business specific terms and their annotation information.
[0104] In one implementation, the function information is input into the first large model, and the first large model processes and outputs the preliminary analysis results of the relevant interfaces involved in the demand data, including:
[0105] Obtaining a preset first prompt word;
[0106] The functional information and the first prompt word are input into the first large model, and the first large model processes and outputs a preliminary analysis result.
[0107] In one example, the preset structured first prompt word is as follows:
[0108] 1. Role:
[0109] You are a senior software testing expert with professional skills, rich experience and keen insight.
[0110] 2. Goals:
[0111] Based on the demand information provided by the user, it can quickly identify and accurately extract the interfaces affected by the demand.
[0112] 3. Constraints:
[0113] Only interfaces related to the required functional logic are analyzed. Link interfaces such as prototypes / UI (user interface) / interaction drafts / reference materials are not within the scope of analysis.
[0114] Only focus on software testing related content and refuse to answer topics unrelated to software testing.
[0115] For the analyzed interface information, it is necessary to clearly mark "The following interface is generated by AI intelligence, for reference only." in the output, and the interface PATH cannot be arbitrarily inferred.
[0116] 4. Skills:
[0117] Good at extracting interface information from large amounts of demand information.
[0118] If the interface is clearly described in the requirements, the interface information can be extracted relatively completely, such as the interface name, request method, domain name, PATH, input parameters, output parameters, the service or GIT to which the interface belongs, and the content of this interface change or addition.
[0119] If the interface description in the requirements is not clear, you can infer the interface information based on the context of the requirements and your own experience.
[0120] If the interface information cannot be extracted from the requirements, the user can be clearly informed that "the affected interface cannot be extracted from this requirement".
[0121] 5. Output format:
[0122] Interface analysis: The following interface is generated by AI and is for reference only.
[0123] (1) XXX interface:
[0124] <Interface analysis content>
[0125] (2) XXX interface:
[0126] <Interface analysis content>
[0127] (3) XXX interface:
[0128] <Interface analysis content>
[0129] …
[0130] 6. User input
[0131] 7. Initialization
[0132] As a role <role>, remember <goals>, strictly abide by <constrains>, in a fixed format <outputformat>Output, play <skills>, based on user input<user input> , complete the corresponding output.
[0133] Based on the first prompt word, the function information extracted in step S120 and the first prompt word are input into the first large model, and processed by the first large model to obtain a structured interface analysis result, and output a preliminary analysis result. The preliminary analysis result includes the third interface information of the relevant interface involved in the demand data. An exemplary preliminary analysis result is as follows:
[0134] (1) Description: "This is an interface for obtaining the property details page."
[0135] (2) Path: "api / house / detail".
[0136] (3) Domain name of the service: "xxx.ke.com".
[0137] (4) Code GIT information: "https: / / github.com / ".
[0138] (5) Service (server): "house-info-server".
[0139] (6) Parameters (param):
[0140] "price": "add" (add the "price" field);
[0141] "number": "delete" (delete the "number" field);
[0142] "owner": "update" (updates the "owner" field).
[0143] Among them, this demand change affects the above three fields. "add" means adding operation, "delete" means deleting operation, and "update" means updating operation. In other words, this demand change needs to add the "price" field, delete the "number" field, and update the "owner" field.
[0144] In another example, this requirement change adds a function of sharing to Weibo based on the original sharing function. In this case, an "add" operation may be performed on the TYPE field in the sharing interface, and the change of the above interface information will be prompted in the preliminary analysis results output by the first model.
[0145] In one embodiment, the process of pre-building an interface information library of a specified project includes:
[0146] Build a vocabulary based on the interface specification document of a specified project;
[0147] Utilize a text vectorization model and the vocabulary to convert the second interface information of all interfaces in the interface specification document into corresponding vectors, obtaining an interface information library for the specified project.
[0148] Before performing RAG retrieval in step S140, it is necessary to pre-build an interface information library for the specified project. Specifically, text vectorize the second interface information of all interfaces in all interface specification documents of the interface management platform for the specified project and store it in the interface information library. See Figure 2 The knowledge base in Figure 4 includes the content of the interface information library. Referring to the example of a transaction-related project shown in
[0149] A) Preprocess the text in the interface specification document, such as word segmentation, stop word removal, stemming, etc. text2vec provides some preprocessing tools and functions. For example:
[0150] Word segmentation: The text can be segmented into a sequence of words or terms. text2vec provides a tokenizers module, and the SimpleTokenizer function in it can segment the text by spaces;
[0151] Stop word removal: Remove common meaningless words (such as "de", "le", "shi", "zai", "he", etc.). Import and use them through the stop_words module of text2vec. Common Chinese stop word lists include CN_STOP_WORDS and SMART_CN_STOP_WORDS;
[0152] Chinese stemming: Perform Chinese word segmentation through the jieba library, and then use Chinese part-of-speech tagging tools (such as THULAC, SnowNLP) to identify and restore the basic form of words.
[0153] B) Build a vocabulary. Use the Vocab function of text2vec to build a vocabulary and convert the text data into a coded form represented by numbers.
[0154] C) Train the model. Select a suitable text vectorization algorithm, such as the bag-of-words model, TF-IDF, Word2Vec, etc., and use the model function of text2vec for training.
[0155] D) Text vectorization. Use the trained model to convert text data into vector representation. You can use the model's transform function to convert text into vectors.
[0156] E) Build a knowledge base. Use a clustering algorithm to cluster similar text vectors together to form different topics or categories of the knowledge base.
[0157] RAG retrieval is the process of enhancing the large model (LLM) by incorporating additional information from external knowledge sources, thereby improving the accuracy of the results generated by the LLM, the context awareness, and reducing hallucinations. When the LLM receives a query, it not only relies on its own pre-trained knowledge, but also actively retrieves relevant information from the specified knowledge base. Therefore, the role of the subject or category of the knowledge base in RAG retrieval is mainly reflected in the following aspects:
[0158] 1) Improved accuracy: Based on the topic or category of the knowledge base, RAG can retrieve information related to the query more accurately, thereby improving the accuracy of generated answers.
[0159] 2) Reduce hallucinations: By retrieving information from knowledge bases on specific topics or categories, RAG is able to reduce hallucinations caused by insufficient or incorrect information, thereby improving the reliability of the model.
[0160] In summary, the subject or category of the knowledge base plays an important role in RAG retrieval, which not only improves the accuracy of retrieval results but also reduces the illusion phenomenon, thereby improving the reliability of interface analysis.
[0161] like Figure 5 As shown, in one embodiment, Figure 1 In step S140, based on the preliminary analysis result, the interface information library of the pre-built specified project is searched by the search enhancement generation model to obtain the first interface information of the relevant interface involved in the demand data, including:
[0162] Step S210, vectorize the third interface information of the relevant interface in the preliminary analysis result as a search vector. Vectorize the third interface information in the preliminary analysis result output by the first large model, that is, convert the third interface information of the interface affected by the requirement change analyzed by the first large model into a vector and use it as a search vector.
[0163] Step S220, by searching the enhanced generation model, the search vector is matched with the vector in the interface information library for similarity. The interface information library of the specified project has been pre-built before the RAG search. If there are new project interface iterations in the future, the interface information library can be quickly updated in this way. When the interface information library needs to be queried, it is only necessary to vectorize the query text information and match it with the vector in the interface information library for similarity.
[0164] Step S230: The vector with the highest similarity to the search vector in the interface information library is used as the searched target vector. RAG search is a similarity search, not a complete match search. The vector with the highest similarity to the search vector is found in the interface information library, thereby obtaining the corresponding interface information library entry as the searched target vector.
[0165] Step S240, the second interface information corresponding to the target vector in the interface description document of the specified project is used as the first interface information of the relevant interface involved in the demand data. The retrieval vector corresponds to the third interface information obtained by the analysis of the first large model, which is similar to the real interface information, but may not be completely consistent with the real interface information. For example, the name of the interface in the retrieval vector is "sharing interface", and the name of the interface corresponding to the similar target vector in the interface description document may be "SHARE interface" or "shared interface". The target vector is the vector most similar to the retrieval vector in the interface information library. Therefore, the second interface information corresponding to the target vector in the interface description document, that is, the real interface information corresponding to the retrieval vector, can be used as the first interface information of the relevant interface involved in the demand data.
[0166] In one embodiment, the above method further comprises:
[0167] The search scope is determined according to the address information and service information in the third interface information, so that the search enhancement generation model searches in the interface information library according to the search scope. In the preliminary analysis result, the address information may include the code GIT information in the third interface information; the service information may include the service domain name.
[0168] In one example, there is a sharing function on a teaching aid APP, and there may also be a sharing function on another trading APP. If the service domain name and project are not screened, it may cause retrieval errors during RAG search. Therefore, before performing a RAG search, first limit a search range, filter out all interface descriptions of the service corresponding to the search, and determine the interface range of the RAG query based on the address information and service information to avoid RAG search errors and reduced accuracy caused by similar interface expressions in multiple projects, and avoid interference to users.
[0169] like Figure 6 As shown, in one embodiment, after obtaining the first interface information of the relevant interface involved in the demand data in step S140, the method further includes:
[0170] Step S150, input the first interface information, the preliminary analysis result, and the preset second prompt word into the second large model, and the second large model processes and outputs the change parameters corresponding to the first interface information.
[0171] In step S140, the interface description most similar to the preliminary analysis result is found through RAG query. Further, in step S150, the first interface information retrieved by RAG and the preliminary analysis result output by the first large model are input into the second large model again, and the second large model is guided by the second prompt word to further analyze and summarize, so as to achieve more accurate analysis and expression of the interface information, and further the second large model provides more detailed and accurate information. Figure 2 The last execution step in the process is to give the real interface information output by RAG to the large model again for analysis, confirmation and standardized expression, and then polish it as a whole and present it to the user in a standard format. Specifically, RAG can be used to retrieve the interfaces affected by this demand change, and the user needs to modify the parameters in the interface. The second large model combines the first interface information and the preliminary analysis results to further analyze and locate the specific parameters that may be involved in this demand change, and identify the parameters that need to be modified.
[0172] like Figure 7 In the example of a transaction-related project shown, part of the interface information affected by the demand change finally analyzed by the second largest model may include: interface request method, interface production call address, interface test call address, and important interface request parameters.
[0173] In one example, the sharing function in a specified project originally only supports sharing to WeChat friends and QQ friends, but this requirement change requires support for Moments and Weibo. The original interface TYPE type is WeChat and QQ, but this requirement change requires the TYPE type to add Moments and Weibo. In this case, the second largest model needs to be used to analyze which parameters of the sharing interface are affected by this requirement change and which modifications need to be made.
[0174] In yet another example, see Figure 7 The second largest model analyzes the important request parameters involved in this demand change: version number, type, order number, and transaction amount, which means prompting the user to modify the version number, type, and transaction amount fields. Normally, an interface may have hundreds of parameters, but this demand change may only affect two or three of them. RAG search can retrieve the interfaces involved in this demand change, but it cannot give specific parameters of the interface that are affected. Specifically, the second largest model is based on the interface function description in the first interface information obtained by RAG search, the various parameters carried in the request, the parameter characteristics, and the parameter description, and then based on the preliminary analysis results obtained by the first largest model, the first interface information is combined with the preliminary analysis results to comprehensively analyze the parameters that may be affected by this demand change.
[0175] In summary, when the project requirements change, the interface analysis method provided by the embodiment of the present disclosure can be used to determine which interface is affected by the requirement change and which parameters of the interface are affected, thereby guiding R&D personnel to set these parameters during program design. This is instructive for some fields that need to be focused on in subsequent development. It also has instructive significance for testers to know which parameters to focus on when testing and writing test cases. Based on the embodiment of the present disclosure, R&D personnel can quickly confirm the scope of modification of this requirement change; testers can know the scope of testing of this requirement change.
[0176] In one embodiment, the above method further comprises:
[0177] In response to the user's confirmation operation on the first interface information, the first interface information is updated to the interface description document of the designated project.
[0178] In one case, the first interface information obtained based on RAG retrieval, or the change parameters corresponding to the first interface information analyzed based on the second largest model, can be automatically updated to the interface document after the user confirms that they are correct, thereby realizing the rapid update of the interface description document. In another case, the output results based on RAG retrieval and the second largest model are highly accurate, and the interface description document can also be directly updated without user confirmation.
[0179] In addition, if there is no change in project requirements, you can also use RAG query to obtain all interface information of the service. Figure 2 ,In this case, the first model is not used, and the sharing interface and retrieval interface of the ,service can be directly queried in the knowledge base through RAG. ,The information of all interfaces can be retrieved and provided to R&D ,staff and testers as reference data.
[0180] like Figure 8 As shown, the present disclosure also provides a corresponding embodiment of an interface analysis device. For the beneficial effects or technical problems solved by the device, please refer to the description of the method corresponding to each device, or refer to the description in the invention content, which will not be repeated here.
[0181] In an embodiment of the interface analysis device, the device comprises:
[0182] The acquisition unit 100 is used to: acquire demand data of a specified project;
[0183] The extraction unit 200 is used to extract the function information of the specified project from the demand data;
[0184] The first processing unit 300 is used to: input the function information into the first large model, and output the preliminary analysis results of the relevant interfaces involved in the demand data through processing by the first large model;
[0185] The retrieval unit 400 is used to: based on the preliminary analysis result, search in a pre-built interface information library of a designated project through a retrieval enhancement generation model to obtain first interface information of a related interface involved in the demand data.
[0186] In one implementation, the acquisition unit 100 is used to:
[0187] Receive demand data links for specified projects uploaded by users;
[0188] According to the demand data link, obtain the demand data of the specified project.
[0189] In one embodiment, the extraction unit 200 is used to:
[0190] According to the format tags in the demand data, invalid data is removed from the demand data and the functional information of the specified project is extracted.
[0191] In one implementation, the first processing unit 300 is configured to:
[0192] Obtaining a preset first prompt word;
[0193] The functional information and the first prompt word are input into the first large model, and the first large model processes and outputs a preliminary analysis result.
[0194] like Fig. 9 As shown, in one embodiment, the device further includes a construction unit 500, which is used to pre-construct an interface information library of a specified project, specifically for:
[0195] Build a vocabulary based on the interface documentation of the specified project;
[0196] By using a text vectorization model and a vocabulary, the second interface information of all interfaces in the interface description document is converted into corresponding vectors to obtain an interface information library of a specified project.
[0197] In one implementation, the retrieval unit 400 is used to:
[0198] Vectorizing the third interface information of the relevant interface in the preliminary analysis result as a retrieval vector;
[0199] Through the retrieval enhancement generation model, the retrieval vector is matched with the vector in the interface information library for similarity;
[0200] The vector with the highest similarity to the search vector in the interface information database is used as the searched target vector;
[0201] The second interface information corresponding to the target vector in the interface description document of the specified project is used as the first interface information of the relevant interface involved in the demand data.
[0202] In one implementation, the retrieval unit 400 is further configured to:
[0203] The search scope is determined according to the address information and the service information in the third interface information, so that the search enhancement generation model searches in the interface information library according to the search scope.
[0204] like Fig. 9 As shown, in one embodiment, the device further includes a second processing unit 600, which is used to:
[0205] After obtaining the first interface information of the relevant interface involved in the demand data, the first interface information, the preliminary analysis results, and the preset second prompt words are input into the second large model, and the second large model processes and outputs the change parameters corresponding to the first interface information.
[0206] like Fig. 9 As shown, in one embodiment, the device further includes an updating unit 700, which is used to:
[0207] In response to the user's confirmation operation on the first interface information, the first interface information is updated to the interface description document of the designated project.
[0208] The interface analysis device of the embodiment of the present disclosure corresponds to the above-mentioned interface analysis method embodiments of the present disclosure in terms of specific implementation and beneficial technical effects. The relevant contents can be referenced to each other and will not be repeated here.
[0209] Below, reference Fig.10 The electronic device according to the embodiment of the present disclosure is described. The electronic device may be any one or both of the first device and the second device, or a stand-alone device independent of them, and the stand-alone device may communicate with the first device and the second device to receive the collected input signals from them.
[0210] Fig.10 A block diagram of an electronic device according to an embodiment of the present disclosure is illustrated.
[0211] like Fig.10 As shown, the electronic device includes one or more processors and memory.
[0212] The processor may be a central processing unit (CPU) or other forms of processing units having data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device to perform desired functions.
[0213] The memory may store one or more computer program products, and the memory may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache memory (cache), etc. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program products may be stored on a computer-readable storage medium, and a processor may run the computer program product to implement the interface analysis method of each embodiment of the present disclosure above and / or other desired functions.
[0214] In one example, the electronic device may further include: an input device and an output device, and these components are interconnected via a bus system and / or other forms of connection mechanisms (not shown).
[0215] In addition, the input device may also include, for example, a keyboard, a mouse, and the like.
[0216] The output device can output various information to the outside, including determined distance information, direction information, etc. The output device can include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto, and the like.
[0217] Of course, to simplify, Fig.10 Only some of the components related to the present disclosure in the electronic device are shown, and components such as a bus, an input / output interface, etc. are omitted. In addition, according to specific application situations, the electronic device may further include any other appropriate components.
[0218] In addition to the above-mentioned methods and devices, an embodiment of the present disclosure may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps of the interface analysis method according to various embodiments of the present disclosure described in the above part of this specification.
[0219] The computer program product may be written in any combination of one or more programming languages to write program code for performing the operations of the disclosed embodiments, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0220] In addition, an embodiment of the present disclosure may also be a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the processor executes the steps of the interface analysis method according to various embodiments of the present disclosure described in the above part of this specification.
[0221] Computer readable storage media can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0222] The basic principles of the present disclosure are described above in conjunction with specific embodiments. However, it should be noted that the advantages, strengths, effects, etc. mentioned in the present disclosure are only examples and not limitations, and it cannot be considered that these advantages, strengths, effects, etc. are required by each embodiment of the present disclosure. In addition, the specific details disclosed above are only for the purpose of illustration and ease of understanding, and are not limitations. The above details do not limit the present disclosure to the necessity of adopting the above specific details to be implemented.
[0223] Each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the system embodiment, since it basically corresponds to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0224] The block diagrams of the devices, apparatuses, equipment, and systems involved in the present disclosure are intended to be illustrative examples only and are not intended to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagrams. As will be appreciated by those skilled in the art, these devices, apparatuses, equipment, and systems may be connected, arranged, and configured in any manner. Words such as "include," "comprise," "have," and the like are open words, meaning "including but not limited to," and may be used interchangeably therewith. The words "or," "and," and "as used herein refer to the words "and / or," and may be used interchangeably therewith, unless the context clearly indicates otherwise. The word "such as," as used herein, refers to the phrase "such as, but not limited to," and may be used interchangeably therewith.
[0225] The method and apparatus of the present disclosure may be implemented in many ways. For example, the method and apparatus of the present disclosure may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above order of steps for the method is for illustration only, and the steps of the method of the present disclosure are not limited to the order specifically described above, unless otherwise specifically stated. In addition, in some embodiments, the present disclosure may also be implemented as a program recorded in a recording medium, which includes machine-readable instructions for implementing the method according to the present disclosure. Therefore, the present disclosure also covers a recording medium storing a program for executing the method according to the present disclosure.
[0226] It should also be noted that in the apparatus, device and method of the present disclosure, each component or each step can be decomposed and / or recombined. Such decomposition and / or recombination should be regarded as equivalent solutions of the present disclosure.
[0227] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the aspects shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
[0228] The above description has been given for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present disclosure to the forms disclosed herein. Although multiple example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, changes, additions and sub-combinations thereof.< / skills> < / outputformat> < / constrains> < / goals> < / role> < / strong> < / h2>
Claims
1. An interface analysis method, characterized in that: include: Get demand data for a specified project; Extracting functional information of the specified item from the demand data; Input the functional information into a first large model, and output a preliminary analysis result of the relevant interfaces involved in the demand data through processing by the first large model; Based on the preliminary analysis result, the interface information library of the designated project that is pre-built is searched through the retrieval enhancement generation model to obtain first interface information of the relevant interface involved in the demand data.
2. The method according to claim 1, characterized in that The step of obtaining the demand data of the specified project includes: Receiving a link to demand data of the designated project uploaded by a user; According to the demand data link, the demand data of the designated project is acquired.
3. The method according to claim 1, characterized in that The step of extracting the function information of the specified item from the demand data includes: According to the format tag in the demand data, invalid data is removed from the demand data to extract the functional information of the designated item.
4. The method according to claim 1, characterized in that: The step of inputting the function information into the first large model and processing the first large model to output preliminary analysis results of the relevant interfaces involved in the demand data includes: Obtaining a preset first prompt word; The functional information and the first prompt word are input into the first large model, and the first large model processes and outputs the preliminary analysis result.
5. The method according to claim 1, characterized in that The process of pre-building the interface information library of the specified project includes: Building a vocabulary based on the interface description document of the specified project; The second interface information of all interfaces in the interface description document is converted into corresponding vectors by using the text vectorization model and the vocabulary, so as to obtain the interface information library of the designated project.
6. The method according to any one of claims 1 to 5, characterized in that The step of searching, based on the preliminary analysis result, in a pre-built interface information library of the designated project by using a search enhancement generation model to obtain first interface information of a related interface involved in the demand data includes: Vectorizing the third interface information of the relevant interface in the preliminary analysis result to obtain a search vector; By searching and enhancing the generation model, the search vector is matched with the vector in the interface information library in terms of similarity; Taking the vector in the interface information database with the highest similarity to the search vector as the searched target vector; The second interface information corresponding to the target vector in the interface description document of the designated project is used as the first interface information of the relevant interface involved in the demand data.
7. The method according to claim 6, characterized in that The method further comprises: The search scope is determined according to the address information and the service information in the third interface information, so that the search enhancement generation model searches the interface information library according to the search scope.
8. The method according to any one of claims 1 to 5, characterized in that After obtaining the first interface information of the relevant interface involved in the demand data, the method further includes: The first interface information, the preliminary analysis result, and the preset second prompt word are input into the second large model, and the second large model processes and outputs the change parameters corresponding to the first interface information.
9. The method according to any one of claims 1 to 5, characterized in that The method further comprises: In response to a user confirmation operation on the first interface information, the first interface information is updated to the interface description document of the designated project.
10. An electronic device, characterized in that: include: a memory for storing a computer program product; A processor is used to execute the computer program product stored in the memory, and when the computer program product is executed, it implements the method described in any one of claims 1 to 9.
11. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method described in any one of claims 1 to 9 is implemented.
12. A computer program product comprising computer program instructions, characterized in that When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 9 is implemented.