An interface call method, device, storage medium, and computer device

Through the interface calling methods and devices, the call failure problem caused by inconsistent return data structures of different interfaces is solved, fast and accurate data structure verification is achieved, and the universality and success rate of interface calls are improved.

CN115114502BActive Publication Date: 2025-06-17KANG JIAN INFORMATION TECH (SHENZHEN) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210734689.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-27
Publication Date
2025-06-17
Estimated Expiration
2042-06-27

AI Technical Summary

Technical Problem

In the prior art, when the front-end device calls the back-end interface, the returned data structure does not meet expectations, resulting in the call failure, and the verification program logic of different interfaces is different, and the universality is poor.

Method used

Provides an interface calling method and device, which can only release data by receiving the front-end interface calling instructions, determine the target calling interface, and find its corresponding interface verification file, intercept and verify the data structure of the target data to ensure that it complies with the preset data structure.

Benefits of technology

It realizes the rapid and accurate verification of the data structure of the target data when different interfaces are called on different front-ends, which improves the universality and success rate of interface calls.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115114502B_ABST
    Figure CN115114502B_ABST
Patent Text Reader

Abstract

This application relates to the field of artificial intelligence technology, and discloses an interface call method, device, storage medium, and computer device. The method includes: receiving an interface call instruction sent by the front end, and based on the interface call instruction, determining a target call interface corresponding to the interface call instruction; searching for an interface verification file corresponding to the target call interface, intercepting target data returned by the target call interface, and determining whether a data structure corresponding to the target data meets a preset data structure corresponding in the interface verification file; when it is satisfied, releasing the target data returned by the target call interface, so that the front end calls the target call interface based on the target data. This application can quickly and accurately verify the data structures of target data returned by different interfaces when different front ends call different interfaces, and has stronger universality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] In current network technology, many network functions need to be implemented by a front-end device calling a back-end interface. When the front-end device calls the back-end interface, the back-end interface will correspondingly return call data. If the data structure corresponding to the call data returned by the back-end interface is different from the agreed data structure, the call will fail, affecting the implementation of the front-end's online service functions.

[0003] In the prior art, when checking the data structure of the call data returned by each back-end interface, there are usually different verification programs for different back-end interfaces, and the logic of the verification program corresponding to each back-end interface is different, so the universality of the verification program is poor. Summary of the Invention

[0004] In view of this, the present application provides an interface call method, device, storage medium, and computer device, which can quickly and accurately verify the data structure of the target data returned by different interfaces when different front-ends call different interfaces, and has stronger universality.

[0005] According to one aspect of the present application, an interface call method is provided, including:

[0006] Receiving an interface call instruction sent by a front-end, and based on the interface call instruction, determining a target call interface corresponding to the interface call instruction;

[0007] Searching for an interface verification file corresponding to the target call interface, intercepting target data returned by the target call interface, and determining whether the data structure corresponding to the target data meets a preset data structure in the interface verification file;

[0008] When it is satisfied, releasing the target data returned by the target call interface, so that the front-end calls the target call interface based on the target data.

[0009] According to another aspect of the present application, an interface call device is provided, including:

[0010] An instruction receiving module, configured to receive an interface call instruction sent by a front-end, and based on the interface call instruction, determine a target call interface corresponding to the interface call instruction;

[0011] A data interception module, configured to find an interface verification file corresponding to the target call interface, intercept target data returned by the target call interface, and determine whether a data structure corresponding to the target data meets a preset data structure in the interface verification file;

[0012] A data release module, configured to release the target data returned by the target call interface when the condition is met, so that the front end can call the target call interface based on the target data.

[0013] According to another aspect of the present application, a storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the above interface call method is implemented.

[0014] According to still another aspect of the present application, a computer device is provided, including a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor. When the processor executes the program, the above interface call method is implemented.

