CN118192956A - File processing method and device applied to large model and related equipment - Google Patents

File processing method and device applied to large model and related equipment Download PDF

Info

Publication number
CN118192956A
CN118192956A CN202410295337.3A CN202410295337A CN118192956A CN 118192956 A CN118192956 A CN 118192956A CN 202410295337 A CN202410295337 A CN 202410295337A CN 118192956 A CN118192956 A CN 118192956A
Authority
CN
China
Prior art keywords
target
parameter
parameters
service
yaml
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410295337.3A
Other languages
Chinese (zh)
Inventor
王琪
胡志鹏
刘玉忠
费晓旭
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202410295337.3A priority Critical patent/CN118192956A/en
Publication of CN118192956A publication Critical patent/CN118192956A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The disclosure provides a file processing method, a device and related equipment applied to a large model, relates to the technical field of computers, and particularly relates to the fields of large models, data processing and the like. The specific implementation scheme is as follows: analyzing interaction parameters between the target service and the large model from YAML files required by calling the target service based on the OpenAPI specification; the target service support is invoked by the large model; converting interaction parameters of the target service into form data; based on the type of the interaction parameter of the target service, classifying and associating the interaction parameter into a corresponding target category tab; form data in the target class tab is rendered into a visual operation page; and editing the YAML file based on the operation of the target object on the visual operation page. In the embodiment of the disclosure, a YAML editing tool aiming at the OpenAPI specification is provided, so that a user can operate a visual operation page, and the user can complete editing tasks faster and more accurately. The management efficiency of a large number of YAML files required by a large model is improved.

Description

