Interface calling method and device, equipment and storage medium

By introducing the association between business scenario pages and structure definition pages into the interface document, the problem of the lack of scenario description in the existing interface document is solved, and the convenience and efficiency of interface calls are achieved.

CN119883440APending Publication Date: 2025-04-25CHINA CONSTRUCTION BANK +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411963700.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

The existing interface documents lack scenario description, which makes it difficult for interface callers to quickly locate and understand the usage methods of target interfaces in different business scenarios, which in turn affects the convenience and efficiency of interface calls.

Method used

Provides an interface call method by obtaining the interface document of the target interface, which includes a business scenario page and a structure definition page. The business scenario page describes the application scenario of the target interface and defines the page through the tab map related structure, thereby helping the caller quickly locate and call the target interface.

Benefits of technology

Through scenario-based interface documents, callers can quickly match and call target interfaces, improving the convenience and efficiency of interface calls and reducing the workload of tests and developers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119883440A_ABST
    Figure CN119883440A_ABST
Patent Text Reader

Abstract

The invention provides an interface calling method and device, equipment and a storage medium, and relates to the technical field of computers. The method comprises the steps of obtaining an interface document corresponding to a target interface; the interface document comprises a business scene page and at least one structure definition page; the business scene page comprises at least one business scene applied by the target interface and scene description and tab mapping of each business scene; wherein the tab mapping is associated with at least one structure definition page; determining a service scene of which the scene description is matched with the calling scene of the target interface from the at least one service scene; determining a structure definition page corresponding to the target interface according to tab mapping corresponding to the matched service scene; and calling the target interface through the structure definition page corresponding to the target interface. By adopting the method, the convenience of interface calling can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to an interface calling method, device, equipment and storage medium. Background Art

[0002] Interface documentation is human- and machine-readable technical content that explains the working principles and functions of a specific Application Programming Interface (API). It explains the detailed information such as functions, parameters, and classes included in the API in a structured format, making it easier for developers and non-technical users to understand and helping users better understand how different parts work together.

[0003] For example, in daily development and testing, when testers and developers need to connect to interface fields, they usually need to use interface documents. Interface documents are generally provided by the interface developers, with no restrictions on the format, no regulatory constraints, and poor versatility. Currently, interface documents only define the basic information of the interface, and do not reflect the scenarios of the interface. The definition is relatively flat, which is not convenient for interface callers and interface testers to call the interface. Summary of the invention

[0004] The present application provides an interface calling method, apparatus, device and storage medium to improve the convenience of interface calling.

[0005] In a first aspect, the present application provides an interface calling method, the method comprising:

[0006] Obtain an interface document corresponding to a target interface; the interface document includes a business scenario page and at least one structure definition page; the business scenario page includes at least one business scenario applied by the target interface and a scenario description and a tab mapping of each business scenario; wherein the tab mapping is associated with the at least one structure definition page;

[0007] Determining, from the at least one business scenario, a business scenario whose scenario description matches the calling scenario of the target interface;

[0008] Determine the structure definition page corresponding to the target interface according to the tab mapping corresponding to the matched business scenario;

[0009] The target interface is called through the structure definition page corresponding to the target interface.

[0010] When there is a need to call an interface, first obtain the interface, that is, the interface document of the target interface. The interface document of the target interface provided in this application includes not only the scenarios in which the target interface is applied, but also the structure definition page corresponding to the target interface in each application scenario. The tab mapping in the business scenario page is associated with the structure definition page. The calling scenario of the target interface is matched with the scenario description in the business scenario page, and the structure definition page corresponding to the target interface in the calling scenario can be quickly located, and then the call to the target interface is realized through the structure definition page corresponding to the target interface. According to the above content, it can be known that each business scenario in at least one business scenario in which the target interface is applied in this application has a corresponding structure definition page. The business scenario page plays the role of a "directory". According to the scenario description in the business scenario page and the calling scenario of the target interface, the corresponding structure definition page can be quickly located to realize the call to the target interface, thereby improving the convenience and efficiency of calling the target interface.