[0015] By means of the above technical solutions, an interface call method, device, storage medium, and computer device provided by the present application first receive an interface call instruction sent by the front end, and then can determine a target call interface corresponding to the interface call instruction based on the interface call instruction. After determining the target call interface that the front end wants to call, the interface verification file corresponding to the target call interface can be found. In addition, the target data returned by the target call interface can be intercepted to verify the data structure of the target data. Specifically, the data structure of the target data can be compared with the preset data structure in the interface verification file to determine whether the data structure of the target data meets the preset data structure. If the data structure of the target data returned by the target call interface conforms to the preset data structure, the target data returned by the target call interface can be released, so that the front end can successfully call the target call interface according to the target data. In the embodiments of the present application, when different front ends call different interfaces, the data structures of the target data returned by different interfaces can be verified quickly and accurately, and the universality is stronger.

[0016] The above description is only an overview of the technical solutions of the present application. In order to be able to understand the technical means of the present application more clearly, it can be implemented according to the content of the specification. And in order to make the above and other purposes, features, and advantages of the present application more obvious and understandable, the specific embodiments of the present application are specifically exemplified below. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The drawings described herein are used to provide a further understanding of the present application, and constitute a part of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application, and do not constitute an improper limitation of the present application. In the drawings:

[0018] Figure 1 The flowchart shows a method for interface call provided by an embodiment of the present application;

[0019] Figure 2 The flowchart shows another method for interface call provided by an embodiment of the present application;

[0020] Figure 3 The structural diagram shows an interface call device provided by an embodiment of the present application. Detailed implementation manners

[0021] The present application will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments. It should be noted that, without conflict, the embodiments in the present application and the features in the embodiments may be combined with each other.

[0022] In this embodiment, a method for interface call is provided. As Figure 1 shown, the method includes:

[0023] Step 101: Receive an interface call instruction sent by the front end, and based on the interface call instruction, determine a target call interface corresponding to the interface call instruction;

[0024] The method for interface call provided by the embodiment of the present application can be applied to the client side or the server side. When the front end wants to call a back-end interface, it can send an interface call instruction. First, receive the interface call instruction sent by the front end, and then, based on the interface call instruction, determine a target call interface corresponding to the interface call instruction.

[0025] Step 102: Search for an interface verification file corresponding to the target call interface, intercept target data returned by the target call interface, and determine whether a data structure corresponding to the target data meets a preset data structure in the interface verification file;

[0026] In this embodiment, different interfaces may correspond to different interface verification files, and these interface verification files can be stored in a preset file database. After determining the target call interface that the front end wants to call, the interface verification file corresponding to the target call interface can be found from the preset file database. In addition, the target data returned by the target call interface can be intercepted to verify the data structure of the target data. Specifically, the data structure of the target data can be compared with the preset data structure in the interface verification file to determine whether the data structure of the target data meets the preset data structure. Here, the preset data structure may include field names, field types, data results, data attributes, data attribute values, etc.

[0027] Step 103, when the condition is met, release the target data returned by the target call interface, so that the front end can call the target call interface based on the target data.

[0028] In this embodiment, if the data structure of the target data returned by the target call interface conforms to the preset data structure, it indicates that the data structure of the target data returned by the target call interface conforms to the convention and has not been changed. At this time, the front end can successfully call the target call interface. Then, the target data returned by the target call interface can be released, so that the front end can successfully call the target call interface according to the target data.

[0029] By applying the technical solution of this embodiment, first, an interface call instruction sent by the front end is received. Then, based on the interface call instruction, the target call interface corresponding to the interface call instruction can be determined. After determining the target call interface that the front end wants to call, the interface verification file corresponding to the target call interface can be found. In addition, the target data returned by the target call interface can be intercepted to verify the data structure of the target data. Specifically, the data structure of the target data can be compared with the preset data structure in the interface verification file to determine whether the data structure of the target data meets the preset data structure. If the data structure of the target data returned by the target call interface conforms to the preset data structure, the target data returned by the target call interface can be released, so that the front end can successfully call the target call interface according to the target data. In the embodiments of the present application, when different front ends call different interfaces, the data structures of the target data returned by different interfaces can be verified quickly and accurately, and the universality is stronger.

[0030] Further, as a refinement and extension of the specific implementation manner of the above embodiment, in order to fully illustrate the specific implementation process of this embodiment, another interface call method is provided, as Figure 2 shown, this method includes:

[0031] Step 201, receive interface call contracts sent by different front ends;

[0032] In this embodiment, first, interface call contracts sent by different front ends can be received. Among them, each interface call contract may include the requirements of the front end for the input data structure and output data structure of at least one specified call interface. By using the interface call contract, the interface form, entry, and exit expectations of the front end and the specified call interface are determined. The front end and the back end can develop services in parallel, and pre-integration testing can be carried out using the interface call contract during the development process, without waiting for joint debugging to perform integration testing, which greatly reduces the communication cost of joint debugging and improves the efficiency of joint debugging.

[0033] Step 202: Identify the specified call interfaces included in each of the interface call contracts, as well as the first preset data structure and the second preset data structure corresponding to each of the specified call interfaces, and mark the first preset data structure and the second preset data structure with the front-end identifier corresponding to the front-end.

[0034] In this embodiment, each interface call contract may include one specified call interface or multiple specified call interfaces. After receiving the interface call contracts sent by different front-ends, the specified call interfaces included in each interface call contract can be identified. In addition, the first preset data structure and the second preset data structure corresponding to each specified call interface can also be identified. Further, the first preset data structure and the second preset data structure in the interface call contract can be marked with the front-end identifier corresponding to the front-end that sent the interface call contract. Among them, each front-end and the front-end identifier are in one-to-one correspondence. The first preset data structure is used to specify the data structure sent to the specified call interface, and the second preset data structure is used to specify the data structure corresponding to the target data returned from the specified call interface. For example, front-end A sends interface call contract a, and interface call contract a includes 2 specified call interfaces, namely specified call interface 1 and specified call interface 2. Among them, specified call interface 1 corresponds to a set of first preset data structure and second preset data structure, and specified call interface 2 corresponds to a set of first preset data structure and second preset data structure. Then, the set of first preset data structure and second preset data structure corresponding to specified call interface 1 can be marked with the front-end identifier corresponding to front-end A, and the set of first preset data structure and second preset data structure corresponding to specified call interface 2 can be marked with the front-end identifier corresponding to front-end A.

[0035] Step 203: Aggregate the first preset data structure and the second preset data structure corresponding to the same specified call interface to generate an interface verification file corresponding to each specified call interface.

[0036] In this embodiment, after marking the first preset data structure and the second preset data structure corresponding to the specified call interface included in all interface call contracts, the first preset data structure and the second preset data structure corresponding to the same specified call interface can be extracted from each interface call contract respectively and combined together to generate an interface verification file corresponding to each specified call interface one by one. That is, each interface verification file only contains one or more groups of the first preset data structure and the second preset data structure corresponding to a specified call interface. For example, there are three front-ends sending three interface call contracts. The three front-ends can be front-end A, front-end B, and front-end C respectively, and the corresponding interface call contracts can be interface call contract a, interface call contract b, and interface call contract c respectively. Among them, interface call contract a includes specified call interface 1 and specified call interface 2, interface call contract b includes specified call interface 1, specified call interface 2, and specified call interface 3, and interface call contract c includes specified call interface 1 and specified call interface 4. Then, the first preset data structure and the second preset data structure with the front-end identifier of front-end A corresponding to specified call interface 1 can be extracted from interface call contract a, the first preset data structure and the second preset data structure with the front-end identifier of front-end B corresponding to specified call interface 1 can be extracted from interface call contract b, and the first preset data structure and the second preset data structure with the front-end identifier of front-end C corresponding to specified call interface 1 can be extracted from interface call contract c. And based on these first preset data structures and the second preset data structures, an interface verification file corresponding to specified call interface 1 is generated. The same method can also be used to generate the interface verification files corresponding to specified call interface 2, specified call interface 3, and specified call interface 4.

[0037] Step 204: Receive the interface call instruction sent by the front-end, intercept the interface call instruction sent by the front-end, and determine the target call interface corresponding to the interface call instruction based on the interface call instruction.

[0038] In this embodiment, when the front-end wants to call the back-end interface, it can issue an interface call instruction. First, receive the interface call instruction sent by the front-end, then intercept the interface call instruction sent by the front-end, and determine the target call interface corresponding to the interface call instruction based on the interface call instruction.

[0039] Step 205: Search for the interface verification file corresponding to the target call interface, identify the front-end identifier corresponding to the front-end, determine the first preset data structure corresponding to the front-end identifier from the interface verification file, and judge whether the data structure corresponding to the interface call instruction meets the first preset data structure.

[0040] In this embodiment, after determining the target call interface corresponding to the interface call instruction, the interface verification file corresponding to the target call interface can be retrieved from the preset file database. Then, the front-end identifier corresponding to the front-end that sends the interface call instruction can be identified, and the first preset data structure corresponding to the front-end identifier can be determined from the interface verification file, and it can be judged whether the data structure corresponding to the interface call instruction is consistent with the first preset data structure. Among them, the interface verification file may include one or more first preset data structures, and each first preset data structure is marked with a different front-end identifier.

[0041] Step 206, when the condition is met, release the interface call instruction so that the target call interface returns the target data based on the interface call instruction;

[0042] In this embodiment, if the data structure corresponding to the interface call instruction meets the first preset data structure, the interface call instruction sent by the front-end can be released, so that the target call interface can return the target data to the front-end based on the interface call instruction.

[0043] Step 207, intercept the target data returned by the target call interface, identify the front-end identifier corresponding to the front-end, determine the second preset data structure corresponding to the front-end identifier from the interface verification file, and judge whether the data structure corresponding to the target data meets the second preset data structure;

[0044] In this embodiment, after the target call interface returns the target data, the target data can also be intercepted and the data structure corresponding to the target data can be judged. Specifically, the front-end identifier corresponding to the front-end can be identified, and the second preset data structure corresponding to the front-end identifier can be found from the interface verification file. Then, it is judged whether the data structure corresponding to the target data is consistent with the second preset data structure. On the one hand, in the embodiment of the present application, by intercepting the interface call instruction, it is judged whether the data structure corresponding to the interface call instruction conforms to the first preset data structure. On the other hand, by intercepting the target data returned by the target call interface, it is judged whether the data structure corresponding to the target data conforms to the second preset data structure. When the target call interface call fails, the reason for the failure of the target call interface call can be quickly and effectively determined.

[0045] Step 208, when the condition is met, release the target data returned by the target call interface so that the front-end calls the target call interface based on the target data;

[0046] In this embodiment, if the data structure of the target data returned by the target call interface conforms to the second preset data structure, it indicates that the data structure of the target data returned by the target call interface conforms to the convention and has not changed. At this time, the front end can successfully call the target call interface. Then, the target data returned by the target call interface can be released, so that the front end can successfully call the target call interface according to the target data.

[0047] Step 209, when it is not satisfied, generate a feedback report corresponding to the target call interface based on the front-end identifier, the data structure corresponding to the target data, and the second preset data structure corresponding to the front-end identifier, and send the feedback report to a preset processing terminal.

[0048] In this embodiment, if the data structure of the target data returned by the target call interface does not conform to the second preset data structure, it indicates that the data structure of the target data returned by the target call interface does not conform to the convention and has changed to a certain extent. At this time, a feedback report corresponding to the target call interface can be generated based on the front-end identifier, the data structure corresponding to the target data, and the second preset data structure corresponding to the front-end identifier. From the feedback report, it can be seen which target call interface has a problem in the call, what the second preset data structure is, and what the data structure of the target data is, etc., which can enable relevant staff to more intuitively see the change in the data structure, improve the problem location efficiency of the staff, and is conducive to timely handling and solving problems. In addition, the feedback report can also be sent to a preset processing terminal.

[0049] In addition, when the data structure corresponding to the interface call instruction sent by the front end does not conform to the corresponding first preset data structure, a feedback report corresponding to the target call interface can also be generated. The feedback report can include the front-end identifier, the data structure corresponding to the interface call instruction, the first preset data structure corresponding to the front-end identifier, etc.

[0050] Optionally, if the data structure of the target data returned by the target call interface does not conform to the second preset data structure, an exception signal can also be generated and sent to a preset management terminal. After receiving the exception signal, the preset management terminal can output an alarm message, and the alarm message can be output in a voice manner or in an image manner, etc., so as to remind the staff to handle it in time.

[0051] In an embodiment of the present application, optionally, after step 203, the method further includes: receiving a call change contract sent by any one of the different front-ends, identifying the call change interfaces included in the call change contract, and the first change data structure and the second change data structure corresponding to each of the call change interfaces, and marking the first change data structure and the second change data structure with the front-end identifier corresponding to the any front-end; determining the target interface verification file corresponding to the call change interface from the interface verification file, and using the first change data structure and the second change data structure to replace the first preset data structure and the second preset data structure corresponding to the front-end identifier of the any front-end in the target interface verification file, generating a replacement verification file corresponding to the target interface verification file, and retaining the target interface verification file and the corresponding replacement verification file, and the priority of the replacement verification file is higher than that of the target interface verification file.

[0052] In this embodiment, after generating interface verification files corresponding to different specified call interfaces, the front-end and back-end interfaces can also modify the original first preset data structure and second preset data structure after agreement. Specifically, it can receive a call modification contract sent by any front-end. Here, any front-end refers to a front-end that has sent an interface call contract before. Then, it can identify the included call modification interfaces from the call modification contract, as well as the first modified data structure and the second modified data structure corresponding to each call modification interface. Similarly, it can mark the first modified data structure and the second modified data structure with the front-end identifier corresponding to the front-end that sends the call modification contract. After that, it can find the target interface verification file corresponding to each call modification interface from the preset file database, and use the marked first modified data structure and second modified data structure to replace the corresponding content in the target interface verification file. Specifically, it can find the first preset data structure and the second preset data structure corresponding to the front-end identifier of the front-end that sends the call modification contract from the target interface verification file, then use the first modified data structure to replace the first preset data structure, and use the second modified data structure to replace the second preset data structure. After the replacement, it can generate a replacement verification file for the target interface verification file. For example, the call modification contract e sent by front-end E includes two sets of modified data structures, and each set of modified data structures corresponds to a call modification interface. Here, the call modification interfaces can include call modification interface 1 and call modification interface 2. Then, it can find the target interface verification file corresponding to call modification interface 1 and the target interface verification file corresponding to call modification interface 2 from the preset file database. Next, it can find the first preset data structure and the second preset data structure corresponding to the front-end identifier of front-end E from the target interface verification file corresponding to call modification interface 1, and use the first modified data structure and the second modified data structure corresponding to call modification interface 1 in the call modification contract e for replacement, so as to generate a replacement verification file for the target interface verification file corresponding to call modification interface 1. In addition, it can find the first preset data structure and the second preset data structure corresponding to the front-end identifier of front-end E from the target interface verification file corresponding to call modification interface 2, and use the first modified data structure and the second modified data structure corresponding to call modification interface 2 in the call modification contract e for replacement, so as to generate a replacement verification file for the target interface verification file corresponding to call modification interface 2.

[0053] After generating the replacement verification file corresponding to the target interface verification file, both the target interface verification file and the corresponding replacement verification file can be retained. In this way, the changes in the data structure of the data sent to the corresponding specified call interface, as well as the changes in the data structure of the target data returned from the specified call interface, can be seen from the target interface verification file and the corresponding replacement verification file. In addition, for the newly generated replacement verification file, its priority can be set to be higher than that of the target interface verification file. In this way, when the specified call interface is called again later, the replacement verification file can be used to verify the data structure of the data sent to the specified call interface and the data structure of the target data returned from the specified call interface. Each time the front end sends a call to change the contract, a new replacement verification file can be generated correspondingly, and the priority of the newly generated replacement verification file is always higher than that of the previous replacement verification file.

[0054] In an embodiment of the present application, optionally, the method further includes: in response to an interface data structure change query instruction, determining an interface identifier corresponding to the interface data structure change query instruction; obtaining the interface verification file and the replacement verification file corresponding to the interface identifier, determining structure change data from the interface verification file and the replacement verification file corresponding to the interface identifier, and generating a data structure change list corresponding to the interface identifier based on the structure change data.

[0055] In this embodiment, the change situation of the data structure corresponding to each call interface can also be directly determined. When a staff member wants to determine the change situation of the data structure corresponding to any call interface, the icon corresponding to the call interface can be triggered to generate an interface data structure change query instruction. Then, in response to the interface data structure change query instruction, the interface identifier corresponding to the interface data structure change query instruction can be further determined. After determining the interface identifier corresponding to the interface data structure change query instruction, the interface verification file corresponding to the interface identifier and one or more corresponding replacement verification files can be found from the preset file database. Finally, according to the interface verification file and the replacement verification file, the structure change data of the call interface corresponding to the interface identifier can be determined, and the change situation of the data structure of the call interface can be seen from the structure change data. For example, the change situation of the data structure corresponding to the interface call instruction sent from the front end, and / or the change situation of the data structure of the target data returned from the target call interface. In addition, a data structure change list can also be generated based on the determined structure change data. By constructing a data structure change list in the embodiment of the present application, the staff can directly and quickly and accurately determine the change situation of the data structure of the call interface, which is beneficial to improving the viewing efficiency of the staff.

[0056] Further, as Figure 1For the specific implementation of the method, an embodiment of the present application provides an interface call device, as Figure 3 shown. The device includes:

[0057] An instruction receiving module, configured to receive an interface call instruction sent by the front end, and based on the interface call instruction, determine a target call interface corresponding to the interface call instruction;

[0058] A data interception module, configured to find an interface verification file corresponding to the target call interface, intercept target data returned by the target call interface, and determine whether a data structure corresponding to the target data meets a preset data structure corresponding in the interface verification file;

[0059] A data release module, configured to release the target data returned by the target call interface when it is satisfied, so that the front end calls the target call interface based on the target data.

[0060] Optionally, the device further includes:

[0061] A contract receiving module, configured to receive interface call contracts sent by different front ends before receiving the interface call instruction sent by the front end;

[0062] An interface identification module, configured to identify a specified call interface included in each interface call contract, as well as a first preset data structure and a second preset data structure corresponding to each specified call interface, and mark the first preset data structure and the second preset data structure with a front-end identifier corresponding to the front end;

[0063] An aggregation module, configured to perform an aggregation process on the first preset data structure and the second preset data structure corresponding to the same specified call interface, and generate an interface verification file corresponding to each specified call interface.

[0064] Optionally, the device further includes:

[0065] An instruction interception module, configured to intercept the interface call instruction sent by the front end after receiving the interface call instruction sent by the front end;

[0066] The device further includes:

[0067] An identifier identification module, configured to identify the front-end identifier corresponding to the front end after finding the interface verification file corresponding to the target call interface, determine a first preset data structure corresponding to the front-end identifier from the interface verification file, and determine whether a data structure corresponding to the interface call instruction meets the first preset data structure;

[0068] An instruction release module, configured to release the interface call instruction when the condition is met, so that the target call interface returns the target data based on the interface call instruction.

[0069] Optionally, the identification recognition module is further configured to:

[0070] Identify the front-end identifier corresponding to the front end, determine a second preset data structure corresponding to the front-end identifier from the interface verification file, and determine whether the data structure corresponding to the target data meets the second preset data structure.

[0071] Optionally, the device further includes:

[0072] A report generation module, configured to generate a feedback report corresponding to the target call interface based on the front-end identifier, the data structure corresponding to the target data, and the second preset data structure corresponding to the front-end identifier when the condition is not met, and send the feedback report to a preset processing terminal.

[0073] Optionally, the device further includes:

[0074] The interface recognition module is further configured to, after generating an interface verification file corresponding to each specified call interface, receive a call change contract sent by any front end among the different front ends, identify the call change interface included in the call change contract, and the first change data structure and the second change data structure corresponding to each call change interface, and mark the first change data structure and the second change data structure with the front-end identifier corresponding to the any front end;

[0075] A replacement module, configured to determine a target interface verification file corresponding to the call change interface from the interface verification file, use the first change data structure and the second change data structure to replace the first preset data structure and the second preset data structure corresponding to the front-end identifier of the any front end in the target interface verification file, generate a replacement verification file corresponding to the target interface verification file, and retain the target interface verification file and the corresponding replacement verification file, and the priority of the replacement verification file is higher than that of the target interface verification file.

[0076] Optionally, the device includes:

[0077] An instruction response module, configured to determine an interface identifier corresponding to the interface data structure change query instruction in response to the interface data structure change query instruction;

[0078] A list generation module, configured to obtain the interface verification file and the replacement verification file corresponding to the interface identifier, determine structure change data from the interface verification file and the replacement verification file corresponding to the interface identifier, and generate a data structure change list corresponding to the interface identifier based on the structure change data.

[0079] It should be noted that for other corresponding descriptions of each functional unit involved in an interface calling device provided in an embodiment of the present application, reference can be made to Figures 1 to 2 the corresponding description in the method, which will not be elaborated herein.

[0080] Based on the above method as Figures 1 to 2 shown, correspondingly, an embodiment of the present application further provides a storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the above interface calling method as Figures 1 to 2 shown is implemented.

[0081] Based on such an understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in various implementation scenarios of the present application.

[0082] Based on the above method as Figures 1 to 2 shown, and Figure 3 the virtual device embodiment as Figures 1 to 2 shown, for the purpose of achieving the above object, an embodiment of the present application further provides a computer device, which can specifically be a personal computer, a server, a network device, etc. The computer device includes a storage medium and a processor; the storage medium is used to store a computer program; the processor is used to execute the computer program to implement the above interface calling method as

[0083] Optionally, the computer device may further include a user interface, a network interface, a camera, a radio frequency (RF) circuit, sensors, an audio circuit, a WI-FI module, etc. The user interface may include a display screen (Display), an input unit such as a keyboard (Keyboard), etc., and optionally the user interface may further include a USB interface, a card reader interface, etc. The network interface may optionally include a standard wired interface, a wireless interface (such as a Bluetooth interface, a WI-FI interface), etc.

[0084] Those skilled in the art can understand that the structure of a computer device provided in this embodiment does not constitute a limitation on the computer device, and it may include more or fewer components, or combine certain components, or have different component arrangements.

[0085] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages and stores the hardware and software resources of a computer device, and supports the operation of information processing programs and other software and / or programs. The network communication module is used to implement communication between components within the storage medium, as well as communication between the storage medium and other hardware and software in the entity device.

[0086] Through the description of the above embodiments, those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform, or can also be implemented by hardware. First, an interface call instruction sent by the front end is received. Then, based on the interface call instruction, the target call interface corresponding to the interface call instruction can be determined. After determining the target call interface that the front end wants to call, the interface verification file corresponding to the target call interface can be found. In addition, the target data returned by the target call interface can be intercepted to verify the data structure of the target data. Specifically, the data structure of the target data can be compared with the preset data structure in the interface verification file to determine whether the data structure of the target data meets the preset data structure. If the data structure of the target data returned by the target call interface conforms to the preset data structure, then the target data returned by the target call interface can be released, so that the front end can successfully call the target call interface according to the target data. In the embodiments of the present application, when different front ends call different interfaces, the data structures of the target data returned by different interfaces can be verified quickly and accurately, and the universality is stronger.

[0087] Those skilled in the art can understand that the drawings are only schematic diagrams of a preferred implementation scenario, and the modules or processes in the drawings are not necessarily essential for implementing the present application. Those skilled in the art can understand that the modules in the device in the implementation scenario can be distributed in the device in the implementation scenario according to the description of the implementation scenario, or can be changed accordingly and located in one or more devices different from the present implementation scenario. The modules in the above implementation scenario can be combined into one module, or can be further split into multiple sub-modules.

[0088] The above serial numbers of the present application are only for description and do not represent the advantages or disadvantages of the implementation scenarios. The above disclosure is only several specific implementation scenarios of the present application. However, the present application is not limited thereto, and any changes that can be thought of by those skilled in the art should fall within the protection scope of the present application.

Claims

1. An interface call method, characterized in that, Including: Receiving an interface call instruction sent by a front end, and determining a target call interface corresponding to the interface call instruction based on the interface call instruction; Searching for an interface verification file corresponding to the target call interface, intercepting target data returned by the target call interface, identifying a front-end identifier corresponding to the front end, determining a second preset data structure corresponding to the front-end identifier from the interface verification file, and determining whether a data structure corresponding to the target data meets the second preset data structure; When it is satisfied, releasing the target data returned by the target call interface, so that the front end calls the target call interface based on the target data; Before receiving the interface call instruction sent by the front end, the method further includes: Receiving interface call contracts sent by different front ends; Identifying a specified call interface included in each interface call contract, and a first preset data structure and a second preset data structure corresponding to each specified call interface, and marking the first preset data structure and the second preset data structure with the front-end identifier corresponding to the front end; Performing an aggregation process on the first preset data structure and the second preset data structure corresponding to the same specified call interface to generate an interface verification file corresponding to each specified call interface.

2. The method according to claim 1, characterized in that, After receiving the interface call instruction sent by the front end, the method further includes: Intercepting the interface call instruction sent by the front end; After searching for the interface verification file corresponding to the target call interface, the method further includes: Identifying the front-end identifier corresponding to the front end, determining a first preset data structure corresponding to the front-end identifier from the interface verification file, and determining whether a data structure corresponding to the interface call instruction meets the first preset data structure; When it is satisfied, releasing the interface call instruction, so that the target call interface returns the target data based on the interface call instruction.

3. The method according to claim 1, characterized in that, The method further includes: When it is not satisfied, generating a feedback report corresponding to the target call interface based on the front-end identifier, the data structure corresponding to the target data, and the second preset data structure corresponding to the front-end identifier, and sending the feedback report to a preset processing terminal.

4. The method according to claim 1, characterized in that, After generating the interface verification file corresponding to each specified call interface, the method further includes: Receiving a call modification contract sent by any one of the different front ends, identifying a call modification interface included in the call modification contract, and a first modification data structure and a second modification data structure corresponding to each call modification interface, and marking the first modification data structure and the second modification data structure with the front-end identifier corresponding to the any front end; Determine the target interface verification file corresponding to the call change interface from the interface verification file, and use the first change data structure and the second change data structure to replace the first preset data structure and the second preset data structure corresponding to the front-end identifier of any front-end in the target interface verification file, generate a replacement verification file corresponding to the target interface verification file, and retain the target interface verification file and the corresponding replacement verification file, where the priority of the replacement verification file is higher than that of the target interface verification file.

5. The method according to claim 4, characterized in that, The method further includes: In response to an interface data structure change query instruction, determine the interface identifier corresponding to the interface data structure change query instruction; Obtain the interface verification file and the replacement verification file corresponding to the interface identifier, determine the structure change data from the interface verification file and the replacement verification file corresponding to the interface identifier, and generate a data structure change list corresponding to the interface identifier based on the structure change data.

6. An interface call device, characterized in that, It includes: An instruction receiving module, configured to receive an interface call instruction sent by a front-end, and based on the interface call instruction, determine the target call interface corresponding to the interface call instruction; A data interception module, configured to find the interface verification file corresponding to the target call interface, intercept the target data returned by the target call interface, identify the front-end identifier corresponding to the front-end, determine the second preset data structure corresponding to the front-end identifier from the interface verification file, and determine whether the data structure corresponding to the target data meets the second preset data structure; A data release module, configured to release the target data returned by the target call interface when it is satisfied, so that the front-end can call the target call interface based on the target data; The device further includes: A contract receiving module, configured to receive interface call contracts sent by different front-ends before receiving the interface call instruction sent by the front-end; An interface identification module, configured to identify the specified call interface included in each interface call contract, as well as the first preset data structure and the second preset data structure corresponding to each specified call interface, and mark the first preset data structure and the second preset data structure with the front-end identifier corresponding to the front-end; An aggregation module, configured to perform an aggregation process on the first preset data structure and the second preset data structure corresponding to the same specified call interface, and generate an interface verification file corresponding to each specified call interface.

7. A storage medium, on which a computer program is stored, characterized in that, When the computer program is executed by a processor, it implements the method according to any one of claims 1 to 5.

8. A computer device, including a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Interface calling method and device, computer equipment and storage medium

    CN110633160A