File processing method and device applied to large model and related equipment
Technical Field
The present disclosure relates to the field of computer technology, and in particular, to the fields of large models, data processing, and the like.
Background
YAML is a recursive abbreviation for "YAML Ain't a Markup Language" (YAML is not a markup language). YAML centers on data and is a highly readable format that can be used to express data serialization. YAML references other multiple languages including: c language, python, perl, and gets inspiration from XML (Extensible Markup Language ), data format of email (RFC 2822).
Thus, YAML can be applied to many scenarios, for example, as a script, as a configuration file, or as serialization.
Although some tools currently support editing YAML files, their functionality still needs to be improved.
Disclosure of Invention
The disclosure provides a file processing method, device and related equipment applied to a large model.
According to an aspect of the present disclosure, there is provided a file processing method applied to a large model, including:
Analyzing interaction parameters between the target service and the large model from YAML files required by calling the target service based on the OpenAPI specification; the target service support is invoked by the large model;
converting interaction parameters of the target service into form data;
Based on the type of the interaction parameter of the target service, classifying and associating the interaction parameter into a corresponding target category tab;
form data in the target class tab is rendered into a visual operation page;
And editing the YAML file based on the operation of the target object on the visual operation page.
According to another aspect of the present disclosure, there is provided
A document processing apparatus for use with a large model, comprising:
The analysis module is used for analyzing interaction parameters between the target service and the large model from YAML files required by calling the target service based on the OpenAPI specification; the target service support is invoked by the large model;
The conversion module is used for converting interaction parameters of the target service into form data;
the association module is used for associating the interaction parameter classification into the corresponding target category tab based on the type of the interaction parameter of the target service;
The rendering module is used for rendering form data in the target class tab into the visual operation page;
And the editing module is used for editing the YAML file based on the operation of the target object on the visual operation page.
According to still another aspect of the present disclosure, there is provided an electronic apparatus including:
At least one processor; and
A memory communicatively coupled to the at least one processor; wherein,
The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method described above.
According to yet another aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions for causing the computer to perform the above-described method.
According to yet another aspect of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the method described above.
In the embodiment of the disclosure, a YAML editing tool aiming at the OpenAPI specification is provided, so that a user can operate a visual operation page, and the user can complete editing tasks faster and more accurately. The management efficiency of a large number of YAML files required by a large model is improved.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification.
Drawings
The drawings are for a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
FIG. 1 is a flow diagram of a file processing method applied to a large model in accordance with one embodiment of the present disclosure;
FIG. 2 is a schematic diagram of a visual operations page in accordance with an embodiment of the present disclosure;
FIG. 3 is another schematic diagram of a visual operations page in accordance with an embodiment of the present disclosure;
FIG. 4 is another schematic diagram of a visual operations page in accordance with an embodiment of the present disclosure;
FIG. 5 is another schematic diagram of a visual operations page in accordance with an embodiment of the present disclosure;
FIG. 6 is another schematic diagram of a visual operations page in accordance with an embodiment of the present disclosure;
FIG. 7 is another schematic diagram of a visual operations page in accordance with an embodiment of the present disclosure;
FIG. 8 is another schematic diagram of a visual operations page in accordance with an embodiment of the present disclosure;
FIG. 9 is another schematic diagram of a visual operations page in accordance with an embodiment of the present disclosure;
FIG. 10 is another schematic diagram of a visual operations page in accordance with an embodiment of the present disclosure;
FIG. 11 is an overall flow diagram of a file processing method applied to a large model in accordance with one embodiment of the present disclosure;
FIG. 12 is a schematic diagram of a framework of a file processing method applied to a large model in accordance with an embodiment of the present disclosure;
FIG. 13 is a schematic diagram of a file handling device applied to a large model in accordance with an embodiment of the present disclosure;
Fig. 14 is a block diagram of an electronic device for implementing a file processing method applied to a large model according to an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present disclosure to facilitate understanding, and should be considered as merely exemplary. Accordingly, one of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
In addition, numerous specific details are set forth in the following detailed description in order to provide a better illustration of the aspects provided by the presently disclosed embodiments. It will be appreciated by one skilled in the art that the embodiments of the present disclosure may be practiced without some of these specific details. In some instances, methods, means, elements, and circuits that are well known to those skilled in the art have not been described in detail in order not to obscure the embodiments of the present disclosure.
While YAML files can be edited in the related art, the functionality of these tools is currently still to be improved. For example, no solution has been proposed at present in terms of how to adapt a large model.
The development of artificial intelligence technology brings new business opportunities for society and new challenges. How to accelerate the development of artificial intelligence technology has become an important research direction.
The large model may be a large language model (Large Language Models, LLMs). The large language model refers to a specific type of large model, which is specially used for processing text data. Such models are neural network-based natural language processing models that can be used to generate, understand, and process text data.
Large language models have good reasoning ability and small sample learning ability, where large language models can understand that the model is large in scale or can be trained on a large number of samples. Accurate semantic understanding can be achieved based on the large model.
In addition to the enhancement of the capabilities of the large model itself, the large model also requires additional services when performing the relevant tasks. For example, the large model requires invoking related services to perform preliminary processing on the information to obtain information that can be input for use by the large model. For example, the large model may invoke an OCR (Optical Character Recognition ) recognition service to recognize text from the picture in order to construct a prompt (prompt) for the large model.
With the development of technology, more and more services are available for large models, and even for the same type of service, services provided on different services have respective advantages. If these services can be more manageable, assistance will be provided to the development of large models.
In view of this, in the embodiments of the present disclosure, a file processing method applied to a large model is proposed focusing on that these services all support connection between YAML files as media and the large model. In this approach, a large model interacts with related services in a manner defined by the YAML file. As the number of services increases, the services are updated iteratively and continuously, requiring editing and managing a large number of YAML files. In order to improve the management efficiency of YAML files, a method provided by an embodiment of the present disclosure is shown in fig. 1, and includes the following contents:
s101, analyzing interaction parameters between a target service and a large model from YAML files required by calling the target service based on an OpenAPI specification; the target service support is invoked by the large model.
The YAML file contains information of the target service which needs to be called by the large model, so that the YAML file is analyzed, and the large model can call the target service.
YAML may be uploaded into an editor through an "upload files" control, as shown in FIG. 2, to facilitate parsing and editing of YAML files. The name of the target service and information such as an ID (Identity document, identification number) may be defined based on the interface shown in fig. 2. Of course, the information such as the profile of the target service and the service icon may be defined according to the user's requirement.
Wherein the name of the target service may be defined in natural language to facilitate viewing of YAML files that retrieve the target service. The service ID is used to define a unique identification of the target service among all available services in order to uniquely distinguish between different services.
The introduction of a service may facilitate understanding of the functionality supported by the service. Icons of services may facilitate defining a distinction between different services.
In the embodiment of the disclosure, the interaction parameters mainly refer to parameters required by the large model to call the target service, and mainly include definitions of a request mode and a response mode. By way of example, the request may include parameters and syntax configurations of the request body, request header, etc.
S102, converting interaction parameters of the target service into form data.
The interaction parameters in the target service may include a plurality of sub-parameters. Each sub-parameter can be used as a row, and the editable item of each sub-parameter can be used as a column, so that form data can be constructed.
Because the interaction parameters may include different types, such as interaction parameters of the request body and interaction parameters of the request head, all belong to different types of interaction parameters. Thus, for ease of management, in the disclosed embodiments, in S103, the interaction parameter classification is associated into a corresponding target category tab based on the type of interaction parameter of the target service.
And S104, rendering form data in the target class tab into a visual operation page.
S105, editing the YAML file based on the operation of the target object on the visual operation page.
In the embodiment of the disclosure, interaction parameters between the target service and the large model are analyzed from YAML files required for calling the target service based on the OpenAPI specification. YAML file parsing based on the OpenAPI specification is implemented. Furthermore, the visual editing function of the interaction parameters is realized by converting the interaction parameters into form data. By associating the interaction parameter classifications into the corresponding target class tabs, classification management and editing of different types of interaction parameters can be facilitated. In summary, in the embodiment of the present disclosure, a YAML editing tool for the OpenAPI specification is provided, and a user may operate a visual operation page, so as to reduce the time for searching and inputting by the user, and reduce the possibility of error, so that the user may complete the editing task more quickly and more accurately. The management efficiency of a large number of YAML files required by a large model is improved.
It should be noted that multiple tools may be included in the same target service, each of which may be used by a large model. In the case of multiple tools, each tool may be parsed from the YAML file. In the case where any tool can interact with the large model through the interaction parameters, editing management of the YAML file may be performed separately for each tool based on the method provided by the embodiments of the present disclosure.
Taking the tools included in the same target service as "show word list", "add a word in word book", "delete a word from word book" as an example, a visual operation page generated based on the YAML file is shown in fig. 3. Of course, in the case that the user needs to delete a certain tool, the user may click on the identifier of the trash can on the tool in fig. 3, and delete the tool.
In the event that the user selects any of the tools of fig. 3, the presented interface may be as shown in fig. 4. In fig. 4, there are shown 4 main types of interaction parameters, including:
1) Category tab of "request parameters"; the category tab is mainly used for editing and managing query requests in YAML files;
2) Category tab of "HTTP HEADERS"; the category tab is mainly used for editing and managing a request header in the YAML file;
3) The 'request Body' is the category tab of the request Body; the category tab is mainly used for editing and managing a request body in the YAML file;
4) The response Body is a class tab of the response Body; the category tab is mainly used for editing and managing the response body in the YAML file.
The parameters in the above types of tabs are interaction parameters that need editing management in the embodiments of the present disclosure. The following describes how to parse the above-mentioned interaction parameters, editing manner of the interaction parameters, and manage a plurality of services based on the OpenAPI specification from the YAML file.
1. Analyzing interaction parameters based on OpenAPI specification
1) Parsing request body and response body
In some embodiments, parsing out interaction parameters between the target service and the large model from the YAML file required to invoke the target service may be implemented as:
step A1, searching a target object meeting the definition of the OpenAPI specification from path objects in a YAML file under the condition that interaction parameters to be analyzed are target object parameters; the target volume parameter is a request volume parameter or a response volume parameter.
And step A2, analyzing the target parameter path from the target object.
And A3, acquiring the target parameters based on the target parameter path.
Taking yacl as an example, paths is a path object, paths is a request Body object, and if it is a response Body object, it is named as response Body. The target volume parameter path may be obtained from the parameter "$ref" under the request Body. Further, visual editing parameters of the request body can be obtained under the target body parameter path.
paths:
/OCR:
post:
Surmery character recognition
Description for extracting and identifying text and position information on picture
operationId:OCR
parameters:[]
requestBody:
content:
application/x-www-form-urlencoded:
schema:
$ref:'#/components/schemas/OCR'
The parameters of the request Body are converted into form data, the form data is associated with the request Body tab, the subparameters under the field are rendered into a visual operation page, and the format of the parameters can be form-data and x-www-form-urlencoded, json. The user may choose based on the actual situation. As shown in fig. 4, in the case where a request Body has multiple visual editing parameters, each parameter corresponds to a respective multiple editable item.
For a response Body, "response Body" is associated to the response Body tab, and the sub-parameters under the field are rendered into the visual operation page.
For example, in the case where the user selects "request Body" in the format of form-data, the visual operation page is as shown in fig. 5, and the editable item corresponding to the parameter is defined based on the YAML file. Such as information that may include field names, field keys, field specifications, field types, option values, default values, etc. In the case that the user does not define the parameters in the YAML file, the interface is a blank interface. The user may add parameters to the page.
As shown in fig. 5, parsing the YAML file to obtain content (content) type of the request Body, in the tab of "request Body", if the content type of the request Body is determined to be form-data, displaying sub-parameters of the request Body under form-data; in the case that the content type of the request Body is determined to be x-www-form-urlencoded, the subparameter of the request Body is shown under x-www-form-urlencoded; in the case where it is determined that the content type of the request Body is json, the subparameter of the request Body is exposed under json. In json format, the user may edit the request Body based on the grammar.
Similarly, in the case that the response body is found, the sub-parameters under the field can be rendered into the visual operation page, and in the case that the field is not found, the sub-parameters of the response body are blank, and the visual display interface is shown in fig. 6.
Similar to the processing manner of the content type in the request Body, analyzing the YAML file to obtain the content type of the response Body, and displaying the subparameter of the response Body under form-data in the case that the content type of the response Body is determined to be form-data in the tab of the response Body; in the case where the content type of the response Body is determined to be x-www-form-urlencoded, then the subparameter of the response Body is shown under x-www-form-urlencoded; in the case where the content type of the response Body is determined to be json, the subparameter of the response Body is shown under json. In json format, the user may edit the response Body based on grammar.
In the embodiment of the disclosure, the target object meeting the definition of the OpenAPI specification is searched from the path object in the YAML file; analyzing a target parameter path from the target object; and acquiring the target parameters based on the target parameter path. Based on the analysis mode, the parameter information of the target object can be accurately and rapidly acquired, and the accuracy and convenience of analysis are ensured.
2) Analysis HTTP HEADERS
In some embodiments, parsing out interaction parameters between the target service and the large model from the YAML file required to invoke the target service may be implemented as:
And B1, under the condition that the interaction parameter to be analyzed is a parameter object of an http request, acquiring a type marking parameter from the parameter object.
And step B2, determining the parameter type based on the type marking parameter.
Step B3, acquiring a request head under the condition that the parameter type is the request head; wherein the request header is associated with a request header tag.
In implementation, taking the type mark parameter as an "in" parameter as an example, judging the parameter type corresponding to the "in" parameter, and obtaining the parameter in HTTP HEADERS when the parameter type is determined to be the request head. After the parameters in HTTP HEADERS are obtained, the visual operation page is as shown in fig. 7, the sub-parameters are displayed in the interface under the condition that the sub-parameters associated with the interaction parameters are found, and the parameter information in the interface is blank under the condition that the sub-parameters associated with the interaction parameters are not found.
In the embodiment of the disclosure, the request header is parsed based on the OpenAPI specification, so that a user can perform visual editing on the request header.
3) Request parameters of parsing query
In some embodiments, parsing out interaction parameters between the target service and the large model from the YAML file required to invoke the target service may be implemented as:
and step C1, under the condition that the interaction parameter to be analyzed is a query request, acquiring the type marking parameter from the parameter object.
And step C2, determining the parameter type based on the type marking parameter.
Step C3, acquiring parameters of the query request under the condition that the parameter type is the query request; wherein, the parameter of the query request is associated with the request parameter tag.
In implementation, in the foregoing description of the type parameter being "in", if the parameter type is defined as the query request, the request parameter of the query is obtained. After the request parameters of the query are obtained, the request parameters are associated with the tab of the request parameters. The visual operation page is shown in fig. 4, when the sub-parameter associated with the query request is found, the sub-parameter is displayed in the interface, and when the sub-parameter associated with the query request is not found, the sub-parameter information in the interface is blank.
In the embodiment of the disclosure, the request parameters are accurately resolved based on the OpenAPI specification, and a data basis is provided for the user to visually edit the request parameters.
Under the condition that the interaction parameters are analyzed, the interaction parameters of different types are associated to the corresponding category labels for visual editing.
An explanation of how the YAML file is visualized is provided below.
2. Visual editing YAML file
In some embodiments, since the user can adjust the parameter information under the interaction parameters according to the actual situation, the YAML file can be edited based on the operation of the target object on the visual operation page, which can be implemented as follows:
Step D1, supporting the target object to execute at least one operation in the operation set so as to obtain updated interaction parameters; the updated interaction parameters are form data; the operation set includes: adding parameters, modifying parameters and deleting parameters.
In the case of taking the interaction parameter as a query request, the parameter is associated to the request parameter label, the interface of which is shown in fig. 4, and in the case of clicking the "add parameter" control, the parameter can be added. The delete control may be clicked to delete the unwanted parameters. In case a certain parameter needs to be changed, it may also be modified.
In some embodiments, the OpenAPI specification is very complex, which increases the user threshold. To facilitate modification of the YAML file to meet the specification for the correct specification, the write specification of interaction parameters is prompted in the visual operations page in embodiments of the present disclosure.
Here, the writing specification of the OpenAPI specification is mainly prompted, for example, "limited chinese, english, numerals, and '_'" are prompted near the input box of the "field name" field in fig. 4, and "field Key cannot be null" is prompted for "field Key". Other fields and the like, not described in detail herein.
These cues can be presented in a striking manner to facilitate the user's knowledge of the relevant specifications, proper editing of the YAML file.
In the embodiment of the disclosure, visual editing of YAML (graphical user interface) based on the OpenAPI specification can be realized based on the prompt information, so that the possibility of errors is reduced, and the efficiency of editing the YAML file is improved.
And D2, reversely analyzing the updated interaction parameters into a YAML format according to the specification of the OpenAPI, and storing the updated interaction parameters.
In one embodiment, the updated interaction parameters may be updated to the original YAML file, or may be stored as a new YAML file.
In the embodiment of the disclosure, parameters in the target service can be updated based on the parameter information of the customized target service which is required to be customized and based on the visual operation page, and after the parameter update is completed, the parameters can be stored in a YAML format so as to be convenient for later use and editing.
In addition to the hints set forth in the OpenAPI specification, corresponding fields may be described in embodiments of the disclosure to facilitate user understanding of the meaning of the fields, as shown in the gray-word section of fig. 4, for example, a gray font is displayed in the input box of the field name in fig. 4, which describes the function of the field name as "for front-end presentation, such as 'hint word'.
In some embodiments, to facilitate real-time verification of editing results on YAML files, to ensure accuracy of update parameters, the disclosed implementations further include the following operations:
and E1, responding to the verification operation, accessing the target service based on the updated interaction parameters, and obtaining an access result.
And E2, determining the error type and prompting when the access result is an access error.
Also as shown in fig. 4, after the user updates the interaction parameter, the user may click on the "interface test" control, and access the target service based on the updated interaction parameter to obtain an access result (not shown in fig. 4). In case of abnormal access result, the error type and the error position can be displayed, and the user can modify the error type and the position based on the error type and the position. For example, the user is supported to edit the url address of the target service, and in case of error in the configured url, the url error is prompted in the access result so as to facilitate the user to modify the corresponding parameters.
In the embodiment of the disclosure, by verifying the function of the YAML file based on the updated interaction parameters, under the abnormal condition, the error type is displayed and the prompt is given, so that the user can be helped to quickly locate and solve the problem based on the mode, and the YAML file can be conveniently edited correctly.
In some embodiments, where the user selects the presentation object parameters to be in json format, it may be implemented as:
and F1, supporting to display the target parameters in a json format in the visual operation page.
And F2, checking and writing contents based on the OpenAPI specification under the condition that the parameters of the target body are edited in the json format.
And F3, prompting the specific type of the writing error under the condition that the writing content does not accord with the OpenAPI specification.
In implementation, taking the target body parameter as a response body as an example, the interface visual operation page is shown in fig. 6, and the user can edit the parameter in a gray frame and click on a view example to obtain the edited format. In the process of editing the grammar code, the YAML editor of the embodiment of the disclosure verifies the editing result based on the OpenAPI specification in real time. For the fields which do not meet the specification, a corresponding rendering mode can be adopted for displaying. For example, when the editing is correct, the display is green, and when the grammar is incorrect, the display is red, so that the user can modify the red part.
After the user edits a piece of code, the user can click on the interface test plug-in, the jump interface of which is shown in fig. 8, and the test result of the piece of code can be displayed for the user.
In the embodiment of the disclosure, the user edits the target body parameters in json format, and the written content can be checked in real time based on the OpenAPI specification. Meanwhile, through real-time preview, a user can learn whether the written content meets the OpenAPI requirement or not, so that the possibility of errors is reduced.
In addition, in the embodiments of the present disclosure, for the portions that do not meet the specification, an automatic correction function is also provided. Missing fields may be automatically supplemented, for example, to help the user better edit the YAML file.
In addition to the functionality described above, the disclosed embodiments also support the simultaneous management of multiple services. To improve the efficiency of managing different services. This is very friendly for services from different sources, e.g., one service from the A-platform and another service from the B-platform, by the way provided by embodiments of the present disclosure, services from different platforms can be consolidated and edited. And after the editing is completed, YAML files of different platforms can be respectively split, so that the service of the different platforms is respectively managed.
This will be described below
3. Editing and management of multiple services
In practice, there will be multiple service support large model calls. Each service has a corresponding url address, so the yacl file also defines the url address, and for convenience of editing, the following steps I1-I2 may be further included in the embodiments of the present disclosure:
And step I1, resolving url addresses for providing target services from the YAML file.
And step I2, displaying the url address in a visual operation page in a form data format so as to support editing operation on the url address.
As shown in FIG. 4, http:// 127.0.1:8081/get_ wordbook is the url address of the target service, and the target service in the large model can be called based on the address. The user can edit the url address based on actual requirements, the drop-down menu where the GET is located can be modified, other options can include POST, PUT and DELETE, and the url address can be modified under the condition that the option needs to be modified.
In the embodiment of the disclosure, the user can edit the YAML file based on the visual operation page by performing editing operation on the url address based on the visual operation page.
In some embodiments, to manage different services, also exemplified in FIG. 3, a user may add other services by "importing YAML files" in the interface shown in FIG. 3 to merge interaction parameters that manage the other services. The method can be implemented as follows:
And step G1, responding to the operation of adding other services, taking the other services as new target services, and returning to execute the operation of analyzing interaction parameters between the target services and the large model from YAML files required by calling the target services based on the OpenAPI specifications until the YAML files of the other services are edited.
Step G2, adding url addresses of the target service and other services to the service set of the large model, so that the large model calls the required tools based on the service set.
In practice, the "import YAML file" control in the interface of FIG. 3 may be clicked, and the interface displayed later may be directly input by the editor as shown in FIG. 9, and in the case where the "upload YAML file" control is selected, the existing YAML file is uploaded. The editor in the disclosed embodiments may then perform the operations set forth in the disclosed embodiments on the uploaded YAML file.
It should be noted that, in the embodiment of the present disclosure, editing of not only two YAML files is supported, but also editing of multiple YAML files may be implemented repeatedly based on a control of "import YAML files". The processing manner of each YAML file is the same and will not be described here again.
In the embodiment of the disclosure, a plurality of YAML files can be edited, and the url addresses of the services of all parties are summarized into the service set, so that a large model can conveniently call different services based on the set.
Of course, the control of "add function" in the page of fig. 3 may be clicked, and other tools are added for the service, and then the interface of "edit function brief introduction" in fig. 10 is skipped, the "function chinese name", "function english name" and "function brief introduction" of the tool may be edited, after the editing is completed, the "next step" plug-in may be clicked, the interface parameter setting interface may be entered, and the user may customize the relevant parameters of the required tool.
It should be noted that the existing tool in the service also supports editing of the interface shown in fig. 10.
In some embodiments, adding url addresses of url of the target service and other services to the service set of the large model may be implemented as:
And step H1, taking url of the target service as a key vector, and adding the YAML file of the target service as a value vector into the service set.
And step H2, taking url of other services as a key vector, and adding YAML files of other services as a value vector into the service set.
In implementation, url corresponding to the target service is used as a key vector, and YAML file of the target service is used as a value vector to be added into the service set. In the case where the user adds another service, url of the service may be used as a key vector, and YAML file of the other service may be added as a value vector to the service set.
The large model may find the corresponding YAML file based on url and invoke the corresponding service based on the corresponding YAML file.
In the embodiment of the disclosure, url and YAML files corresponding to a plurality of services are stored in a key value pair mode, so that a large model is convenient to call the corresponding services, and different services can be managed respectively.
In summary, the overall flow of the file processing method applied to the large model according to the embodiment of the present disclosure may be divided into six parts, including startup and initialization, file loading and parsing, editing and real-time preview, saving and exporting, integrating and expanding, as shown in fig. 11, including:
s1101, start and initialize: the user launches the YAML editor; initializing an editor and loading necessary resources and configuration;
S1102, file loading and analysis: the user selects or inputs the YAML file to be edited, loads the YAML file through the editor, analyzes the YAML file, and verifies whether the YAML file meets the OpenAPI specification;
If the OpenAPI specification is met, various tools under the same service in the file are analyzed, and visual editing of the various tools is supported.
If the OpenAPI specification is not met, an error is prompted.
S1103, editing and real-time preview: the user edits the YAML file in an editor, and the editor provides auxiliary functions such as grammar highlighting, automatic complement, error checking and the like;
s1104, save and export: after the user finishes editing, the modified YAML file can be selected to be saved, and the editor supports exporting the YAML file into other formats, such as json, PDF and the like;
s1105, end and exit: the user closes the YAML editor and the editor performs the necessary cleaning work such as saving configuration, releasing resources, etc.
In addition, the YAML editor in the embodiment of the disclosure enables the YAML editor to be integrated into other systems or services through an open API (Application Programming Interface, an interface between programs) and a plug-in interface, and a user can customize and expand the functions of the YAML editor according to requirements;
similarly, plug-in mechanisms may be supported, allowing developers to customize and extend YAML editor functionality in embodiments of the present disclosure as desired to meet personalization requirements.
Meanwhile, the embodiment of the disclosure supports cross-platform operation, can be used on different operating systems and devices, and provides more choices for users.
An application architecture diagram of a file processing method applied to a large model proposed in an embodiment of the present disclosure is shown in fig. 12, where a user interface layer includes a menu bar, a toolbar, an editing area, and a preview area. The user interface layer supports interaction with a user, and can realize the function of the visual operation page. The core function area comprises YAML file loading, YAML file parsing, YAML file editing and YAML file saving. Since the YAML file in the embodiments of the present disclosure needs to conform to the OpenAPI specification, validation and processing logic associated with the OpenAPI specification also needs to be stored into the core functional area. The auxiliary function area is used for providing functions such as grammar highlighting, automatic complement, error checking and the like. The API and plug-in interface layer is used for providing open API and plug-in interfaces and supporting integration and expansion with other systems or services. The data storage and access area is used for being responsible for YAML file data storage and access, and interaction with other data sources. The basic service layer is used for log recording, monitoring, security assurance, authority control and the like.
Based on the same technical concept, in the embodiments of the present disclosure, a file processing apparatus 1300 applied to a large model is provided, as shown in fig. 13, including:
the parsing module 1301 is configured to parse interaction parameters between the target service and the large model from the YAML file required for calling the target service based on the OpenAPI specification; the target service support is invoked by the large model;
A conversion module 1302, configured to convert interaction parameters of the target service into form data;
the association module 1303 is configured to associate the interaction parameter classification into a corresponding target category tab based on the type of the interaction parameter of the target service;
The rendering module 1304 is configured to render form data in the target category tab into a visual operation page;
and the editing module 1305 is used for editing the YAML file based on the operation of the target object on the visual operation page.
In some embodiments, the parsing module is specifically configured to:
Under the condition that the interaction parameters to be analyzed are target body parameters, searching a target body object meeting the definition of the OpenAPI specification from path objects in the YAML file; the target body parameter is a request body parameter or a response body parameter;
Analyzing a target parameter path from a target object;
And acquiring the target parameters based on the target parameter path.
In some embodiments, the parsing module is specifically configured to:
under the condition that the interaction parameter to be analyzed is a parameter object of an http request, acquiring a type marking parameter from the parameter object;
determining a parameter type based on the type marking parameter;
Acquiring a request head under the condition that the parameter type is the request head;
wherein the request header is associated with a request header tag.
In some embodiments, the parsing module is specifically configured to:
Under the condition that the parameter type is a query request, acquiring the parameter of the query request;
Wherein, the parameter of the query request is associated with the request parameter tag.
In some embodiments, the method further comprises an address acquisition module for:
resolving url addresses for providing target services from YAML files;
the url address is presented in a visual operation page in a form data format to support editing operations on the url address.
In some embodiments, the method further comprises adding a functional module for:
responding to the operation of adding other services, taking the other services as new target services, and returning to execute the operation of analyzing interaction parameters between the target services and the large model from YAML files required by calling the target services based on the OpenAPI specifications until the YAML files of the other services are edited;
Url addresses of url of the target service and url addresses of other services are added to the service set of the large model, so that the large model calls the required service based on the service set.
In some embodiments, functional modules are added, in particular for
Taking url of the target service as a key vector, and adding YAML file of the target service as a value vector into a service set; and
Url of other services is used as key vector, and YAML file of other services is used as value vector to be added into service set.
In some embodiments, the editing module is configured to:
supporting the target object to execute at least one operation in the operation set so as to obtain updated interaction parameters; the updated interaction parameters are form data; the operation set includes: adding parameters, modifying parameters and deleting parameters;
and reversely analyzing the updated interaction parameters into YAML format according to the specification of the OpenAPI, and storing the updated interaction parameters.
In some embodiments, the system further comprises a verification module for:
responding to the verification operation, accessing the target service based on the updated interaction parameters, and obtaining an access result;
And in the case that the access result is an access error, determining the error type and prompting.
In some embodiments, the system further comprises a prompt module for:
and prompting the writing specification of the interaction parameters in the visual operation page.
In some embodiments, the system further comprises a verification module for:
Support to show the target body parameter in json format in the visual operation page;
under the condition of editing the target body parameters in json format, checking and writing contents based on the OpenAPI specification;
in the case where the writing content does not conform to the OpenAPI specification, a specific type of writing error is prompted.
Descriptions of specific functions and examples of each module, sub-module/unit of the apparatus in the embodiment of the disclosure may refer to related descriptions of corresponding steps in the foregoing method embodiments, which are not repeated herein.
According to embodiments of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
Fig. 14 shows a schematic block diagram of an example electronic device 1400 that may be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile apparatuses, such as personal digital assistants, cellular telephones, smartphones, wearable devices, and other similar computing apparatuses. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 14, the apparatus 1400 includes a computing unit 1401 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM) 1402 or a computer program loaded from a storage unit 1408 into a Random Access Memory (RAM) 1403. In the RAM 1403, various programs and data required for the operation of the device 1400 can also be stored. The computing unit 1401, the ROM 1402, and the RAM 1403 are connected to each other through a bus 1404. An input/output (I/O) interface 1405 is also connected to the bus 1404.
Various components in device 1400 are connected to I/O interface 1405, including: an input unit 1406 such as a keyboard, a mouse, or the like; an output unit 1407 such as various types of displays, speakers, and the like; a storage unit 1408 such as a magnetic disk, an optical disk, or the like; and a communication unit 1409 such as a network card, a modem, a wireless communication transceiver, and the like. The communication unit 1409 allows the device 1400 to exchange information/data with other devices through a computer network such as the internet and/or various telecommunications networks.
The computing unit 1401 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of computing unit 1401 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 1401 performs the respective methods and processes described above, for example, a file processing method applied to a large model. For example, in some embodiments, the file processing method applied to the large model may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as storage unit 1408. In some embodiments, part or all of the computer program may be loaded and/or installed onto the device 1400 via the ROM 1402 and/or the communication unit 1409. When a computer program is loaded into the RAM 1403 and executed by the computing unit 1401, one or more steps of the file processing method described above applied to the large model can be performed. Alternatively, in other embodiments, the computing unit 1401 may be configured to perform the file processing method applied to the large model in any other suitable way (e.g. by means of firmware).
Various implementations of the systems and techniques described here above can be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), complex Programmable Logic Devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for carrying out methods of the present disclosure may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus such that the program code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the internet.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server of a distributed system, or a server incorporating a blockchain.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps recited in the present disclosure may be performed in parallel, sequentially, or in a different order, provided that the desired results of the disclosed aspects are achieved, and are not limited herein.
The above detailed description should not be taken as limiting the scope of the present disclosure. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions, improvements, etc. that are within the principles of the present disclosure are intended to be included within the scope of the present disclosure.