[0011] In a possible design, for any one of the at least one structure definition page, the structure definition page includes a name of each data item, a value of each data item, and an example message field, and the structure definition page also provides a message generation button;

[0012] The method further comprises:

[0013] After the message generation button is triggered, a message corresponding to the structure definition page is generated according to the name of each data item and the value of each data item, and the message corresponding to the structure definition page is displayed in the sample message field.

[0014] Each structure definition page includes the name and value of each data item of the target interface. After triggering the message generation button in the structure definition page, the message corresponding to the current structure definition page can be automatically generated according to the name and value of each data item, without the interface caller (such as interface tester) manually constructing the message for testing, which reduces the workload of the tester and improves the testing efficiency. After the message is generated, the message is displayed in the sample message field, so that the interface caller can intuitively see the generated message, improving the experience.

[0015] In a possible design, before triggering the message generation button, the process further includes:

[0016] Selecting a target message type from the optional message types; the optional message types include JavaScript object representation JSON format type and extensible markup language XML format type;

[0017] Generate a message corresponding to the structure definition page, including:

[0018] According to the target message type, a message corresponding to the structure definition page is generated.

[0019] This application provides two optional message types when generating messages according to the names and values ​​of each data item, namely, JSON format type and XML format type. Before triggering the message generation button, you can select the target message type from these two optional message types so as to generate a message according to the target message type.

[0020] In a possible design, the structure definition page further includes the type of each data item and the value range of each data item, and the structure definition page also provides a check button;

[0021] Before triggering the message generation button, the method further includes:

[0022] Receiving value input for each of the data items, thereby obtaining the value of each of the data items;

[0023] After the verification button is triggered, the value of each data item is verified according to the type of each data item and the value range of each data item.

[0024] In addition to the name and value of each data item, the structure definition page also includes the type and value range of each data item, for example, whether the data item should be a string type or an integer type, the range of the string length, etc.; in addition, the structure definition page also provides a check button. After the check button is triggered, the value of the data item is checked according to the type and value range of the data item, so as to facilitate timely discovery and correction of errors in the value of the data item, thereby ensuring the accuracy of the structure definition page; and before triggering the message button, the values ​​of each data item on the structure definition page are checked first, and the message is generated based on the accurate structure definition page, thereby also ensuring the accuracy of the generated message.

[0025] In a possible design, the calling of the target interface through the structure definition page corresponding to the target interface includes:

[0026] Implementing a test of the target interface according to the message corresponding to the structure definition page; and / or completing a program code for calling the target interface according to the message corresponding to the structure definition page.

[0027] Whether testing the target interface or coding other business functions based on the target interface, the messages on the structure definition page can provide help. Testers can directly input messages as test messages into test cases for testing, avoiding manual construction of test messages, improving the degree of automation of interface testing, and thus improving testing efficiency; developers can use messages as references to avoid errors in writing programs related to the target interface and improve coding accuracy.

[0028] In a possible design, the interface document corresponding to the target interface is generated by the developer of the target interface by filling in an Excel document according to a preset registration document; the preset registration document includes registration requirements for each data item in the target interface.

[0029] The interface document of the target interface is generated by the developer of the target interface by filling in the Excel document. Excel is a commonly used software in daily work. Therefore, the learning cost for the developer of the target interface to fill in the relevant information of the target interface in the Excel document is low, which improves the efficiency of generating the interface document. Moreover, the developer of the target interface refers to the preset registration document when filling in the document to ensure that the content of the filled-in data items meets the registration requirements of each data item in the preset registration document, thereby ensuring the accuracy and standardization of the interface document.

[0030] In a second aspect, the present application further provides an interface calling device, the device comprising: a processing unit and a transceiver unit;

[0031] The transceiver unit is used to obtain an interface document corresponding to the target interface; the interface document includes a business scenario page and at least one structure definition page; the business scenario page includes at least one business scenario applied by the target interface and a scenario description and a tab mapping of each business scenario; wherein the tab mapping is associated with the at least one structure definition page;

