An interface docking method and apparatus
By constructing a field recommendation model and a code snippet generation model, interface integration code is automatically generated, solving the problems of wasted resources and low efficiency in the manual development of interface integration code in existing technologies. This achieves intelligent and automated interface integration, improves efficiency, and has the ability to iterate and update.
Patent Information
- Application Number
- CN202510637901.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-16
- Publication Date
- 2026-11-17
AI Technical Summary
Existing interface integration methods require manual development of interface integration code based on the interface integration documentation of the integration system, which wastes development resources and affects efficiency.
By constructing a field recommendation model and a code snippet generation model, interface integration code is automatically generated. The field recommendation model determines the fields to be integrated, and the code snippet generation model generates field conversion code, thus achieving intelligent interface integration.
It saves development resources, improves interface integration efficiency, and has the ability to iterate and update, making it highly adaptable.
Smart Images

Figure CN123114431A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to an interface docking method and apparatus. Background Technology
[0002] To ensure data interaction between different systems, it is necessary to establish connections between the interfaces of different systems. Since the access rules of different systems may differ, the access party needs to develop interface connection code according to the interface connection documentation of the system being connected.
[0003] In the process of realizing this invention, the inventors discovered the following problems in the prior art:
[0004] Existing interface integration methods require manual development of interface integration code based on the interface integration documentation of the integration system. This not only wastes valuable development resources but also affects the efficiency of interface integration and cannot meet actual needs. Summary of the Invention
[0005] In view of this, embodiments of the present invention provide an interface docking method and apparatus, which realizes intelligent and automated interface docking. Based on the docking fields corresponding to the standard fields determined by the field recommendation model, the method uses a code segment generation model to generate field conversion code that converts the standard fields into docking fields according to the field conversion logic. This not only saves development resources but also improves the efficiency of interface docking.
[0006] To achieve the aforementioned objective, according to one aspect of an embodiment of the present invention, an interface interfacing method is provided, comprising:
[0007] Obtain the interface integration code template, and find the code segment to be replaced from the interface integration code template;
[0008] Input the standard fields and interface docking documents in the code segment to be replaced into a preset field recommendation model, and obtain the docking fields corresponding to the standard fields output by the field recommendation model;
[0009] The standard field, the docking field, and the interface docking document are input into a preset code segment generation model. The code segment generation model determines the conversion logic for converting the standard field into the docking field, so that the code segment generation model generates field conversion code according to the conversion logic and outputs the field conversion code.
[0010] Replace the code segment to be replaced with the field conversion code to obtain the interface integration code.
[0011] Optionally, in response to the standard field being a nested field, the standard field in the code segment to be replaced is input into a preset field recommendation model, including: obtaining the hierarchical relationship information of the standard field, appending the hierarchical relationship information to the standard field, and then inputting the appended standard field into the field recommendation model.
[0012] Optionally, the standard fields and interface docking documents in the code segment to be replaced are input into a preset field recommendation model to obtain the docking fields corresponding to the standard fields output by the field recommendation model. This includes: classifying the standard fields using the field recommendation model to determine the category of the standard fields; and sending the standard fields, the category of the standard fields, and the interface docking documents into the recommendation network of the field recommendation model, so that the recommendation network selects the docking fields corresponding to the standard fields from the interface docking documents based on the learned mapping relationship knowledge between the standard fields and docking fields under the category, and outputs the docking fields corresponding to the standard fields.
[0013] Optionally, determining the conversion logic for converting the standard field into the interface field through the code segment generation model, so that the code segment generation model generates field conversion code according to the conversion logic, includes: determining the category of the standard field through the code segment generation model; the code segment generation model, based on learned knowledge of the conversion logic for converting the standard field into the interface field under the category, determining the conversion logic for converting the standard field into the interface field from the interface interface document, and generating code generation prompts containing the conversion logic, so that the code segment generation model generates field conversion code according to the prompts.
[0014] Optionally, the field recommendation model and the code segment generation model are constructed in the following ways: Obtain the interface integration documents of the interface service providers that have completed interface integration, and classify the integration information in the interface integration documents to obtain category integration information of different categories; obtain the standard fields of the internal interfaces that interface with the interface service providers, and extract the integration fields corresponding to the standard fields from the category integration information of the completed interface integration, establish a mapping relationship between the standard fields and the integration fields, and obtain a field category knowledge base for the category to which the integration fields belong; determine the conversion logic for converting the standard fields into the integration fields according to the integration rules of the integration fields corresponding to the standard fields, and construct a conversion category knowledge base for the category to which the integration fields belong; train the initial field recommendation model using the field category knowledge base to obtain the trained field recommendation model; and train the initial code segment generation model using the conversion category knowledge base to obtain the trained code segment generation model.
[0015] Optionally, the interface fields corresponding to the standard fields are displayed to the interface interface designer in the form of a visual page; inputting the standard fields and the interface fields into a preset code segment generation model includes: listening to the interface interface designer's verification result of the interface fields in the visual page, and in response to receiving the verification result, inputting the standard fields and the interface fields obtained from the verification result into the code segment generation model.
[0016] Optionally, in response to receiving a joint development request for interface docking code, the method further includes: determining joint development rules based on the joint development request; sending the joint development rules to the interface docking designer to obtain docking sub-code developed by the interface docking designer; and combining the docking sub-code with the interface docking code obtained by replacing the code segment to be replaced with the field conversion code to form the jointly developed interface docking code.
[0017] According to a second aspect of the present invention, an interface docking device is provided, comprising:
[0018] The code template processing module is used to obtain the interface integration code template and find the code segment to be replaced from the interface integration code template;
[0019] The interface field determination module is used to input the standard fields and interface interface documents in the code segment to be replaced into a preset field recommendation model, and obtain the interface fields corresponding to the standard fields output by the field recommendation model;
[0020] The conversion code generation module is used to input the standard field, the docking field, and the interface docking document into a preset code segment generation model, and determine the conversion logic of converting the standard field into the docking field through the code segment generation model, so that the code segment generation model generates field conversion code according to the conversion logic and outputs the field conversion code;
[0021] The code replacement module is used to replace the code segment to be replaced with the field conversion code to obtain the interface docking code.
[0022] According to a third aspect of the present invention, an interface-interfaced electronic device is provided, comprising:
[0023] One or more processors;
[0024] Storage device for storing one or more programs.
[0025] When the one or more programs are executed by the one or more processors, the one or more processors implement the method provided in the first aspect of the embodiments of the present invention.
[0026] According to a fourth aspect of the present invention, a computer-readable medium is provided having a computer program stored thereon, which, when executed by a processor, implements the method provided in the first aspect of the present invention.
[0027] According to a fifth aspect of the present invention, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the method provided in the first aspect of the present invention.
[0028] One embodiment of the invention has the following advantages or beneficial effects: It obtains an interface docking code template and identifies the code segment to be replaced from the template; it inputs the standard fields and interface docking documentation from the code segment to be replaced into a preset field recommendation model, and obtains the docking fields corresponding to the standard fields output by the field recommendation model; it inputs the standard fields, docking fields, and interface docking documentation into a preset code segment generation model, and determines the conversion logic for converting the standard fields into docking fields through the code segment generation model, so that the code segment generation model generates and outputs field conversion code according to the conversion logic; it replaces the code segment to be replaced with the field conversion code to obtain the interface docking code. This technical solution realizes an intelligent and automated interface docking method. Based on the docking fields corresponding to the standard fields determined by the field recommendation model, the code segment generation model generates field conversion code to convert the standard fields into docking fields according to the field conversion logic, which not only saves development resources but also improves the efficiency of interface docking. Attached Figure Description
[0029] The accompanying drawings are provided to better understand the invention and are not intended to unduly limit the scope of the invention. Wherein:
[0030] Figure 1 This is a schematic diagram of the main flow of the interface docking method according to an embodiment of the present invention;
[0031] Figure 2 This is a flowchart illustrating the construction method of the field recommendation model and code segment generation model according to an embodiment of the present invention;
[0032] Figure 3 This is a schematic diagram illustrating the construction principle of the field category knowledge base and the conversion category knowledge base in an embodiment of the present invention;
[0033] Figure 4 This is a flowchart of an interface docking method according to a possible embodiment of the present invention;
[0034] Figure 5 This is a schematic diagram of the overall process of the interface docking method according to an embodiment of the present invention;
[0035] Figure 6This is a schematic diagram of the main modules of the interface docking device according to an embodiment of the present invention;
[0036] Figure 7 This is an exemplary system architecture diagram in which embodiments of the present invention can be applied;
[0037] Figure 8 This is a schematic diagram of the structure of a computer system suitable for implementing terminal devices or servers of the present invention. Detailed Implementation
[0038] It should be noted that the acquisition, storage, and application of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0039] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of the present invention, including various details to aid understanding. These details should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the invention. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0040] Existing interface integration methods require manual development of interface integration code based on the interface integration documentation of the integration system. This not only wastes valuable development resources but also affects the efficiency of interface integration and cannot adequately meet the needs of practical applications.
[0041] To address the aforementioned problems in existing technologies, this invention proposes an interface integration method. It pre-constructs a field recommendation model capable of predicting interface fields, and a code segment generation model capable of generating field conversion code based on standard fields and interface fields. The field recommendation model and code segment generation model are then used sequentially to generate corresponding field conversion code for the code segments to be replaced in the interface integration code template. This achieves intelligent and automated interface integration. Based on the interface fields corresponding to the standard fields determined by the field recommendation model, the code segment generation model generates field conversion code that converts the standard fields into interface fields according to the field conversion logic. This not only saves development resources but also improves the efficiency of interface integration.
[0042] Figure 1 This is a schematic diagram of the main flow of the interface docking method according to an embodiment of the present invention, as shown below. Figure 1 As shown, the interface docking method of this embodiment includes the following steps S101 to S104.
[0043] Step S101: Obtain the interface integration code template and find the code segment to be replaced from the interface integration code template.
[0044] Specifically, before interface integration, to automate the process, the requesting party should first outline the common logic for interface integration and adopt a modular design approach, dividing the common logic into functional parts and building interface code templates. A code template engine, such as the Velocity component, can be used to improve the efficiency of building interface integration code templates and generate accurate data transfer DTO objects to achieve data transfer between systems. For functions in the interface integration code template that require the receiving party's specific fields, the standard fields within the requesting party's system will be used for initial development. However, code segments that require converting standard fields to receiving fields need to be distinguished by additional, agreed-upon placeholders, such as the $ sign.
[0045] Furthermore, the interface system receives the interface interface connection request sent by the access request party, retrieves the interface interface connection code template constructed above, and identifies the code segment to be replaced that has placeholders and needs field conversion from the interface interface connection code template according to the preset placeholders.
[0046] Step S102: Input the standard fields and interface docking documents in the code segment to be replaced into a preset field recommendation model, and obtain the docking fields corresponding to the standard fields output by the field recommendation model.
[0047] Specifically, after identifying the code segment to be replaced, the standard fields within that segment are retrieved. In this embodiment, the standard fields are the internal standard fields of the access requester. Considering that the interface fields used by the current interface provider are usually different from the standard fields, this embodiment utilizes an intelligent field recommendation model. Based on the mapping features between standard fields and interface fields in the field recommendation model, the corresponding interface fields are identified from the interface interface documentation of the current service provider.
[0048] For example, regarding the standard field "recipient's phone number" in the order placement interface, given the mapping relationship between the standard fields recorded in the successfully integrated interface code or integration records and the integration fields of each successfully integrated service provider, the mapping feature result extracted by the field recommendation model from the mapping relationship indicates that these fields all contain the character "tel". Therefore, the field recommendation model searches for fields containing the character "tel" in the recipient integration information in the interface integration document of the current integrated service provider, and outputs the corresponding integration field for the standard field "recipient's phone number" in the current integrated service provider as the integration field containing the character "tel".
[0049] According to an embodiment of the present invention, in response to the standard field being a nested field, inputting the standard field in the code segment to be replaced into a preset field recommendation model includes: obtaining the hierarchical relationship information of the standard field, appending the hierarchical relationship information to the standard field, and then inputting the appended standard field into the field recommendation model.
[0050] Specifically, in some business scenarios, standard fields may be nested fields. For example, an order field may contain multiple item fields. Since the item fields belong to the order field, it is necessary to attach the fields or field descriptions of the previous one or several layers above the item fields. The standard fields with hierarchical relationships are input into the field recommendation model so that the field recommendation model can recommend the corresponding docking fields from the interface docking document based on the obtained standard fields with hierarchical relationships, thus ensuring the accuracy of the docking fields output by the field recommendation model.
[0051] Step S103: Input the standard field, the docking field, and the interface docking document into a preset code segment generation model. Determine the conversion logic of converting the standard field into the docking field through the code segment generation model, so that the code segment generation model generates field conversion code according to the conversion logic and outputs the field conversion code.
[0052] Specifically, considering that the access requester and the interface provider are different systems, different field definitions or usage rules are inevitable. For example, the standard field is the recipient address, which is a complete address text format, while the interface provider's interface field R_address is a three-level address text format. Therefore, simply knowing the interface field is insufficient to convert the standard field to the interface field; the conversion logic must also be determined. Thus, this embodiment of the invention learns and accumulates the characteristics of the conversion logic between the standard field and the interface field in successfully connected records. Using an intelligent code segment generation model, it first determines the field conversion logic from the interface interface documentation based on the standard field and the interface field, and then automatically generates field conversion code based on the conversion logic, the standard field, and the interface field.
[0053] According to one embodiment of the present invention, the interface field corresponding to the standard field is displayed to the interface interface designer in the form of a visual page; inputting the standard field and the interface field into a preset code segment generation model includes: listening to the interface interface designer's verification result of the interface field in the visual page, and in response to receiving the verification result, inputting the standard field and the interface field obtained from the verification result into the code segment generation model.
[0054] Specifically, considering that the accuracy of the matching fields corresponding to the standard fields directly determines the accuracy of subsequent conversion logic and field conversion code, this embodiment of the invention, to ensure accuracy, after determining the matching fields corresponding to the standard fields, displays the matching fields corresponding to the standard fields to the interface design party through the front-end display page, that is, to the access request party. The displayed content mainly includes the matching fields, the data type of the matching fields, the description of the matching fields, the standard fields, and the mapping correspondence between the matching fields and the standard fields. Understandably, there may be more than one code segment to be replaced in the interface interface code template, and there may be more than one standard field in the code to be replaced. Correspondingly, there may also be more than one matching field corresponding to the standard field. Therefore, these standard fields and their corresponding matching fields are displayed in a list format on the front-end display page. The access request party can adjust and verify the matching fields of the standard fields based on business experience or other auxiliary tools, and submit the verification results to the interface system through the front-end display page. The system listens for the verification results submitted by the interface design team. It uses the interface field corresponding to the standard field in the received verification result as the final determined interface field. It then uses the standard field, the corresponding determined interface field, and the interface interface document input code segment to generate a model.
[0055] Step S104: Replace the code segment to be replaced with the field conversion code to obtain the interface docking code.
[0056] Specifically, based on the field conversion code generated by the code segment generation model to convert internal standard fields into interface fields, the field conversion code is used to replace the code segments to be replaced in the interface interface code template, resulting in complete interface interface code that can be used for interconnection between the internal interface and the interface of the interface system. It can be understood that when there are multiple code segments to be replaced in the interface interface code template, for each code segment to be replaced, the corresponding field conversion code is generated according to the above method. The generated field conversion codes are then used to replace the corresponding code segments to be replaced, thus obtaining interface interface code that can be used for interconnection between the internal interface and the interface of the interface system.
[0057] This invention employs an intelligent method, successively using a field recommendation model and a code segment generation model to determine the corresponding interface fields in the code segment to be replaced, as well as the conversion logic for converting standard fields into interface fields. Then, based on the standard fields, interface fields, and the conversion logic, field conversion code is generated to automatically generate interface interface code. This not only saves manpower costs but also improves interface integration efficiency. Furthermore, considering that the field recommendation model and code segment generation model adopt a machine learning model structure, they have the ability to iteratively update and learn, thereby improving the adaptability of the interface integration method.
[0058] The interface integration code generation in this embodiment of the invention mainly utilizes an intelligent field recommendation model and a code segment generation model. Both models employ machine learning. Specifically, it is necessary to construct training samples about field mapping to train the field recommendation model, and also to construct training samples about field conversion logic to train the conversion logic determination capability of the code segment generation model. Only by clarifying the conversion logic can the code segment generation model easily generate field conversion code. Figure 2 This is a flowchart illustrating the construction method of the field recommendation model and code segment generation model according to an embodiment of the present invention. Figure 2 As shown, the construction methods for the two models can include:
[0059] Step S201: Obtain the interface integration documents of the service providers whose interfaces have been integrated, and classify the integration information in the interface integration documents to obtain category integration information of different types.
[0060] Specifically, given that actual business collaborations involve more than one service provider (the interface partner), and that each service provider has different formats and specifications for their interface integration documentation, to facilitate subsequent data organization and integration, after obtaining the interface integration documentation from service providers with a history of interface integration, data cleaning and format conversion preprocessing are performed. Data cleaning can be achieved through common methods such as deduplication, clustering, and mean imputation. Format conversion preprocessing mainly involves structurally formatting and parsing the interface integration documentation, converting it into a standardized description language used by the access requester. For example, the interface integration documentation can be converted into a standardized JSON Schema format, which can be achieved using parsing tools such as the AI engine platform AutoBots or other intelligent document parsing models. By converting the integration documentation into a standardized description language, it not only facilitates the parsing and understanding of subsequent field recommendation models and code segment generation models, but also provides clear and standardized data formats and validation rules, making daily verification and maintenance easier.
[0061] Furthermore, considering that service provider interface integration documents are generally quite lengthy and involve multiple service providers, to improve efficiency and avoid data corruption and errors due to excessive data, the integration information in the interface integration documents after data cleaning and format conversion preprocessing is categorized into different categories. For example, there are order category integration information for orders, and package category integration information for parcels, etc.
[0062] Step S202: Obtain the standard fields of the internal interface that connects with the service provider, extract the connection fields corresponding to the standard fields from the category connection information of the completed interface connection, establish the mapping relationship between the standard fields and the connection fields, and obtain the field category knowledge base of the category to which the connection fields belong.
[0063] Specifically, the standard fields of the internal interfaces of the access requester are obtained, and the obtained standard fields are cleaned. Since the category docking information comes from the interface docking documentation of docking service providers that have already completed interface docking, docking fields corresponding to the standard fields can be extracted from the category docking information based on the historical interface docking code. A mapping relationship between the standard fields and docking fields is then established, forming a field category knowledge base for the category to which the docking field belongs. For example, if the docking field comes from the package category docking information, then the mapping relationship between the docking field and its corresponding standard field forms the package field category knowledge base. Understandably, the category of the standard field in this case is also the package field category. For docking fields in different categories of docking information, the mapping relationship between them and their corresponding standard fields forms different field category knowledge bases.
[0064] According to the field category dimension, based on the interface integration documents of the service providers that have completed interface integration in the past, the embodiments of the present invention can build different field category knowledge bases in a multi-threaded, multi-tasking, and categorized manner. This not only improves the construction efficiency of the field category knowledge base, but also provides a foundation for the subsequent field recommendation model to recommend fields according to field categories, so as to improve recommendation efficiency while saving the resource consumption of the field recommendation model.
[0065] Step S203: Based on the docking rules of the docking field corresponding to the standard field, determine the conversion logic for converting the standard field into the docking field, and construct a conversion category knowledge base for the category to which the docking field belongs.
[0066] Specifically, based on the interface fields established with the standard fields, the corresponding interface rules are obtained from the interface information of the interface fields. Based on the obtained interface rules, as well as the standard fields and the corresponding interface fields, conversion logic is established to convert the standard fields into interface fields. For example, if the standard field mentioned above is a complete recipient address text, and the interface rule for the interface field R_address is a three-level address structure, then conversion logic is needed to convert an address text into a three-level address structure. Next, the correspondence between the conversion logic and the standard and interface fields is established. Since the interface fields come from category interface information and are fields under the category dimension, this correspondence between the conversion logic and the standard and interface fields is used as the conversion category knowledge base for the category to which the interface field belongs. For example, in the recipient address conversion logic mentioned above, the R_address field belongs to the address category interface information, so the knowledge base constructed by this conversion logic is the address conversion category knowledge base.
[0067] Figure 3 This is a schematic diagram illustrating the construction principle of the field category knowledge base and the conversion category knowledge base in this embodiment of the invention. First, the interface integration documents of the service providers whose interfaces have been integrated are obtained. This can include multiple service providers, such as service provider 1, service provider 2, service provider 3, and so on. The integration information from the interface integration documents of each service provider that has already been integrated is summarized and organized. Then, the summarized and organized integration information undergoes data cleaning and format conversion preprocessing to obtain integration information using a unified standardized description language.
[0068] Furthermore, the preprocessed docking information is classified to obtain different categories of docking information. At the same time, the standard fields of the internal interfaces that dock with the docking service provider are obtained. Based on the docking code of the interfaces that have been docked or docking records, a mapping relationship between the standard fields and docking fields is established to obtain the field category knowledge base of the category to which the docking field belongs, such as the order field category knowledge base, address field category knowledge base, package field category knowledge base, item field category knowledge base, and other field category knowledge bases.
[0069] Then, based on the docking rules of the docking fields corresponding to the standard fields in the docking information, the conversion logic for converting the standard fields into docking fields is determined, and a conversion category knowledge base for the category to which the docking fields belong is constructed. Similar to the field category knowledge base, there are also corresponding order conversion category knowledge bases, address conversion category knowledge bases, package conversion category knowledge bases, item conversion category knowledge bases, and other conversion category knowledge bases. In the figure, all conversion category knowledge bases are concentrated in the conversion category knowledge base.
[0070] Understandably, the field category knowledge base and conversion category knowledge base constructed in this embodiment of the invention support continuous iterative updates. The docking system will monitor the accuracy of the output results of the field recommendation model and the code segment generation model in real time, and dynamically adjust and optimize the corresponding field category knowledge base and conversion category knowledge base based on the monitoring results. Then, the adjusted and optimized field category knowledge base and conversion category knowledge base are used to iteratively update the field recommendation model and the code segment generation model to obtain high-quality field conversion code.
[0071] Step S204: Train the initial field recommendation model using the field category knowledge base to obtain the trained field recommendation model; train the initial code segment generation model using the conversion category knowledge base to obtain the trained code segment generation model.
[0072] Specifically, embodiments of the present invention can construct an initial field recommendation model based on a convolutional neural network, using the various field category knowledge bases constructed above as training samples. These knowledge bases are then used to train the initial field recommendation model's field recommendation capability, resulting in a trained field recommendation model that can be used to recommend matching fields to standard fields. The initial code segment generation model of the present invention can be constructed based on a deep learning model with a self-attention mechanism. Using the various conversion category knowledge bases described above as training samples, these knowledge bases are then used to train the initial code segment generation model's conversion logic determination capability, resulting in a trained code segment generation model that can determine the conversion logic for converting standard fields to matching fields and generate field conversion code.
[0073] Figure 4 This is a flowchart of an interface docking method according to a possible embodiment of the present invention. As another embodiment of the present invention, such as... Figure 4 As shown, the interface connection method may include:
[0074] Step S401: Obtain the interface integration code template and find the code segment to be replaced from the interface integration code template.
[0075] Step S402: Classify the standard field using the field recommendation model to determine the category of the standard field; send the standard field, the category of the standard field, and the interface docking document into the recommendation network of the field recommendation model, so that the recommendation network selects the docking field corresponding to the standard field from the interface docking document based on the learned mapping relationship knowledge between the standard field and the docking field under the category, and outputs the docking field corresponding to the standard field.
[0076] Specifically, considering that the training data of the field recommendation model is a knowledge base of various field categories, when using the field recommendation model to recommend fields for connection, this embodiment of the invention also needs to classify the standard fields first and determine the category of the standard fields, such as address category or package category.
[0077] Furthermore, the field recommendation model feeds the standard field, its category, and the interface integration document into the recommendation network. It extracts the field features of the standard field, and then, combined with the category of the standard field received by the recommendation network, activates the field category knowledge base already learned for that category. From this knowledge base, it extracts the interface field features of various previously integrated service providers that have a mapping relationship with the field features of the standard field. Finally, based on the interface integration document of the current service provider, it selects the interface field with the highest similarity to the interface field features from the interface integration document, and outputs this selected interface field as the interface field corresponding to the standard field.
[0078] Step S403: Input the standard fields, the docking fields, and the interface docking document into the preset code segment generation model.
[0079] Step S404: Determine the category of the standard field through the code segment generation model; the code segment generation model, based on the learned conversion logic knowledge of converting the standard field into the docking field under the category, determines the conversion logic of converting the standard field into the docking field from the interface docking document, and generates code generation prompt words containing the conversion logic, so that the code segment generation model generates field conversion code according to the prompt words.
[0080] Specifically, the training data for the code snippet generation model is also a knowledge base of various conversion categories. Therefore, in this embodiment of the invention, when using the code snippet generation model to determine the conversion logic for converting standard fields into interface fields, it is also necessary to first classify the standard fields and determine their categories. Based on the category of the standard field, the code snippet generation model activates the conversion category knowledge base corresponding to that category that it has already learned. Based on the conversion logic for converting various standard fields into interface fields that it has already learned, and combining the field characteristics of the current standard field and the field characteristics of the interface field, it determines the corresponding conversion logic from the interface interface documentation of the current interface service provider, and generates a code generation prompt containing this conversion logic. Finally, using the code generation network within the code snippet generation model, it generates field conversion code to convert the standard fields into the interface fields of the current interface service provider based on the code generation prompt.
[0081] Step S405: Replace the code segment to be replaced with the field conversion code to obtain the interface docking code.
[0082] According to an embodiment of the present invention, in response to receiving a joint development request for interface docking code, the method further includes: determining joint development rules according to the joint development request; sending the joint development rules to the interface docking designer to obtain docking sub-code developed by the interface docking designer; and combining the docking sub-code with the interface docking code obtained by replacing the code segment to be replaced with the field conversion code to form the jointly developed interface docking code.
[0083] Specifically, considering that some interface integration service providers may have special integration rules in their interface integration documents that require manual development, such as encrypted integration rules in encrypted transmission, the integration system, upon receiving a joint development request for interface integration code, parses the request to obtain the included joint development rules. These rules specify the requirements for manually developed interface sub-code, including code development requirements and the deployment location of the developed sub-code within the overall interface integration code. The integration system then sends the parsed joint development rules to the interface integration designer. Upon receiving these rules, the designer manually designs and develops the interface sub-code according to the rules and submits the completed sub-code to the integration system. The integration system loads the sub-code into the interface integration code according to the required deployment location. At this point, the interface integration code is obtained by replacing the code segment to be replaced with field conversion code. Finally, the interface integration code after loading the sub-code is used as the final interface integration code generated by the manual joint model development.
[0084] Figure 5 This is a schematic diagram of the overall process of the interface integration method according to an embodiment of the present invention. First, the interface integration document of the service provider to be integrated is obtained and imported into the integration system. The integration system identifies the integration information in the interface integration document and converts it into a standardized format, such as JSON Schema. The diagram illustrates two different methods for importing interface integration documents. Automatic import can be achieved using the AI engine platform AutoBots, or manual import can be performed using a document analysis and conversion model, such as Kimi. Manual import allows for manual adjustments to the interface integration document. This embodiment of the present invention prefers the automatic import method.
[0085] Further, the system obtains the interface integration code template and identifies the code segment to be replaced from it. Based on a field recommendation model trained from various field category knowledge bases, it inputs the standard fields in the code segment to be replaced and the currently imported and format-converted interface integration document of the current integration service provider into the field recommendation model. The system then obtains the integration fields corresponding to the standard fields output by the field recommendation model. The integration system displays the integration fields corresponding to the standard fields to the interface integration designer in a visual page and monitors the interface integration designer's verification results of the integration fields in the visual page. Upon receiving the verification results, based on a code segment generation model trained from various conversion category knowledge bases, it inputs the standard fields, the integration fields obtained from the verification results, and the interface integration document of the current integration service provider into the code segment generation model. The code segment generation model generates field conversion code based on a determined conversion logic for converting standard fields to integration fields, and replaces the code segment to be replaced in the interface integration code template with this field conversion code. In addition, upon receiving a joint development request from the current service provider, the system sends the joint development rules from the request to the interface design team. The interface design team then manually writes the interface sub-code and deploys it within the updated interface code, resulting in the jointly developed interface code for interfacing with the current service provider. Simultaneously, based on the field conversion code generated by the code segment generation model and the manually developed interface sub-code, the system constructs the internal interfacing capabilities of the requesting party with the current service provider.
[0086] Finally, the interface system uses debugging or integration tools to debug the generated interface interface code, ensuring the quality and reliability of the generated interface code.
[0087] This invention employs a field recommendation model trained on various field category knowledge bases to build a field recommendation model with the ability to recommend matching fields, and a code segment generation model trained on a conversion category knowledge base to build a code segment generation model with the ability to convert specific fields and generate code. A classification strategy is used to perform the recommendation of matching fields and the generation of field conversion code in parallel through multiple threads and tasks. This not only saves system resources but also further improves the efficiency of interface integration with the service provider.
[0088] Figure 6 This is a schematic diagram of the main modules of the interface docking device according to an embodiment of the present invention. Figure 6 As shown, the interface docking device 600 mainly includes a code template processing module 601, a docking field determination module 602, a conversion code generation module 603, and a code replacement module 604.
[0089] The code template processing module 601 is used to obtain the interface docking code template and find the code segment to be replaced from the interface docking code template;
[0090] The interface field determination module 602 is used to input the standard fields and interface interface documents in the code segment to be replaced into a preset field recommendation model, and obtain the interface fields corresponding to the standard fields output by the field recommendation model;
[0091] The conversion code generation module 603 is used to input the standard field, the docking field, and the interface docking document into a preset code segment generation model, and determine the conversion logic of converting the standard field into the docking field through the code segment generation model, so that the code segment generation model generates field conversion code according to the conversion logic and outputs the field conversion code;
[0092] The code replacement module 604 is used to replace the code segment to be replaced with the field conversion code to obtain the interface docking code.
[0093] According to an embodiment of the present invention, in response to the standard field being a nested field, the docking field determination module 602 is further configured to: obtain the hierarchical relationship information of the standard field, attach the hierarchical relationship information to the standard field, and then input the attached standard field into the field recommendation model.
[0094] According to another embodiment of the present invention, the docking field determination module 602 is further configured to: classify the standard field using the field recommendation model to determine the category of the standard field; send the standard field, the category of the standard field, and the interface docking document into the recommendation network of the field recommendation model, so that the recommendation network selects the docking field corresponding to the standard field from the interface docking document based on the learned mapping relationship knowledge between the standard field and the docking field under the category, and outputs the docking field corresponding to the standard field.
[0095] According to another embodiment of the present invention, the conversion code generation module 603 is further configured to: determine the category of the standard field through the code segment generation model; the code segment generation model, based on the learned conversion logic knowledge of converting the standard field into the docking field under the category, determines the conversion logic of converting the standard field into the docking field from the interface docking document, and generates code generation prompt words containing the conversion logic, so that the code segment generation model generates field conversion code according to the prompt words.
[0096] According to another embodiment of the present invention, the field recommendation model and the code segment generation model are constructed in the following manner: The interface integration documents of the interface service providers that have completed interface integration are obtained, and the integration information in the interface integration documents is classified to obtain category integration information of different categories; standard fields of the internal interfaces that interface with the interface service providers are obtained, and the integration fields corresponding to the standard fields are extracted from the category integration information of the completed interface integration, a mapping relationship is established between the standard fields and the integration fields, and a field category knowledge base of the category to which the integration fields belong is obtained; according to the integration rules of the integration fields corresponding to the standard fields, the conversion logic for converting the standard fields into the integration fields is determined, and a conversion category knowledge base of the category to which the integration fields belong is constructed; the field category knowledge base is used to train an initial field recommendation model to obtain a trained field recommendation model; the conversion category knowledge base is used to train an initial code segment generation model to obtain a trained code segment generation model.
[0097] According to another embodiment of the present invention, the docking fields corresponding to the standard fields are displayed to the interface docking designer in the form of a visual page; the conversion code generation module 603 is further configured to: listen to the verification result of the interface docking designer on the docking fields in the visual page, and in response to receiving the verification result, input the standard fields and the docking fields obtained from the verification result into the code segment generation model.
[0098] According to another embodiment of the present invention, in response to receiving a joint development request for interface interface code, the interface interface device 600 further includes a joint development module (not shown in the figure), configured to: determine joint development rules according to the joint development request; send the joint development rules to the interface interface designer to obtain interface sub-code developed by the interface interface designer; and combine the interface sub-code with the interface interface code obtained by replacing the code segment to be replaced with the field conversion code to form the jointly developed interface interface code.
[0099] Figure 7 This is an exemplary system architecture diagram in which embodiments of the present invention can be applied.
[0100] like Figure 7 As shown, system architecture 700 may include terminal devices 701, 702, and 703, a network 704, and a server 705. Network 704 serves as the medium for providing communication links between terminal devices 701, 702, and 703 and server 705. Network 704 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.
[0101] Users can use terminal devices 701, 702, and 703 to interact with server 705 via network 704 to receive or send messages, etc. Various communication client applications, such as interface integration applications, can be installed on terminal devices 701, 702, and 703 (for example only).
[0102] Terminal devices 701, 702, and 703 can be various electronic devices with displays and web browsing capabilities, including but not limited to smartphones, tablets, laptops, and desktop computers.
[0103] Server 705 can be a server providing various services, such as a backend management server supporting interface connections made by users using terminal devices 701, 702, and 703 (for example only). The backend management server can obtain an interface connection code template and find the code segment to be replaced from the template; input the standard fields in the code segment to be replaced into a preset field recommendation model in the interface connection document, and obtain the connection fields corresponding to the standard fields output by the field recommendation model; input the standard fields, the connection fields, and the interface connection document into a preset code segment generation model, and determine the conversion logic for converting the standard fields into the connection fields through the code segment generation model, so that the code segment generation model generates field conversion code according to the conversion logic and outputs the field conversion code; replace the code segment to be replaced with the field conversion code to obtain the interface connection code, and process the result (e.g., the interface connection code—for example only) and feed it back to the terminal device.
[0104] It should be noted that the interface docking method provided in the embodiments of the present invention is generally executed by the server 705, and correspondingly, the interface docking device is generally set in the server 705.
[0105] It should be understood that Figure 7 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0106] The following is for reference. Figure 8 , Figure 8 This is a schematic diagram of the structure of a computer system suitable for implementing terminal devices or servers of the present invention. Figure 8 The terminal device or server shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of the present invention.
[0107] like Figure 8As shown, the computer system 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 802 or programs loaded from storage section 808 into random access memory (RAM) 803. The RAM 803 also stores various programs and data required for the operation of the system 800. The CPU 801, ROM 802, and RAM 803 are interconnected via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0108] The following components are connected to I / O interface 805: an input section 806 including a keyboard, mouse, etc.; an output section 807 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to I / O interface 805 as needed. A removable medium 811, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 810 as needed so that computer programs read from it can be installed into storage section 808 as needed.
[0109] In particular, according to the embodiments disclosed in this invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 809, and / or installed from removable medium 811. When the computer program is executed by central processing unit (CPU) 801, it performs the functions defined above in the system of this invention.
[0110] It should be noted that the computer-readable medium shown in this invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0111] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0112] The units described in the embodiments of the present invention can be implemented in software or hardware. The described units can also be housed in a processor; for example, a processor can be described as including: a code template processing module, a docking field determination module, a conversion code generation module, and a code replacement module.
[0113] In some cases, the names of these modules do not constitute a limitation on the module itself. For example, the code template processing module can also be described as "a module for obtaining interface interface code templates and finding the code segment to be replaced from the interface interface code templates".
[0114] On the other hand, the present invention also provides a computer-readable medium, which may be included in the device described in the embodiments; or it may exist independently and not assembled into the device. The computer-readable medium carries one or more programs, which, when executed by the device, cause the device to include: obtaining an interface interface code template and identifying a code segment to be replaced from the interface interface code template; inputting a standard field from the code segment to be replaced and an interface interface document into a preset field recommendation model, and obtaining the interface field corresponding to the standard field output by the field recommendation model; inputting the standard field, the interface field, and the interface interface document into a preset code segment generation model, and determining conversion logic to convert the standard field into the interface field through the code segment generation model, so that the code segment generation model generates field conversion code according to the conversion logic and outputs the field conversion code; and replacing the code segment to be replaced with the field conversion code to obtain interface interface code.
[0115] The technical solution of the present invention has the following advantages or beneficial effects: by obtaining an interface docking code template and finding the code segment to be replaced from the interface docking code template; inputting the standard fields in the code segment to be replaced and the interface docking document into a preset field recommendation model, obtaining the docking fields corresponding to the standard fields output by the field recommendation model; inputting the standard fields, docking fields, and interface docking documents into a preset code segment generation model, determining the conversion logic of converting the standard fields into docking fields through the code segment generation model, so that the code segment generation model generates field conversion code according to the conversion logic and outputs the field conversion code; replacing the code segment to be replaced with the field conversion code to obtain the interface docking code, the technical solution realizes an intelligent and automated interface docking method. Based on the docking fields corresponding to the standard fields determined by the field recommendation model, the code segment generation model generates field conversion code to convert the standard fields into docking fields according to the determined conversion logic, which not only saves development resources but also improves the interface docking efficiency.
[0116] The specific embodiments described herein do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. An interface connection method, characterized in that, include: Obtain the interface integration code template, and find the code segment to be replaced from the interface integration code template; Input the standard fields and interface docking documents in the code segment to be replaced into a preset field recommendation model, and obtain the docking fields corresponding to the standard fields output by the field recommendation model; The standard field, the docking field, and the interface docking document are input into a preset code segment generation model. The code segment generation model determines the conversion logic for converting the standard field into the docking field, so that the code segment generation model generates field conversion code according to the conversion logic and outputs the field conversion code. Replace the code segment to be replaced with the field conversion code to obtain the interface integration code.
2. The method according to claim 1, characterized in that, In response to the fact that the standard field is a nested field, the standard field in the code segment to be replaced is input into a preset field recommendation model, including: Obtain the hierarchical relationship information of the standard field, append the hierarchical relationship information to the standard field, and then input the appended standard field into the field recommendation model.
3. The method according to claim 1, characterized in that, Input the standard fields and interface integration documents in the code segment to be replaced into a preset field recommendation model, and obtain the integration fields corresponding to the standard fields output by the field recommendation model, including: The standard fields are classified using the field recommendation model to determine their categories; The standard field, the category of the standard field, and the interface docking document are fed into the recommendation network of the field recommendation model, so that the recommendation network selects the docking field corresponding to the standard field from the interface docking document based on the learned mapping relationship between the standard field and the docking field under the category, and outputs the docking field corresponding to the standard field.
4. The method according to claim 1, characterized in that, The code segment generation model determines the conversion logic for converting the standard field into the interface field, so that the code segment generation model generates field conversion code according to the conversion logic, including: The category of the standard field is determined by generating a model using the code segment; The code segment generation model, based on learned knowledge of the conversion logic of standard fields to docking fields under the category, determines the conversion logic of standard fields to docking fields from the interface docking document, and generates code generation prompts containing the conversion logic, so that the code segment generation model generates field conversion code according to the prompts.
5. The method according to claim 1, characterized in that, The field recommendation model and the code snippet generation model are constructed in the following ways: Obtain the interface integration documents of the service providers whose interfaces have been integrated, and classify the integration information in the interface integration documents to obtain category integration information for different categories. Obtain the standard fields of the internal interface that connects with the service provider, and extract the connection fields corresponding to the standard fields from the category connection information of the completed interface connection, establish the mapping relationship between the standard fields and the connection fields, and obtain the field category knowledge base of the category to which the connection field belongs; Based on the docking rules of the docking field corresponding to the standard field, determine the conversion logic to convert the standard field into the docking field, and construct a conversion category knowledge base of the category to which the docking field belongs; The field recommendation initial model is trained using the field category knowledge base to obtain the trained field recommendation model. The initial model for generating code segments is trained using the aforementioned conversion category knowledge base, resulting in a trained code segment generation model.
6. The method according to claim 1, characterized in that, The corresponding interface fields for the standard fields are displayed to the interface design team in the form of a visual page. The standard fields and the interface fields are input into a preset code segment to generate a model, including: The system monitors the validation results of the interface design party on the visualization page for the interface fields. In response to receiving the validation results, the system inputs the standard fields and the interface fields obtained from the validation results into the code segment to generate the model.
7. The method according to claim 1, characterized in that, In response to receiving a joint development request for interface integration code, the method further includes: Based on the aforementioned joint development request, joint development rules will be determined; The joint development rules are sent to the interface design party to obtain the interface sub-code developed by the interface design party; The interface interface code is formed by replacing the code segment to be replaced with the field conversion code, together with the interface sub-code, to create the jointly developed interface interface code.
8. An interface docking device, characterized in that, include: The code template processing module is used to obtain the interface integration code template and find the code segment to be replaced from the interface integration code template; The interface field determination module is used to input the standard fields and interface interface documents in the code segment to be replaced into a preset field recommendation model, and obtain the interface fields corresponding to the standard fields output by the field recommendation model; The conversion code generation module is used to input the standard field, the docking field, and the interface docking document into a preset code segment generation model, and determine the conversion logic of converting the standard field into the docking field through the code segment generation model, so that the code segment generation model generates field conversion code according to the conversion logic and outputs the field conversion code; The code replacement module is used to replace the code segment to be replaced with the field conversion code to obtain the interface docking code.
9. A mobile electronic device terminal, characterized in that, include: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-7.
10. A computer-readable medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-7.
11. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-7.