Claims (25)

1.A file processing method applied to a large model, comprising:
Analyzing interaction parameters between the target service and the large model from YAML files required by calling the target service based on an OpenAPI specification; the target service support is invoked by the large model;
converting the interaction parameters of the target service into form data;
Based on the type of the interaction parameter of the target service, the interaction parameter is classified and associated into a corresponding target category tab;
Rendering form data in the target class tab into a visual operation page;
editing the YAML file based on the operation of the target object on the visual operation page.
2. The method of claim 1, wherein the parsing out interaction parameters between the target service and the large model from the YAML file required to invoke the target service comprises:
Under the condition that the interaction parameters to be analyzed are target parameters, searching a target object meeting the definition of the OpenAPI specification from the path objects in the YAML file; the target body parameter is a request body parameter or a response body parameter;
Analyzing a target parameter path from the target object;
and acquiring the target volume parameter based on the target volume parameter path.
3. The method of claim 1, wherein the parsing out interaction parameters between the target service and the large model from the YAML file required to invoke the target service comprises:
Under the condition that the interaction parameter to be analyzed is a parameter object of an http request, acquiring a type marking parameter from the parameter object;
determining a parameter type based on the type-marking parameter;
acquiring the request head under the condition that the parameter type is the request head;
wherein the request header is associated with a request header tag.
4. A method according to claim 3, further comprising:
acquiring parameters of the query request under the condition that the parameter type is the query request;
Wherein the parameter of the query request is associated with a request parameter tag.
5. The method of any of claims 1-4, further comprising:
resolving url addresses for providing the target service from the YAML file;
and displaying the url address in the visual operation page in a form data format so as to support editing operation on the url address.
6. The method of claim 5, further comprising:
Responding to the operation of adding other services, taking the other services as new target services, and returning to execute the operation of analyzing interaction parameters between the target services and the large model from YAML files required by calling the target services based on the OpenAPI specifications until the YAML files of the other services are edited;
Adding url addresses of the target service and url addresses of the other services to the service set of the large model so that the large model calls the required service based on the service set.
7. The method of claim 6, wherein the adding url addresses of the target service and the other services to the service set of the large model comprises:
taking url of the target service as a key vector, and adding YAML file of the target service as a value vector into the service set; and
The url of the other service is used as a key vector, and the YAML file of the other service is used as a value vector to be added into the service set.
8. The method of any of claims 1-7, wherein editing the YAML file based on manipulation of a target object on the visual manipulation page comprises:
supporting the target object to execute at least one operation in the operation set so as to obtain updated interaction parameters; the updated interaction parameters are form data; the set of operations includes: adding parameters, modifying parameters and deleting parameters;
And reversely analyzing the updated interaction parameters into a YAML format according to the specification of the OpenAPI, and storing the updated interaction parameters.
9. The method of claim 8, further comprising:
responding to the verification operation, accessing the target service based on the updated interaction parameters, and obtaining an access result;
And in the case that the access result is an access error, determining the error type and prompting.
10. The method of claim 8, further comprising:
and prompting the writing specification of the interaction parameters in the visual operation page.
11. The method of claim 2, further comprising:
supporting to display the target volume parameters in json format in the visual operation page;
Under the condition that the target parameters are edited in json format, checking and writing content based on the OpenAPI specification;
and prompting a specific type of writing error under the condition that the writing content does not accord with the OpenAPI specification.
12. A document processing apparatus for use with a large model, comprising:
The analysis module is used for analyzing interaction parameters between the target service and the large model from YAML files required by calling the target service based on the OpenAPI specification; the target service support is invoked by the large model;
The conversion module is used for converting the interaction parameters of the target service into form data;
the association module is used for associating the interaction parameter classification into a corresponding target category tab based on the type of the interaction parameter of the target service;
The rendering module is used for rendering form data in the target class tab into a visual operation page;
and the editing module is used for editing the YAML file based on the operation of the target object on the visual operation page.
13. The apparatus of claim 12, wherein the parsing module is specifically configured to:
Under the condition that the interaction parameters to be analyzed are target parameters, searching a target object meeting the definition of the OpenAPI specification from the path objects in the YAML file; the target body parameter is a request body parameter or a response body parameter;
Analyzing a target parameter path from the target object;
and acquiring the target volume parameter based on the target volume parameter path.
14. The apparatus of claim 12, wherein the parsing module is specifically configured to:
Under the condition that the interaction parameter to be analyzed is a parameter object of an http request, acquiring a type marking parameter from the parameter object;
determining a parameter type based on the type-marking parameter;
acquiring the request head under the condition that the parameter type is the request head;
wherein the request header is associated with a request header tag.
15. The apparatus of claim 14, the parsing module being specifically configured to:
acquiring parameters of the query request under the condition that the parameter type is the query request;
Wherein the parameter of the query request is associated with a request parameter tag.
16. The apparatus of any of claims 12-15, further comprising an address acquisition module to:
resolving url addresses for providing the target service from the YAML file;
and displaying the url address in the visual operation page in a form data format so as to support editing operation on the url address.
17. The apparatus of claim 16, further comprising an add-on function module to:
Responding to the operation of adding other services, taking the other services as new target services, and returning to execute the operation of analyzing interaction parameters between the target services and the large model from YAML files required by calling the target services based on the OpenAPI specifications until the YAML files of the other services are edited;
Adding url addresses of the target service and url addresses of the other services to the service set of the large model so that the large model calls the required service based on the service set.
18. The apparatus of claim 17, wherein the add-on function module is specifically configured to
Taking url of the target service as a key vector, and adding YAML file of the target service as a value vector into the service set; and
The url of the other service is used as a key vector, and the YAML file of the other service is used as a value vector to be added into the service set.
19. The apparatus of any of claims 12-18, wherein the editing module is to:
supporting the target object to execute at least one operation in the operation set so as to obtain updated interaction parameters; the updated interaction parameters are form data; the set of operations includes: adding parameters, modifying parameters and deleting parameters;
And reversely analyzing the updated interaction parameters into a YAML format according to the specification of the OpenAPI, and storing the updated interaction parameters.
20. The apparatus of claim 19, further comprising a verification module to:
responding to the verification operation, accessing the target service based on the updated interaction parameters, and obtaining an access result;
And in the case that the access result is an access error, determining the error type and prompting.
21. The apparatus of claim 19, further comprising a prompt module to:
and prompting the writing specification of the interaction parameters in the visual operation page.
22. The apparatus of claim 13, further comprising a verification module to:
supporting to display the target volume parameters in json format in the visual operation page;
Under the condition that the target parameters are edited in json format, checking and writing content based on the OpenAPI specification;
and prompting a specific type of writing error under the condition that the writing content does not accord with the OpenAPI specification.
23. An electronic device, comprising:
At least one processor; and
A memory communicatively coupled to the at least one processor; wherein,
The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-11.
24. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-11.
25. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any of claims 1-11.
CN202410295337.3A 2024-03-14 2024-03-14 File processing method and device applied to large model and related equipment Pending CN118192956A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410295337.3A CN118192956A (en) 2024-03-14 2024-03-14 File processing method and device applied to large model and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410295337.3A CN118192956A (en) 2024-03-14 2024-03-14 File processing method and device applied to large model and related equipment