[0032] The processing unit is used to determine, from the at least one business scenario, a business scenario whose scenario description matches the calling scenario of the target interface;

[0033] The processing unit is further used to determine the structure definition page corresponding to the target interface according to the tab mapping corresponding to the matched business scenario;

[0034] The processing unit is further used to implement the call to the target interface through the structure definition page corresponding to the target interface.

[0035] In a possible design, for any one of the at least one structure definition page, the structure definition page includes a name of each data item, a value of each data item, and an example message field, and the structure definition page also provides a message generation button;

[0036] The processing unit is used to generate a message corresponding to the structure definition page according to the name of each data item and the value of each data item after triggering the message generation button, and display the message corresponding to the structure definition page in the example message field.

[0037] In a possible design, the processing unit is further used to select a target message type from optional message types before triggering the message generation button; the optional message types include JavaScript object representation JSON format type and extensible markup language XML format type; the processing unit is specifically used to generate a message corresponding to the structure definition page according to the target message type.

[0038] In a possible design, the structure definition page further includes the type of each data item and the value range of each data item, and the structure definition page also provides a check button;

[0039] The transceiver unit is further used to receive value input for each data item, so as to obtain the value of each data item;

[0040] The processing unit is further configured to verify the values ​​of the data items according to the types of the data items and the value ranges of the data items after the verification button is triggered.

[0041] In one possible design, the processing unit is specifically used to implement testing of the target interface according to the message corresponding to the structure definition page; and / or, to complete the program coding of the target interface call according to the message corresponding to the structure definition page.

[0042] In a possible design, the interface document corresponding to the target interface is generated by the developer of the target interface by filling in an Excel document according to a preset registration document; the preset registration document includes registration requirements for each data item in the target interface.

[0043] In a third aspect, the present application further provides an interface calling device, the device comprising: a processor, and a memory communicatively connected to the processor;

[0044] The memory stores computer-executable instructions;

[0045] The processor executes the computer-executable instructions stored in the memory to implement the method described in the first aspect above.

[0046] In a fourth aspect, the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium includes a program, and when the program is executed on a device, the device executes the method as described in any one of the above-mentioned first aspects.

[0047] In a fifth aspect, the present application further provides a computer program product, wherein the computer program product comprises a computer program, and when the computer program is executed by a processor, the method described in the first aspect is implemented. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0049] Figure 1 A schematic diagram of the interface calling method flow provided in the embodiment of the present application;

[0050] Figure 2 A schematic diagram of a structure definition page provided in an embodiment of the present application;

[0051] Figure 3 Schematic diagram of the structure of the interface calling device provided in the embodiment of the present application Figure 1 ;

[0052] Figure 4 Schematic diagram of the structure of the interface calling device provided in the embodiment of the present application Figure 2 . DETAILED DESCRIPTION

[0053] In order to make the purpose, technical scheme and advantages of the present application clearer, the technical scheme in the embodiment of the present application will be clearly and completely described below in conjunction with the drawings in the embodiment of the present application. Obviously, the described embodiment is only a part of the embodiment of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application. In the absence of conflict, the embodiments in the present application and the features in the embodiments can be arbitrarily combined with each other. In addition, although the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in an order different from that here.

[0054] The terms "first" and "second" in the specification and claims of the present application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the term "comprising" and any of their variations are intended to cover non-exclusive protection. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices. "Multiple" in the present application can mean at least two, for example, two, three or more, and the embodiments of the present application are not limited.

[0055] The following is a description of exemplary embodiments of the present application in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding, which should be considered as merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of the present application. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description. It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, which should be considered as exemplary, and their purpose is only to illustrate the feasibility of the implementation of the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.

[0056] In the technical solution of this application, the acquisition, transmission, storage, and use of data are in compliance with the requirements of relevant national laws and regulations.

[0057] Defining a good interface document plays a very important role in the enterprise R&D process. Before testing the interface, the tester first needs to obtain the interface document of the interface, and then write test cases according to the interface document to carry out the testing work. An excellent interface document can help optimize the workflow and improve the work efficiency of the tester.

[0058] However, when writing interface documents, different interface developers have different writing habits, or they write according to different writing specifications, resulting in multiple standards and styles of interface documents. For example, the commonly used interface document writing specifications are as follows:

[0059] ①OpenAPI specification: previously known as Swagger, it is also the most popular API documentation specification, supported by many companies such as Microsoft and Google. OpenAPI is written in JavaScript Object Notation (JSON) or Yet Another Markup Language (YAML);

[0060] ②Blueprint specification: Blueprint specification is mainly used to define and describe the various components of the application, describing how the components are instantiated and connected together to form a running application;

[0061] ③Eolink specification: Interface documentation in the form of services can change synchronously with code changes, thereby reducing the communication costs between testers and developers.

[0062] If the interface document does not have a unified specification or standard, then the tester needs to spend a long time to adapt when reading the interface document, and the test efficiency is low. In order to improve the convenience of testers reading or calling interface documents, this application proposes an interface calling method, such as Figure 1 As shown, the execution subject of the method can be a server, a chip in the server, or a functional module in the server, and this application does not limit this. The following is an example of the execution subject being a server. The method includes:

[0063] Step 101: Obtain an interface document corresponding to a target interface; the interface document includes a business scenario page and at least one structure definition page; the business scenario page includes at least one business scenario applied by the target interface and a scenario description and tab mapping for each business scenario; wherein the tab mapping is associated with at least one structure definition page.

[0064] Exemplarily, the interface document corresponding to the target interface is generated by the developer of the target interface in an Excel document according to the preset registration document, and is filled in based on an Excel macro. When processing Excel cells, the macro provides a variety of assignment and reference methods. Users can directly assign variables or constants to cells, or use formula assignment. By using Excel macros, office efficiency can be significantly improved and workflows can be optimized. In addition, since Excel documents are commonly used office software in daily work, the developer of the target interface has a low learning cost when filling in the target interface related content in the Excel document, which can improve the generation efficiency of the interface document of the target interface.

[0065] For example, different companies often have different business development processes, and have different requirements for the data items included in the registration interface. The data items included in the interface can also be called fields. For example, take the export interface of the employee working hours of company A as an example, assuming that the data items included in the interface are as shown in Table 1:

[0066]

[0067]

[0068] Table 1

[0069] According to Table 1, the interface includes six data items: name, employee number, working hours, off-get off work time, and working hours. The employee number of enterprise A is 5 digits long and the date format is required to be "yyyy-mm--dd". However, in some enterprises, the employee number is 10 digits long and the date format is required to be "yyyy / mm / dd". In order to ensure that the data items included in the registered interface meet the business requirements of the enterprise when the enterprise developers register the interface, and to ensure the uniformity and standardization of the interface, the developers should follow the enterprise's interface registration document when registering the interface.

[0070] Exemplarily, the preset registration document in the present application includes registration requirements for each data item in the target interface, such as requirements for the name of the data item, requirements for the type of the data item, and requirements for the value range of the data item.

[0071] For example, the same interface may be called in multiple business scenarios. For example, still taking the export interface of employee working hours as an example, this interface may be called in the business scenario of counting employee daily working hours, or in the scenario of employee performance appraisal... The business scenario page included in the interface document of the target interface summarizes all the business scenarios in which the target interface may be called. Each of these multiple business scenarios consists of a scenario description and a tab mapping. The scenario description helps the target interface caller understand the scenario in which the target interface is applied through a concise and clear expression, and the tab mapping indicates the structure definition page corresponding to the target interface in the current business scenario. For the business scenario page, please refer to Table 2:

[0072]

[0073] Table 2

[0074] Based on Table 2, a possible example of a business scenario page corresponding to the export interface of the employee working hours of Enterprise A can be found in Table 3:

[0075]

[0076] Table 3

[0077] Exemplarily, the interface document of the target interface includes not only a business scenario page, but also at least one structure definition page. For example, as shown in Table 3, the structure definition page corresponding to the export interface of employee working hours includes structure definition page-1 and structure definition page-2.

[0078] Further exemplarily, for any one of the at least one structure definition page, the structure definition page includes the name of each data item, the value of each data item, the type of each data item, the value range of each data item, and the example message field, the type of the data item includes a string, a number, a date, etc., and the value range of the data item includes the length range of the data item value and the size range of the data item value, etc. Any one structure definition page is shown in Table 4:

[0079]

[0080] Table 4

[0081] Exemplarily, in order to further ensure the accuracy of the interface document of the target interface, the structure definition page also provides a check button. The structure definition page including the check button is as follows: Figure 2 When the target interface developer inputs in the "Value" cell in Table 4, the server receives the value input for each data item accordingly, thereby obtaining the value of each data item; the target interface developer can trigger the verification button by clicking the mouse, and the target interface developer can perform a verification after entering the value of each data item, or can perform a unified verification after all the values ​​of all data items are entered, which is not limited in this application.

[0082] Exemplarily, after the verification button is triggered, the server verifies the value of each data item according to the type of each data item and the value range of each data item. For example, assuming that the value range of data item A is 10-30, and the value of the filled data item is 45, then data item A fails the verification, and the target interface developer can be informed through a pop-up window or other prompts, so that the target interface developer can quickly locate the data item with incorrect value input and make corrections in time.

[0083] For example, when the tester starts the test after obtaining the interface document, the tester usually needs to manually construct the test message, which is inefficient and prone to errors. In order to improve the test efficiency of the target interface, the structure definition page also provides a message generation button to automatically generate the message corresponding to the current structure test page, such as Figure 2As shown in the message generation button in. The present application also provides two optional message types, one is the JSON format type, and the other is the XML format type. Before triggering the message generation button, the tester can first select the target message type in the optional message type, trigger the message generation button, and the server generates the message corresponding to the structure definition page according to the name of each data item and the value of each data item, according to the target message type, and displays the message corresponding to the structure definition page in the sample message field. If the tester does not select the target message type and directly clicks the message generation button, the message can be generated according to the default target message type. The default target message type can be a JSON format type or an XML format type, and the present application does not limit this.

[0084] Step 102: Determine, from at least one business scenario, a business scenario whose scenario description matches the call scenario of the target interface.

[0085] Exemplarily, since the business scenario page includes at least one business scenario applied by the target interface, when the target interface is called, the calling scenario of the target interface is matched with the scenario description in the business scenario page to determine the matching business scenario.

[0086] For example, assuming that the calling scenario of the target interface is "employee performance appraisal", the business scenario page shown in Table 3 is matched with the scenario description based on the calling scenario, and it is determined that the scenario description with serial number 2 "used for performance appraisal of employees" successfully matches the calling scenario. Therefore, the business scenario with serial number 2 in the business scenario page is determined as the business scenario that matches the calling scenario of the target interface.

[0087] Step 103: Determine the structure definition page corresponding to the target interface according to the tab mapping corresponding to the matching business scenario.

[0088] Exemplarily, according to step 101, the tab mapping indicates the structure definition page corresponding to the target interface under the current business scenario, that is, the tab mapping indicates the structure definition page corresponding to the target interface under the matching business scenario. Therefore, after determining the matching business scenario, the structure definition page corresponding to the target interface can be determined based on the tab mapping corresponding to the matching business scenario.

[0089] For example, assuming that the matching business scenario is the business scenario with sequence number 2 in Table 3, according to Table 3, the tab mapping corresponding to the business scenario with sequence number 2 is "Structure Definition Page-2". Therefore, the structure definition page corresponding to the target interface in the calling scenario is "Structure Definition Page-2".

[0090] Step 104: Calling the target interface is implemented through the structure definition page corresponding to the target interface.

[0091] Exemplarily, after determining the structure definition page corresponding to the target interface, the message corresponding to the current structure definition page can be obtained by triggering the message generation button of the structure definition page corresponding to the target interface. Both testers and developers can call the target interface according to the message corresponding to the current structure definition page. For example, the tester implements the test of the target interface according to the message corresponding to the structure definition page. Specifically, the tester can directly use the message corresponding to the structure definition page as a test message and input it into the test case for testing to improve the testing efficiency; the developer completes the program coding for the target interface call according to the message corresponding to the structure definition page. Specifically, when the developer develops other business functions based on the target interface, he can refer to the message corresponding to the structure definition page to complete the writing of the code program.

[0092] The interface document of the present application is filled in by the interface developer in an Excel spreadsheet according to the preset registration document, which ensures the standardization of the interface document; and the interface document includes not only a business scenario page but also a structure definition page. From the business scenario page, one can know all the scenarios in which the interface is applied, and from the structure definition page, one can know the detailed information of the interface in each business scenario, so that the interface caller can obtain complete information of the interface through the interface document; in addition, the structure definition page also provides a check button and a message generation button. The check button ensures the accuracy of the structure definition page and the generated message, and the message generation button can provide test data for the interface tester, so that the tester does not need to consider the preparation of test data, thereby improving the degree of automation of interface testing and thus improving testing efficiency.

[0093] Figure 3 and Figure 4 The following is a schematic diagram of the structure of possible interface calling devices provided by the embodiments of the present application. These interface calling devices can be used to implement the functions of the server in the above method embodiments, and thus can also achieve the beneficial effects possessed by the above method embodiments.

[0094] like Figure 3 As shown, the interface calling device 300 includes a processing unit 310 and a transceiver unit 320. The interface calling device 300 is used to implement the above Figure 1 The functions of the server in the method embodiment are shown.

[0095] When the interface calling device 300 is used to implement Figure 1 The functions of the server in the method embodiment shown are:

[0096] The transceiver unit 320 is used to obtain an interface document corresponding to the target interface; the interface document includes a business scenario page and at least one structure definition page; the business scenario page includes at least one business scenario applied by the target interface and a scenario description and a tab mapping of each business scenario; wherein the tab mapping is associated with the at least one structure definition page;

[0097] The processing unit 310 is used to determine, from the at least one business scenario, a business scenario whose scenario description matches the calling scenario of the target interface;

[0098] The processing unit 310 is further configured to determine the structure definition page corresponding to the target interface according to the tab mapping corresponding to the matched business scenario;

[0099] The processing unit 310 is further configured to call the target interface through a structure definition page corresponding to the target interface.

[0100] In a possible design, for any one of the at least one structure definition page, the structure definition page includes a name of each data item, a value of each data item, and an example message field, and the structure definition page also provides a message generation button;

[0101] The processing unit 310 is used to generate a message corresponding to the structure definition page according to the name of each data item and the value of each data item after triggering the message generation button, and display the message corresponding to the structure definition page in the example message field.

[0102] In a possible design, the processing unit 310 is also used to select a target message type from optional message types before triggering the message generation button; the optional message types include JavaScript object representation JSON format type and extensible markup language XML format type; the processing unit 310 is specifically used to generate a message corresponding to the structure definition page according to the target message type.

[0103] In a possible design, the structure definition page further includes the type of each data item and the value range of each data item, and the structure definition page also provides a check button;

[0104] The transceiver unit 320 is further configured to receive a value input for each data item, thereby obtaining a value for each data item;

[0105] The processing unit 310 is further configured to verify the value of each data item according to the type of each data item and the value range of each data item after the verification button is triggered.

[0106] In one possible design, the processing unit 310 is specifically used to implement testing of the target interface according to the message corresponding to the structure definition page; and / or, to complete the program coding of the target interface call according to the message corresponding to the structure definition page.

[0107] In a possible design, the interface document corresponding to the target interface is generated by the developer of the target interface by filling in an Excel document according to a preset registration document; the preset registration document includes registration requirements for each data item in the target interface.

[0108] For more detailed description of the processing unit 310 and the transceiver unit 320, please refer to Figure 1 The relevant description in the method embodiment shown is directly obtained and will not be repeated here.

[0109] like Figure 4 As shown, the interface calling device 400 includes a processor 410 and an interface circuit 420. The processor 410 and the interface circuit 420 are coupled to each other. It is understandable that the interface circuit 420 can be a transceiver or an input-output interface. Optionally, the interface calling device 400 can also include a memory 430 for storing instructions executed by the processor 410 or storing input data required by the processor 410 to run the instructions or storing data generated after the processor 410 runs the instructions.

[0110] When the interface calling device 400 is used to implement Figure 1 When the method is shown, the processor 410 is used to implement the function of the processing unit 310, and the interface circuit 420 is used to implement the function of the transceiver unit 320.

[0111] The division of units in the embodiments of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation. In addition, each functional unit in each embodiment of the present application may be integrated into a processor, or may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0112] Although the preferred embodiments of the present application have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.

[0113] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. An interface calling method, characterized in that: The method includes: Obtain an interface document corresponding to a target interface; the interface document includes a business scenario page and at least one structure definition page; the business scenario page includes at least one business scenario applied by the target interface and a scenario description and a tab mapping of each business scenario; wherein the tab mapping is associated with the at least one structure definition page; Determining, from the at least one business scenario, a business scenario whose scenario description matches the calling scenario of the target interface; Determine the structure definition page corresponding to the target interface according to the tab mapping corresponding to the matched business scenario; The target interface is called through the structure definition page corresponding to the target interface.

2. The method according to claim 1, characterized in that For any one of the at least one structure definition page, the structure definition page includes the name of each data item, the value of each data item and a sample message field, and the structure definition page also provides a message generation button; The method further comprises: After the message generation button is triggered, a message corresponding to the structure definition page is generated according to the name of each data item and the value of each data item, and the message corresponding to the structure definition page is displayed in the sample message field.

3. The method according to claim 2, characterized in that Before triggering the message generation button, the method further includes: Selecting a target message type from the optional message types; the optional message types include JavaScript object representation JSON format type and extensible markup language XML format type; Generate a message corresponding to the structure definition page, including: According to the target message type, a message corresponding to the structure definition page is generated.

4. The method according to claim 2, characterized in that The structure definition page also includes the type of each data item and the value range of each data item, and the structure definition page also provides a check button; Before triggering the message generation button, the method further includes: Receiving value input for each of the data items, thereby obtaining the value of each of the data items; After the verification button is triggered, the value of each data item is verified according to the type of each data item and the value range of each data item.

5. The method according to claim 2, characterized in that The calling of the target interface through the structure definition page corresponding to the target interface includes: Implementing a test of the target interface according to the message corresponding to the structure definition page; and / or completing a program code for calling the target interface according to the message corresponding to the structure definition page.

6. The method according to any one of claims 1 to 5, characterized in that The interface document corresponding to the target interface is generated by the developer of the target interface by filling in an Excel document according to a preset registration document; the preset registration document includes the registration requirements of each data item in the target interface.

7. An interface calling device, characterized in that: The device comprises a processing unit and a transceiver unit; The transceiver unit is used to obtain an interface document corresponding to the target interface; the interface document includes a business scenario page and at least one structure definition page; the business scenario page includes at least one business scenario applied by the target interface and a scenario description and a tab mapping of each business scenario; wherein the tab mapping is associated with the at least one structure definition page; The processing unit is used to determine, from the at least one business scenario, a business scenario whose scenario description matches the calling scenario of the target interface; The processing unit is further used to determine the structure definition page corresponding to the target interface according to the tab mapping corresponding to the matched business scenario; The processing unit is further used to implement the call to the target interface through the structure definition page corresponding to the target interface.

8. An interface calling device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 6 when executed by a processor.

10. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 6 when being executed by a processor.