Interface mapping methods and electronic devices
By acquiring and parsing the structured information of non-standard and standard Redfish API interfaces, and establishing target mapping relationships using a unified format, the problems of low efficiency and accuracy in existing technologies are solved, and the versatility of efficient interface data transmission and management tools is improved.
Patent Information
- Application Number
- CN202511831768.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-05
- Publication Date
- 2026-03-06
- Estimated Expiration
- 2045-12-05
AI Technical Summary
In existing technologies, manually establishing a mapping relationship between non-standard Redfish API interfaces and standard Redfish API interfaces is inefficient and inaccurate, resulting in reduced versatility and scalability of server management tools.
By acquiring and parsing the structured information of the first and second interfaces, a target mapping relationship is established using a unified format to realize data transmission between the first and second interfaces.
It improves the efficiency and accuracy of establishing target mapping relationships, reduces the tediousness and subjectivity of manual operations, and enhances the versatility and scalability of server management tools.
Smart Images

Figure CN121255501B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of server technology, and in particular to an interface mapping method and electronic device. Background Technology
[0002] The standard Redfish Application Programming Interface (API) is a standard hardware management API. To adapt to the characteristics of different servers, non-standard Redfish APIs can be developed, differing from the standard API. In related technologies, engineers can understand the functional definitions and data interaction logic of non-standard Redfish APIs by reading their documentation and combining it with practical call examples. Then, engineers manually write the mapping relationship between the non-standard and standard Redfish APIs. The server can then use this mapping to implement data transmission between the non-standard and standard Redfish APIs. However, this manual establishment of the mapping relationship is inefficient. Summary of the Invention
[0003] This application provides an interface mapping method and an electronic device to improve the efficiency of establishing a target mapping relationship between a first interface and a second interface.
[0004] This application provides an interface mapping method, including:
[0005] Obtain the interface information of the first interface; the interface standard of the first interface is different from the preset standard; the interface information of the first interface is used to indicate the attribute information and interaction rules of the first interface;
[0006] The interface information of the first interface is parsed to determine the structured information of the first interface;
[0007] The interface information of the second interface is parsed to determine the structured information of the second interface; wherein, the interface standard of the second interface is a preset standard, and the interface information of the second interface is used to indicate the attribute information and interaction rules of the second interface. The data format of the structured information of the first interface is the same as the data format of the structured information of the second interface.
[0008] Based on the structured information of the first interface and the structured information of the second interface, a target mapping relationship is established between the first interface and the second interface; the target mapping relationship is used to realize data transmission between the first interface and the second interface.
[0009] This application also provides an interface mapping apparatus, including:
[0010] The acquisition module is used to acquire the interface information of the first interface; the interface standard of the first interface is different from the preset standard; the interface information of the first interface is used to indicate the attribute information and interaction rules of the first interface;
[0011] The first determining module is used to parse the interface information of the first interface and determine the structured information of the first interface;
[0012] The second determining module is used to parse the interface information of the second interface and determine the structured information of the second interface; wherein, the interface standard of the second interface is a preset standard, the interface information of the second interface is used to indicate the attribute information and interaction rules of the second interface, and the data format of the structured information of the first interface is the same as the data format of the structured information of the second interface.
[0013] The processing module is used to establish a target mapping relationship between the first interface and the second interface based on the structured information of the first interface and the structured information of the second interface; the target mapping relationship is used to realize data transmission between the first interface and the second interface.
[0014] This application also provides an electronic device, including: a memory for storing a computer program; and a processor for implementing the interface mapping method described above when executing the computer program.
[0015] This application also provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of the above-described interface mapping method.
[0016] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the above-described interface mapping method.
[0017] This application describes a method where a server performs structured processing on the interface information of a first interface and a second interface based on a unified format. This results in structured information for both interfaces. Then, a target mapping relationship is established between the first and second interfaces based on this unified formatted information. Compared to manually establishing target mapping relationships, this method reduces the tedium and subjectivity of manual operations, thereby improving the efficiency and accuracy of establishing and determining target mapping relationships. Attached Figure Description
[0018] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a schematic diagram illustrating an application scenario provided in the embodiments of this application;
[0020] Figure 2 A flowchart illustrating an interface mapping method provided in an embodiment of this application;
[0021] Figure 3 This application provides a schematic flowchart for determining structured information of a first interface according to an embodiment of the present application.
[0022] Figure 4 A schematic diagram illustrating a process for establishing a target mapping relationship, provided as an embodiment of this application;
[0023] Figure 5 A schematic diagram illustrating yet another method for determining a target mapping relationship, provided in an embodiment of this application;
[0024] Figure 6 This is a schematic diagram illustrating a data transmission process between a first interface and a second interface, provided as an embodiment of this application.
[0025] Figure 7 This is a schematic diagram of the structure of an interface mapping device provided in an embodiment of this application;
[0026] Figure 8 A schematic diagram of the structure of the electronic device provided in this application. Detailed Implementation
[0027] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.
[0028] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.
[0029] The standard Redfish API interface serves as an interface for users or upper-layer application software, allowing them to obtain all information about the detection and management of the baseboard management controller, as well as control over the basic management controller.
[0030] In practical applications, to meet the technical characteristics and requirements of different servers, staff can customize the standard Redfish API interface to obtain non-standard Redfish API interfaces adapted to different servers. It should be noted that these non-standard Redfish API interfaces differ from the standard Redfish API interface in terms of interface paths, request parameters, and response parameters. Therefore, management tools developed based on the standard Redfish API interface cannot be used to manage servers using non-standard Redfish API interfaces. Separate adaptation development is required for each different non-standard Redfish API interface, thus reducing the universality and scalability of management tools and causing inconvenience for unified server management.
[0031] In related technologies, staff can understand the functional definitions and data interaction logic of non-standard Redfish API interfaces by reading their documentation and combining it with practical call examples. Then, staff manually write the mapping relationship between the non-standard and standard Redfish API interfaces. The server can then use this mapping relationship to implement data transmission between the non-standard and standard Redfish API interfaces.
[0032] However, manually establishing a mapping between non-standard Redfish API interfaces and standard Redfish API interfaces is inefficient. Furthermore, the accuracy of manually understanding the functional definitions and data interaction logic of non-standard Redfish API interfaces is low, resulting in a low accuracy rate in establishing the mapping between them.
[0033] Based on this, this application provides an interface mapping method. The server performs structured processing on the interface information of a first interface and the interface information of a second interface using a unified format, obtaining structured information for both the first and second interfaces. Then, a target mapping relationship between the first and second interfaces is established based on this unified formatted structured information. Compared to manually establishing target mapping relationships, the method provided in this application reduces the tedium and subjectivity of manual operations, thereby improving the efficiency and accuracy of establishing and determining target mapping relationships.
[0034] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0035] This section describes the specific application environment architecture or hardware architecture that the execution of the interface mapping method depends on. (References) Figure 1 , Figure 1 This is a schematic diagram illustrating an application scenario provided in an embodiment of this application. For example... Figure 1 As shown, it includes a first server 11 and a second server 12, wherein the second server 12 includes a non-standard Redfish API interface.
[0036] In practical applications, the first server 11 can send a data request to the second server 12. The data request is used to request the interface call data of the non-standard Redfish API interface in the second server 12. After receiving the data request sent by the first server 11, the second server 12 sends the interface call data of the non-standard Redfish API interface to the first server 11.
[0037] It should be noted that the execution subject in each embodiment of this application can be a processor, microprocessor, or a device integrating the aforementioned processor or microprocessor, such as a terminal device. The specific execution subject in each embodiment of this application is not limited and can be selected and set according to actual needs. In the following embodiments, a terminal device integrating the aforementioned processor or microprocessor is used as an example for description, which does not constitute a limitation on the actual execution subject.
[0038] It should be noted that, Figure 1 This is merely an example to illustrate one application scenario, and is not intended to limit the application scenario.
[0039] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0040] Figure 2 This is a flowchart illustrating an interface mapping method provided in an embodiment of this application. Figure 2 As shown, the method may include the following steps:
[0041] S201. Obtain the interface information of the first interface; the interface standard of the first interface is different from the preset standard; the interface information of the first interface is used to indicate the attribute information and interaction rules of the first interface.
[0042] The interface standard of the first interface refers to the unified specification for data interaction implemented by the first interface. The preset standard refers to a pre-defined, industry-standard unified specification for data interaction implemented by the interface. In some embodiments, the preset standard may be, for example, the interface standard of the standard Redfish API interface. Since the interface standard of the first interface differs from the preset standard, the first interface may be, for example, a non-standard Redfish API interface. The interface information of the first interface is full data used to describe the core characteristics of the first interface, indicating the attribute information and interaction rules of the first interface. The interface information of the first interface may include, for example, basic attribute information such as the interface name and interface path of the first interface, request structure attributes of the first interface (request parameter name, request data type, etc.), and response structure attributes of the first interface (response parameter name, response data type, etc.).
[0043] In some embodiments, a baseboard management controller is deployed in the server. The baseboard management controller is a small operating system independent of the server, mainly responsible for detecting the server's hardware and software presence status, health status, power consumption, etc., as well as managing functions such as remote control and module restart of the server. In some embodiments, maintenance personnel can use the baseboard management controller to achieve large-scale unattended operation of the server in batches.
[0044] Therefore, the computing power of the server operating system can be reduced by using a baseboard management controller, facilitating server monitoring and management. In some embodiments, to unify the management of the baseboard management controller, the Intelligent Platform Management Interface (IPMI) protocol was proposed. However, due to the rapid development of servers, the standard commands in the IPMI protocol cannot meet the needs of different servers.
[0045] In some embodiments, to adapt to the rapidly evolving needs of servers, researchers have proposed a standard Redfish API interface. This standard Redfish API interface is a hardware management standard API interface developed by the Distributed Management Task Force, based on Hypertext Transfer Protocol / Secure Hypertext Transfer Protocol and a Representational State Transition architecture. Because the standard Redfish API interface is based on Hypertext Transfer Protocol / Secure Hypertext Transfer Protocol, it offers greater security for servers. Furthermore, the JSON data format used by the standard Redfish API interface is simple, easy to use, and easy to read. Therefore, the standard Redfish API interface is widely used in baseboard management and control to monitor and manage the server's operating status.
[0046] In some embodiments, the interface information of the first interface includes interface call data and interface documentation information. The server can send a data request to a server that has deployed a non-standard Redfish API interface. The data request is used to request the retrieval of the interface call data for the non-standard Redfish API interface. Upon receiving the data request, the server that has deployed a non-standard Redfish API interface sends the non-standard Redfish API interface call data to the server. The data request can be, for example, a GET request.
[0047] In some embodiments, an API request tool is deployed on the server. This tool can send GET requests to servers with non-standard Redfish API interfaces. Upon receiving a GET request, the server with the non-standard Redfish API interface sends API call data for the non-standard Redfish API interface to the API request tool.
[0048] In some embodiments, the server further includes a front-end interface, and in response to input by a user on the front-end interface, the server obtains the interface documentation information of the first interface.
[0049] S202. Parse the interface information of the first interface to determine the structured information of the first interface.
[0050] The structured information of the first interface is a standardized, machine-recognizable set of structured data that is organized according to a unified preset format.
[0051] In some embodiments, the server may determine at least one first interface information of the first interface from the interface information of the first interface. For any one of the at least one first interface information, a format conversion process is performed on the first interface information according to a preset format to obtain the structured interface information corresponding to the first interface information. In some embodiments, the structured information of the first interface includes the structured interface information corresponding to each of the at least one first interface information.
[0052] S203. Parse the interface information of the second interface to determine the structured information of the second interface; wherein, the interface standard of the second interface is a preset standard, the interface information of the second interface is used to indicate the attribute information and interaction rules of the second interface, and the data format of the structured information of the first interface is the same as the data format of the structured information of the second interface.
[0053] The interface standard of the second interface refers to the unified specification for data interaction implemented by the second interface. Since the preset standard is a pre-defined, industry-standard unified specification for data interaction, and the interface standard of the second interface is a preset standard, the second interface can be a standard Redfish API interface.
[0054] In some embodiments, the interface information of the second interface is full data describing the core features of the second interface. The interface information of the second interface may include, for example, basic attribute information such as the interface name and interface path of the second interface, request structure attributes of the second interface, and response structure attributes of the second interface.
[0055] In some embodiments, the server stores interface information of the second interface, and the server can determine at least one key interface information of the second interface from the interface information of the second interface. For any one of the at least one second interface information, the server performs a format conversion process on the second interface information according to a preset format to obtain the structured interface information corresponding to the second interface information. In some embodiments, the structured information of the second interface includes the structured interface information corresponding to each of the at least one second interface information.
[0056] It should be noted that the structured interface information corresponding to the second interface information and the structured interface information corresponding to the first interface information are both in structured format, and their formats are identical. For example, the structured interface information corresponding to the second interface information and the structured interface information corresponding to the first interface information are each in the same type of JavaScript Object Notation (JSON) format.
[0057] S204. Based on the structured information of the first interface and the structured information of the second interface, establish a target mapping relationship between the first interface and the second interface; the target mapping relationship is used to realize data transmission between the first interface and the second interface.
[0058] The target mapping relationship is a set of interaction rule mappings between the first interface and the second interface. In some embodiments, the target mapping relationship includes the mapping relationship of interface paths between the first interface and the second interface, the mapping relationship of request / response parameters between the first interface and the second interface, etc. Therefore, the server can guide the automatic conversion of data between the first interface and the second interface based on the target mapping relationship, so that the business data of the first interface can be adapted to the transmission format of the second interface through the target mapping relationship, thereby realizing the data transmission between the first interface and the second interface.
[0059] In some embodiments, the server can associate the structured information of the first interface and the structured information of the second interface with standard fields and business tags in the metadata dictionary, respectively. Based on the standard fields and business tags, the server determines the structured information in the structured information of the second interface that corresponds to the structured information of the first interface. Then, the server establishes a target mapping rule between the first interface and the second interface based on the preset field mapping rules of the metadata dictionary, the structured information of the first interface, and the structured information in the structured information of the second interface that corresponds to the structured information of the first interface.
[0060] exist Figure 2 In the illustrated embodiment, the server performs structured processing on the interface information of the first interface and the interface information of the second interface based on a unified format, obtaining structured information of the first interface and the second interface. Then, based on the structured information of the first interface and the second interface in the unified format, a target mapping relationship between the first interface and the second interface is established. Compared to manually establishing the target mapping relationship, the method provided in this application reduces the tedium and subjectivity of manual operations, thereby improving the efficiency of establishing the target mapping relationship and the accuracy of determining the target mapping relationship.
[0061] exist Figure 2 Based on the illustrated embodiment, the following, in conjunction with Figure 3 The method for determining the structured information of the first interface in the embodiments of this application will be further explained.
[0062] Figure 3 This is a schematic flowchart illustrating a process for determining structured information of a first interface, provided as an embodiment of this application. Figure 3 As shown, the process may include the following steps:
[0063] S301. Perform semantic analysis on the interface specification text of the first interface to determine the static rules of the first interface.
[0064] In some embodiments, the interface information of the first interface includes the interface specification text and the call data of the first interface. The interface specification text of the first interface may include, for example, the interface name, interface path, request method, request parameters, response parameters, data type, etc. of the first interface; the call data may include, for example, the request sample data and response sample data of the first interface.
[0065] The static rules of the first interface are used to indicate the inherent attributes and constraints of the first interface. In some embodiments, the server can input the interface specification text and the first instruction text of the first interface into the large model. The large model performs semantic analysis on the interface specification text of the first interface based on the first instruction text and outputs the static rules of the first interface.
[0066] S302. Perform syntax parsing on the call data of the first interface to determine the dynamic instance of the first interface.
[0067] The dynamic instance of the first interface is used to indicate the specific execution logic and call data instance of the first interface during the actual call process.
[0068] The server contains a parser, which processes the data, extracts key data, and converts unstructured key data into structured data that can be recognized by computers.
[0069] In some embodiments, the server may input request sample data and response sample data from the call data into a parser. The parser parses the request sample data and response sample data respectively, identifying the structural hierarchy and data type of the request sample data and the response sample data. The call instance includes the structural hierarchy and data type of both the request sample data and the response sample data.
[0070] Taking the response sample data as an example, the structural hierarchy of the response sample data is used to indicate the nesting relationship between objects and arrays in the response sample data; the data type of the response sample data may include, for example, string type, enumeration type, boolean type, etc.
[0071] S303. Determine the structured information of the first interface based on the static rules and dynamic instances of the first interface.
[0072] In some embodiments, the server may determine the structured information of the first interface in the following ways: determine whether the dynamic instance conforms to the static rules of the first interface; if the dynamic instance conforms to the static rules of the first interface, convert the format of the static rules of the first interface and the format of the dynamic instance into a preset format respectively to obtain the structured information of the first interface.
[0073] In some embodiments, the server can compare the call instances generated by the first interface during actual operation with the static rules defined in the design phase to determine whether the static rules of the first interface are accurate. Since the dynamic call data generated by the first interface during actual operation is based on the static rules, the accuracy of the static rules of the first interface can be determined by determining whether the call instances conform to the call rules of the first interface.
[0074] Specifically, the server can determine whether the data structure and data type in the calling instance conforms to the static rules of the first interface. If the data structure and data type in the calling instance do not conform to the static rules of the first interface, the static rules of the first interface are determined to be inaccurate; if the data structure and data type in the calling instance both conform to the static rules of the first interface, the static rules of the first interface are determined to be accurate.
[0075] For example, taking the data type of the response sample data as an example, assume that the data type of the "SystemName" parameter in the response sample data is a string, and the data type of the "PowerState" parameter is an enumeration type; wherein the data type of the "SystemName" parameter in the static rules of the first interface is a string, and the data type of the "PowerState" parameter is an enumeration type. If the server determines that the data type of the response sample data conforms to the static rules of the first interface, then the server determines that the static rules of the first interface are accurate.
[0076] If a dynamic instance does not conform to the static rules of the first interface, it means that the static rules of the first interface are inaccurate. In this case, the server can adjust the first instruction text and re-input the interface specification text of the first interface and the adjusted first instruction text into the large model to obtain the static rules of the first interface.
[0077] If the dynamic instance conforms to the static rules of the first interface, it means that the static rules of the first interface are accurate. At this time, the server converts the format of the static rules of the first interface and the format of the dynamic instance into the preset format respectively, thereby obtaining the structured information of the first interface with standardized format and complete information.
[0078] exist Figure 3In the illustrated embodiment, since the interface specification text of the first interface is represented in text form and the call data is represented in data form, the server processes the interface specification text and call data of the first interface in different ways to obtain the static rules and dynamic instances of the first interface. The server then compares and verifies the accuracy of the static rules by comparing and verifying the static rules, thereby improving the accuracy of the structured information of the first interface. Furthermore, the server determines the structured information of the first interface through automated parsing and format conversion, which improves the efficiency of determining the structured information of the first interface compared to manual determination.
[0079] In some embodiments, the interface information of the second interface includes the interface specification text of the second interface. The server can determine the structured information of the second interface in the following ways: perform semantic analysis on the interface specification text of the second interface to determine the static rules of the second interface; convert the format of the static rules of the second interface into a preset format to obtain the structured information of the second interface.
[0080] The interface specification text of the second interface may include, for example, the interface name, interface path, request method, request parameters, response parameters, and data types. The static rules of the second interface are used to indicate its inherent attributes and constraints.
[0081] The server can input the interface specification text and the second instruction text of the second interface into the large model. The large model performs semantic analysis on the interface specification text of the second interface based on the second instruction text and outputs the static rules of the second interface. Then, the server converts the format of the static rules of the second interface into a preset format according to a preset format, thereby obtaining the structured information of the second interface with a standardized format and complete information.
[0082] In some embodiments, the structured information of the second interface includes structured interface information and structured data information. The structured interface information indicates the interface definition of the second interface and may include, for example, the interface name, interface path, request method, request parameter structure, and response parameter structure of the second interface. The structured data information indicates the data specifications of the second interface and may include, for example, the name, attributes, data type, relationships between data, and constraint rules of the data in the second interface.
[0083] In the above embodiments, the server determines the structured information of the second interface through automated parsing and format conversion, which improves the efficiency of determining the structured information of the second interface compared to the method of manually determining the structured information of the second interface.
[0084] Based on the above embodiments, the following, in conjunction with Figure 4 The method of establishing the target mapping relationship in the embodiments of this application will be further explained.
[0085] Figure 4 This is a schematic diagram illustrating a process for establishing a target mapping relationship, provided as an embodiment of this application. Figure 4 As shown, the process may include the following steps:
[0086] S401. Based on the interface name of the first interface and the interface name of the second interface, determine the first mapping relationship between the interface name of the first interface and the interface name of the second interface.
[0087] In some embodiments, the structured information includes the interface name, interface path, request parameters, and response parameters.
[0088] The server determines the first mapping relationship as follows: Based on the interface name of the first interface, determine at least one first keyword of the first interface; based on the interface name of the second interface, determine at least one second keyword of the second interface; wherein, for any second keyword among the at least one second keyword, there exists a keyword corresponding to the second keyword among the at least one first keyword; based on the at least one first keyword and the at least one second keyword, determine the first matching degree between the interface name of the first interface and the interface name of the second interface; determine the similarity between the interface name of the first interface and the interface name of the second interface according to a similarity algorithm; if the first matching degree is greater than or equal to the first preset matching degree and the similarity is greater than or equal to the preset similarity, determine the interface name of the first interface as the interface name corresponding to the interface name of the second interface to establish the first mapping relationship.
[0089] In some embodiments, the first keyword is a core word in the interface name of the first interface, and the second keyword is a core word in the interface name of the second interface.
[0090] In some embodiments, for any one of the at least one first keyword, the server determines the keyword corresponding to the first keyword from at least one second keyword, and then compares the first keyword and the keyword corresponding to the first keyword to determine whether the first keyword and the keyword corresponding to the first keyword are the same. Then, the server determines the number of first keywords that are the same as the corresponding keyword among the at least one first keyword, and determines a first matching degree based on the number and the total number of the at least one first keyword.
[0091] For example, assuming the interface name of the first interface is "GetSystemInfo" and the interface name of the second interface is "GetComputerSystem", the server determines that at least one first keyword includes "Get", "System", and "Info"; the server determines that at least one first keyword includes "Get", "Computer", and "System". The server determines that the number of first keywords that are the same as the corresponding keywords is 2, and the total number of at least one first keyword is 3. Therefore, the first matching degree is determined to be 2 / 3.
[0092] In some embodiments, the similarity algorithm can be, for example, a cosine similarity algorithm. For instance, the server can use a cosine similarity algorithm to process the interface names of the first interface and the second interface, determining that the similarity between the interface names of the first interface and the second interface is 0.85.
[0093] For example, suppose the first matching degree is 2 / 3 and the similarity is 0.85, the first preset matching degree is 1 / 2 and the preset similarity is 0.8. Since the first matching degree is greater than or equal to the first preset matching degree and the similarity is greater than or equal to the preset similarity, the server determines that the interface name of the first interface is the interface name corresponding to the interface name of the second interface, thereby establishing a first mapping relationship between the interface name of the first interface and the interface name of the second interface.
[0094] S402. Based on the interface path of the first interface and the interface path of the second interface, determine the second mapping relationship between the interface path of the first interface and the interface path of the second interface.
[0095] In some embodiments, the server determines the second mapping relationship as follows: Based on the interface path of the first interface, at least one first path node of the first interface is determined; based on the interface path of the second interface, at least one second path node of the second interface is determined; wherein, for any second path node among the at least one second path node, the at least one first path node includes a path node corresponding to the second path node; based on the at least one first path node and the at least one second path node, a second matching degree is determined between the interface path of the first interface and the interface path of the second interface; if the second matching degree is greater than or equal to a second preset matching degree, the interface path of the first interface is determined as the interface path corresponding to the interface path of the second interface, thereby establishing the second mapping relationship.
[0096] The interface path is used to locate the access address of the interface resource when calling the interface. In some embodiments, the interface path includes at least one path node. The path node is the basic unit for splitting the interface path and performing hierarchical matching of the interface path.
[0097] Therefore, the server can split the interface path of the first interface to obtain at least one first path node, and split the interface path of the second interface to obtain at least one second path node. It should be noted that there is a one-to-one correspondence between the at least one first path node and the at least one second path node.
[0098] For example, assuming the interface path of the first interface is / redfish / v1 / Systems / 1 and the interface path of the second interface is / redfish / v1 / Systems / [ComputerSystemId], the server determines that at least one first path node includes redfish, v1, Systems, and 1, and at least one second path node includes redfish, v1, Systems, and ComputerSystemId. Specifically, the first path node redfish corresponds to the second path node redfish, the first path node v1 corresponds to the second path node v1, the first path node Systems corresponds to the second path node Systems, and the first path node 1 corresponds to the second path node ComputerSystemId.
[0099] In some embodiments, for any one of the at least one first path nodes, the server determines the path node corresponding to the first path node among at least one second path nodes, and then compares the first path node and the second path node corresponding to the first path node to determine whether the first path node and the path node corresponding to the first path node have the same function. Then, the server determines the number of first path nodes among the at least one first path nodes that have the same function as the corresponding path node, and determines a second matching degree based on the number and the total number of at least one first path nodes.
[0100] For example, suppose at least one first path node includes redfish, v1, Systems, and 1, and at least one second path node includes redfish, v1, Systems, and ComputerSystemId. The server determines that among the at least one first path node, the number of first path nodes with the same function as the corresponding path node is 4 (first path node 1 and second path node ComputerSystemId have the same function and are both placeholders), and the total number of at least one first path node is 4. Therefore, the server determines the second matching degree to be 100%. Assuming the second preset matching degree is 85%, the interface path of the server's first interface is the interface path corresponding to the interface path of the second interface, thereby establishing a second mapping relationship.
[0101] S403. Based on at least one request parameter of the first interface and at least one request parameter of the second interface, determine a third mapping relationship between at least one request parameter of the first interface and at least one request parameter of the second interface.
[0102] The task tag is used to indicate the task scenario to which the request parameters apply.
[0103] In some embodiments, the server determines the third mapping relationship as follows: For each request parameter of the first interface among at least one request parameter of the first interface, the following operations are performed: Based on the data type of the request parameter of the first interface and the data type of each of the at least one request parameter of the second interface, at least one candidate request parameter is determined from the at least one request parameter of the second interface; wherein the data type of each of the at least one candidate request parameter is the same as the data type of the request parameter of the first interface; Based on the task label of the request parameter of the first interface and the task label of each of the at least one candidate request parameter, a target request parameter is determined from the at least one candidate request parameter; The target request parameter is determined as the request parameter corresponding to the request parameter of the first interface to establish the third mapping relationship.
[0104] For example, suppose that at least one request parameter of the first interface includes request parameter 1, and at least one request parameter of the second interface includes request parameter 2, request parameter 3, and request parameter 4. Wherein, the data type of request parameter 1 is an enumeration type, the data type of request parameter 2 is an enumeration string type, the data type of request parameter 3 is an enumeration type, and the data type of request parameter 4 is a string type, then the server determines that at least one candidate request parameter includes request parameter 2 and request parameter 3.
[0105] Suppose that the task label for request parameter 1 indicates that request parameter 1 applies to task A, the task label for request parameter 2 indicates that request parameter 2 applies to task A, and the task label for request parameter 3 indicates that request parameter 3 applies to task B. Then, the server determines that the target request parameter is request parameter 2 from at least one candidate request. The server then identifies request parameter 2 as the request parameter corresponding to request parameter 1, thereby establishing a third mapping relationship.
[0106] In some embodiments, the server may also determine at least one candidate request parameter by combining the function of the request parameter, and determine the target request parameter from at least one candidate request parameter by combining the constraints of the request parameter.
[0107] S404. Based on at least one response parameter of the first interface and at least one response parameter of the second interface, determine a fourth mapping relationship between at least one response parameter of the first interface and at least one response parameter of the second interface.
[0108] In some embodiments, the server determines the fourth mapping relationship as follows: determining the data level of each of at least one response parameter of the first interface and the data level of each of at least one response parameter of the second interface; for each response parameter of the first interface among the at least one response parameter of the first interface, performing the following operations: comparing the response parameter of the first interface with the at least one response parameter of the second interface according to the data level of the response parameter of the first interface and the data level of each of the at least one response parameter of the second interface, and determining the target response parameter among the at least one response parameter of the second interface; determining the target response parameter as the response parameter corresponding to the response parameter of the first interface, so as to establish the fourth mapping relationship.
[0109] For example, suppose that at least one response parameter of the first interface includes response parameter 1, and at least one response parameter of the second interface includes response parameter 2, wherein both response parameter 1 and response parameter 2 have data levels of level a and level b. For response parameter 2, the server determines whether the data type and data function of response parameter 1 at level a are consistent with the data type and data function of response parameter 2 at level a; the server also determines whether the data type and data function of response parameter 1 at level b are consistent with the data type and data function of response parameter 2 at level b.
[0110] If the data type and data function of response parameter 1 in layer a are consistent with those of response parameter 2 in layer a, and the data type and data function of response parameter 1 in layer b are consistent with those of response parameter 2 in layer b, the server will determine response parameter 2 as the response parameter corresponding to response parameter 1, thereby determining the fourth mapping relationship.
[0111] The target mapping relationship includes the first mapping relationship, the second mapping relationship, the third mapping relationship, and the fourth mapping relationship.
[0112] exist Figure 4 In the illustrated embodiment, the server performs structured processing on the interface information of the first interface and the interface information of the second interface based on a unified format, obtaining structured information of the first interface and the second interface. Then, based on the structured information of the first interface and the second interface in the unified format, a target mapping relationship between the first interface and the second interface is established. Compared to manually establishing the target mapping relationship, the method provided in this application reduces the tedium and subjectivity of manual operations, thereby improving the efficiency of establishing the target mapping relationship and the accuracy of determining the target mapping relationship.
[0113] In some embodiments, after establishing the target mapping relationship, the server can test the target mapping relationship using test cases to determine its accuracy.
[0114] Specifically, the server can build a test case set, which includes normal function test cases, abnormal scenario test cases, and boundary condition test cases. The normal function test cases verify whether, under normal request conditions, the first interface and the second interface can transmit data through the target mapping relationship. The abnormal scenario test cases verify whether the server can identify the above problems and generate response prompts based on the target mapping relationship when the first interface returns an abnormal response or the request parameters are incomplete. The boundary condition test cases verify the accuracy and stability of the data transmission between the first and second interfaces based on the automatic mapping relationship when request parameters are de-optimized or the response data contains a large number of nested structures.
[0115] In some embodiments, when executing test cases, the server determines whether the target mapping relationship meets the requirements based on the actual output results and the expected results.
[0116] If the target mapping relationship meets the requirements, the verification test is considered passed, and the server applies the target mapping relationship to the data transmission between the first interface and the second interface. If the target mapping relationship does not meet the requirements, the verification test is considered to have failed, and the server analyzes the reason for the test failure.
[0117] In some embodiments, if the test fails because the mapping rules in the target mapping relationship are incomplete, resulting in matching errors or data conversion errors, the server can correct and optimize the target mapping relationship. For example, the server can adjust the first preset matching degree, preset similarity degree, and second preset matching degree, improve the parameter matching rules, and supplement the data structure conversion rules.
[0118] In some embodiments, if the test fails because the interface information of the first interface is incomplete, the server can reprocess the interface information of the first interface.
[0119] After optimizing the target mapping relationship using the above method, re-execute the test cases to verify the target mapping relationship until the verification test passes.
[0120] In summary, the process by which the server determines the target mapping relationship can be as follows: Figure 5 As shown, Figure 5 This is a schematic diagram illustrating yet another method for determining a target mapping relationship, provided in an embodiment of this application. For example... Figure 5 As shown, the server obtains the interface information of the first interface, then parses the interface information of the first interface to determine the structured information of the first interface; the server obtains the interface information of the second interface, then parses the interface information of the second interface to determine the structured information of the second interface.
[0121] Then, the server determines the target mapping relationship based on the structured information of the first interface and the structured information of the second interface, and performs a verification test on the target mapping relationship. After the target mapping relationship passes the verification test, it is determined that the target mapping relationship can be applied to the data transmission task between the first interface and the second interface.
[0122] In some embodiments, after determining the target mapping relationship between the first interface and the second interface, the server stores the target mapping relationship in the server's database for subsequent querying, retrieval, and maintenance of the target mapping relationship.
[0123] In some embodiments, after determining the target mapping relationship between the first interface and the second interface, the server can apply the target mapping relationship to the data transmission task between the first interface and the second interface. It should be noted that the target mapping relationship can be applied to the data transmission task between the first interface and the second interface of any server. Below, we will take a business server, distinct from the main server, as the execution entity, in conjunction with... Figure 6 This paper introduces how the business server uses target mapping relationships to implement data transmission between the first interface and the second interface.
[0124] Figure 6 This is a schematic diagram illustrating a data transmission process between a first interface and a second interface, provided as an embodiment of this application. Figure 6 As shown, the process may include the following steps:
[0125] S601. The business server determines the target second interface that matches the first interface based on the first mapping relationship and the second mapping relationship.
[0126] In some embodiments, the service server includes a first interface and at least one second interface. The service server determines the interface information of the first interface and, based on a first mapping relationship and a second mapping relationship, determines a target second interface that matches the first interface among the at least one second interface.
[0127] In some embodiments, if there are multiple second interfaces that match the first interface, the business server determines the matching degree between the second interface and the first interface for any one of the multiple second interfaces. Specifically, the business server determines the matching degree of the second interface with the first interface in terms of interface name, interface path, request parameter, and response parameter, and performs a weighted calculation on the matching degree of the interface name, interface path, request parameter, and response parameter to determine the matching degree between the second interface and the first interface.
[0128] For example, assuming that the interface name matching degree of the second interface is 50%, the interface path matching degree is 80%, the request parameter matching degree is 70%, and the response parameter matching degree is 65%, then the matching degree between the second interface and the first interface is determined to be: 50%*0.4+80%*0.3+70%*0.2+65%*0.1=0.645.
[0129] In some embodiments, the service server determines the second interface with the highest matching degree among at least one second interface as the target second interface.
[0130] In some embodiments, if at least one second interface does not include a second interface that matches the first interface, the service server generates a prompt message, which is used to record the interface information of the first interface.
[0131] S602. The business server converts the request parameters of the first interface into first request parameters adapted to the target second interface according to the third mapping relationship.
[0132] When the business server determines the target second interface and sends request parameters to the second interface through the first interface, it converts the request parameters of the first interface into first request parameters adapted to the target second interface according to the third mapping relationship. Specifically, the business server replaces the parameter names and parameter types of the request parameters of the first interface according to the third mapping relationship. In addition, the business server supplements the required parameters (if the request parameters of the first interface are missing, if the parameter has a default value, the business server determines the default value as the required parameter; if the parameter does not have a default value, the business server generates a parameter confirmation prompt) and custom parameters (the business server fills in the custom parameters according to the third mapping rule), thus obtaining the first request parameters.
[0133] S603, The first interface sends the first request parameter to the second interface.
[0134] S604. After receiving the first request parameters, the target second interface sends response parameters to the first interface.
[0135] S605. After receiving the response parameters, the service server converts the response parameters into first response parameters adapted to the first interface according to the fourth mapping relationship.
[0136] After receiving the response parameters, the first interface parses the response parameters according to the fourth mapping relationship to determine the data information of the response parameters. Then, it transforms the data information into the first response parameters based on the fourth mapping relationship. Specifically, the data information includes the parameter name, parameter structure, and relationships of the response parameters. The business server can replace the parameter names, adjust the parameter structures, and organize the relationships according to the fourth mapping relationship to obtain the first response parameters.
[0137] Figure 7 This is a schematic diagram of an interface mapping device provided in an embodiment of this application. Figure 7 As shown, embodiments of this application also provide an interface mapping device 70, which includes an acquisition module 71, a first determination module 72, a second determination module 73, and a processing module 74, wherein:
[0138] The acquisition module 71 is used to acquire the interface information of the first interface; the interface standard of the first interface is different from the preset standard; the interface information of the first interface is used to indicate the attribute information and interaction rules of the first interface;
[0139] The first determining module 72 is used to parse the interface information of the first interface and determine the structured information of the first interface;
[0140] The second determining module 73 is used to parse the interface information of the second interface and determine the structured information of the second interface; wherein, the interface standard of the second interface is a preset standard, the interface information of the second interface is used to indicate the attribute information and interaction rules of the second interface, and the data format of the structured information of the first interface is the same as the data format of the structured information of the second interface.
[0141] The processing module 74 is used to establish a target mapping relationship between the first interface and the second interface based on the structured information of the first interface and the structured information of the second interface; the target mapping relationship is used to realize data transmission between the first interface and the second interface.
[0142] In one possible implementation, the interface information of the first interface includes the interface specification text and call data of the first interface, and the first determining module 72 is specifically used for:
[0143] Perform semantic analysis on the interface specification text of the first interface to determine the static rules of the first interface;
[0144] Perform syntax parsing on the call data of the first interface to determine the dynamic instance of the first interface;
[0145] Based on the static rules and dynamic instances of the first interface, determine the structured information of the first interface.
[0146] In one possible implementation, the first determining module 72 is specifically used for:
[0147] Determine whether the dynamic instance conforms to the static rules of the first interface;
[0148] If the dynamic instance conforms to the static rules of the first interface, the format of the static rules of the first interface and the format of the dynamic instance are converted into the preset format respectively to obtain the structured information of the first interface.
[0149] In one possible implementation, the interface information of the second interface includes the interface specification text of the second interface, and the second determining module 73 is specifically used for:
[0150] Perform semantic analysis on the interface specification text of the second interface to determine the static rules of the second interface;
[0151] The static rules of the second interface are converted into a preset format to obtain the structured information of the second interface.
[0152] In one possible implementation, the structured information includes an interface name, an interface path, at least one request parameter, and at least one response parameter; the processing module 74 is specifically used for:
[0153] Based on the interface name of the first interface and the interface name of the second interface, determine the first mapping relationship between the interface name of the first interface and the interface name of the second interface;
[0154] Based on the interface path of the first interface and the interface path of the second interface, determine the second mapping relationship between the interface path of the first interface and the interface path of the second interface.
[0155] Based on at least one request parameter of the first interface and at least one request parameter of the second interface, a third mapping relationship is determined between at least one request parameter of the first interface and at least one request parameter of the second interface.
[0156] Based on at least one response parameter of the first interface and at least one response parameter of the second interface, a fourth mapping relationship is determined between at least one response parameter of the first interface and at least one response parameter of the second interface.
[0157] The target mapping relationship includes the first mapping relationship, the second mapping relationship, the third mapping relationship, and the fourth mapping relationship.
[0158] In one possible implementation, the processing module 74 is specifically used for:
[0159] Based on the interface name of the first interface, determine at least one first keyword for the first interface;
[0160] Based on the interface name of the second interface, determine at least one second keyword for the second interface; wherein, for any one of the at least one second keyword, there exists a keyword corresponding to the second keyword among at least one first keyword;
[0161] Based on at least one first keyword and at least one second keyword, determine the first matching degree between the interface name of the first interface and the interface name of the second interface;
[0162] The similarity between the interface name of the first interface and the interface name of the second interface is determined based on a similarity algorithm.
[0163] If the first matching degree is greater than or equal to the first preset matching degree and the similarity is greater than or equal to the preset similarity, the interface name of the first interface is determined as the interface name corresponding to the interface name of the second interface, so as to establish the first mapping relationship.
[0164] In one possible implementation, the processing module 74 is specifically used for:
[0165] Based on the interface path of the first interface, determine at least one first path node of the first interface;
[0166] Based on the interface path of the second interface, at least one second path node of the second interface is determined; wherein, for any second path node among the at least one second path node, at least one first path node includes the path node corresponding to the second path node.
[0167] Based on at least one first path node and at least one second path node, determine a second matching degree between the interface path of the first interface and the interface path of the second interface;
[0168] If the second matching degree is greater than or equal to the second preset matching degree, the interface path of the first interface is determined as the interface path corresponding to the interface path of the second interface, so as to establish a second mapping relationship.
[0169] In one possible implementation, the processing module 74 is specifically used for:
[0170] For each request parameter of the first interface in at least one request parameter of the first interface, perform the following operations:
[0171] Based on the data type of the request parameters of the first interface and the data type of each of the at least one request parameters of the second interface, at least one candidate request parameter is determined from the at least one request parameter of the second interface; wherein the data type of each of the at least one candidate request parameter is the same as the data type of the request parameter of the first interface.
[0172] Based on the task label of the request parameter of the first interface and the task labels of at least one candidate request parameter, determine the target request parameter from at least one candidate request parameter;
[0173] The target request parameters are determined to be the request parameters corresponding to the request parameters of the first interface, so as to establish a third mapping relationship.
[0174] In one possible implementation, the processing module 74 is specifically used for:
[0175] Determine the data level of at least one response parameter of the first interface and the data level of at least one response parameter of the second interface;
[0176] For each response parameter of the first interface, at least one of the response parameters of the first interface, perform the following operations:
[0177] Based on the data level of the response parameters of the first interface and the data level of at least one response parameter of the second interface, the response parameters of the first interface and at least one response parameter of the second interface are compared respectively, and the target response parameter is determined from at least one response parameter of the second interface.
[0178] The target response parameter is determined to be the response parameter corresponding to the response parameter of the first interface, so as to establish the fourth mapping relationship.
[0179] For a description of the features in the embodiment corresponding to the interface mapping device 70, please refer to the relevant description in the embodiment corresponding to the interface mapping method, which will not be repeated here.
[0180] Figure 8 A schematic diagram of the structure of the electronic device provided in this application. Figure 8 As shown, the electronic device 80 provided in this embodiment includes at least one processor 801 and a memory 802. Optionally, the electronic device 80 further includes a communication component 803. The processor 801, memory 802, and communication component 803 are connected via a bus.
[0181] In a specific implementation, at least one processor 801 executes computer execution instructions stored in memory 802, causing at least one processor 801 to execute the interface mapping method embodiment described above.
[0182] The specific implementation process of processor 801 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.
[0183] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the application can be directly manifested as being executed by a hardware processor, or executed by a combination of hardware and software modules within the processor.
[0184] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.
[0185] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0186] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above-described interface mapping method embodiments at runtime.
[0187] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.
[0188] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above-described interface mapping method embodiments.
[0189] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the interface mapping method embodiments described above.
[0190] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0191] The interface mapping method and electronic device provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only for the purpose of helping to understand the method and its core ideas. It should be noted that those skilled in the art can make several improvements and modifications to this application without departing from the principles of this application, and these improvements and modifications also fall within the protection scope of the claims of this application.
Claims
1. A Redfish API interface mapping method, characterized by, The method comprises: obtaining interface information of a first interface; the interface standard of the first interface is different from a preset standard; the interface information of the first interface is used to indicate attribute information and interaction rules of the first interface; parsing the interface information of the first interface to determine structured information of the first interface; parsing interface information of a second interface to determine structured information of the second interface; wherein the interface standard of the second interface is the preset standard, the interface information of the second interface is used to indicate attribute information and interaction rules of the second interface, and the data format of the structured information of the first interface is the same as the data format of the structured information of the second interface; establishing a target mapping relationship between the first interface and the second interface according to the structured information of the first interface and the structured information of the second interface; the target mapping relationship is used to realize data transmission between the first interface and the second interface; the structured information comprises an interface name, an interface path, at least one request parameter and at least one response parameter; the target mapping relationship comprises a first mapping relationship between the interface name of the first interface and the interface name of the second interface, a second mapping relationship between the interface path of the first interface and the interface path of the second interface, a third mapping relationship between at least one request parameter of the first interface and at least one request parameter of the second interface, and a fourth mapping relationship between at least one response parameter of the first interface and at least one response parameter of the second interface; establishing the target mapping relationship between the first interface and the second interface according to the structured information of the first interface and the structured information of the second interface comprises: determining at least one first keyword of the first interface according to the interface name of the first interface; determining at least one second keyword of the second interface according to the interface name of the second interface; wherein for any second keyword in the at least one second keyword, there is a keyword corresponding to the second keyword in the at least one first keyword; determining a first matching degree between the interface name of the first interface and the interface name of the second interface according to the at least one first keyword and the at least one second keyword; determining a similarity between the interface name of the first interface and the interface name of the second interface according to a similarity algorithm; in a case where the first matching degree is greater than or equal to a first preset matching degree and the similarity is greater than or equal to a preset similarity, determining the interface name of the first interface as an interface name corresponding to the interface name of the second interface to establish the first mapping relationship; determining at least one first path node of the first interface according to the interface path of the first interface; determining at least one second path node of the second interface according to the interface path of the second interface; wherein for any second path node in the at least one second path node, there is a path node corresponding to the second path node in the at least one first path node; determine a second matching degree between the interface path of the first interface and the interface path of the second interface according to the at least one first path node and the at least one second path node; determine the interface path of the first interface as the interface path corresponding to the interface path of the second interface to establish the second mapping relationship in a case where the second matching degree is greater than or equal to a second preset matching degree; for each request parameter of the first interface in the at least one request parameter of the first interface, perform the following operations: determine at least one candidate request parameter in the at least one request parameter of the second interface according to the data type of the request parameter of the first interface and the data type of each of the at least one request parameter of the second interface, wherein the data type of each of the at least one candidate request parameter is the same as the data type of the request parameter of the first interface; determine a target request parameter in the at least one candidate request parameter according to the task label of the request parameter of the first interface and the task label of each of the at least one candidate request parameter; determine the target request parameter as the request parameter corresponding to the request parameter of the first interface to establish the third mapping relationship; determine the data level of each of the at least one response parameter of the first interface and the data level of each of the at least one response parameter of the second interface; for each response parameter of the first interface in the at least one response parameter of the first interface, perform the following operations: respectively compare the response parameter of the first interface and the at least one response parameter of the second interface according to the data level of the response parameter of the first interface and the data level of each of the at least one response parameter of the second interface, and determine a target response parameter in the at least one response parameter of the second interface; determine the target response parameter as the response parameter corresponding to the response parameter of the first interface to establish the fourth mapping relationship.
2. The method of claim 1, wherein, The interface information of the first interface includes interface specification text and calling data of the first interface; and the parsing of the interface information of the first interface to determine the structured information of the first interface includes: performing semantic analysis processing on the interface specification text of the first interface to determine the static rule of the first interface; performing syntax analysis processing on the calling data of the first interface to determine the dynamic instance of the first interface; determining the structured information of the first interface according to the static rule of the first interface and the dynamic instance.
3. The method of claim 2, wherein, The determining of the structured information of the first interface according to the static rule of the first interface and the dynamic instance includes: determining whether the dynamic instance conforms to the static rule of the first interface; in a case where the dynamic instance conforms to the static rule of the first interface, respectively converting the format of the static rule of the first interface and the format of the dynamic instance into a preset format to obtain the structured information of the first interface.
4. The method according to any one of claims 1 to 3, characterized in that, The interface information of the second interface includes interface specification text of the second interface, the interface information of the second interface is parsed, and structured information of the second interface is determined, including: The interface specification text of the second interface is subjected to semantic analysis processing, and static rules of the second interface are determined; The format of the static rules of the second interface is converted into a preset format, and the structured information of the second interface is obtained.
5. An electronic device, comprising: Comprising: A memory for storing a computer program; A processor for executing the computer program to implement the steps of the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Interface docking method and device, storage medium and electronic equipment
CN116091212A