Publications (1)

Publication Number Publication Date
CN118192956A true CN118192956A (en) 2024-06-14

Family

ID=91394110

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410295337.3A Pending CN118192956A (en) 2024-03-14 2024-03-14 File processing method and device applied to large model and related equipment

Country Status (1)

Country Link
CN (1) CN118192956A (en)

Similar Documents

Publication Publication Date Title
US10970097B2 (en) Adaptive web-based robotic process automation
US11281862B2 (en) Significant correlation framework for command translation
RU2351976C2 (en) Mechanism for provision of output of data-controlled command line
US9098626B2 (en) Method and system for log file processing and generating a graphical user interface based thereon
US10409820B2 (en) Semantic mapping of form fields
US10019426B2 (en) Generating data format description language schema
US20120131556A1 (en) Xpath-based selection assistance of gui elements during manual test script authoring for xml-based applications
CN112148356B (en) Document generation method, interface development method, device, server and storage medium
US11880323B2 (en) System and method for building and implementing automated workflows
US10572278B2 (en) Smart controls for user interface design and implementation
CN111581920A (en) Document conversion method, device, equipment and computer storage medium
US20190205461A1 (en) Method and System For Exposing Virtual Assistant Services Across Multiple Platforms
US9678856B2 (en) Annotated test interfaces
KR20240091051A (en) Deep learning techniques for extracting embedded data from documents
US8521762B2 (en) Automated business process modeling
CN117632710A (en) Method, device, equipment and storage medium for generating test code
CN112860584A (en) Test method and device based on workflow model
CN115469849B (en) Service processing system, method, electronic equipment and storage medium
CN116610558A (en) Code detection method, device, electronic equipment and computer readable storage medium
CN118192956A (en) File processing method and device applied to large model and related equipment
CN117015781A (en) Generating a natural language interface from a graphical user interface
CN116028028B (en) Request function generation method, device, equipment and storage medium
CN113495753B (en) Method and device for acquiring label of item, electronic equipment and storage medium
CN117270838B (en) Method, device, equipment and medium for generating universal formula script
CN111279350B (en) System and method for providing globalization features in service management application interfaces

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination