API interface calling method and device

By obtaining the domain name configuration list and setting the domain name detection cycle on the client, the problems of complex coding and slow failover in API interface calls are solved, and the interface calling efficiency and user experience are improved.

CN114584547BActive Publication Date: 2024-09-20BEIJING JINGDONG TUOXIAN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210231247.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-09
Publication Date
2024-09-20
Estimated Expiration
2042-03-09

AI Technical Summary

Technical Problem

In the existing API interface calling method, the coding is complex and time-consuming, resulting in a long time for interface docking. If a certain computer room fails, the failover will be long, affecting efficiency and user experience.

Method used

Obtain the domain name configuration list through the software development tool kit deployed on the client, determine the target domain name address, implement API interface calls, set the domain name detection cycle and access priority, regularly update the domain name configuration list, and handle failover in a timely manner.

Benefits of technology

It reduces the failover time, improves interface calling efficiency and user experience, and simplifies the coding process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114584547B
    Figure CN114584547B
Patent Text Reader

Abstract

The present invention discloses an API interface calling method and device, and relates to the field of computer technology. A specific implementation of the method includes: in response to the startup of a software development kit deployed on a client, obtaining a domain name configuration list; wherein the domain name configuration list includes multiple domain name addresses and API interfaces corresponding to the domain name addresses; calling the API interfaces in the domain name configuration list in sequence, determining the target domain name address according to the feedback result; calling the API interface corresponding to the target domain name address, and performing corresponding business processing. This implementation reduces the fault transfer time required when a fault occurs, improves the interface calling efficiency, and enhances the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] Currently, most of the data transmission between systems on the Internet is carried out through API (Application Programming Interface) interface calls. Among them, the current mainstream forms of API interface calls include HTTP, webService, and RPC calls using various protocols between intranets.

[0003] If the two parties in data transmission use API interface calling methods, they are currently implemented based on HTTP, such as directly using HTTP or HTTPS, or calling protocols such as WebService, which are essentially still based on HTTP protocol. The HTTP protocol requires the standard interface to comply with: http: / / domain name: port / request path, and the target system can be accurately requested through the domain name and port information.

[0004] There are at least the following problems in the prior art:

[0005] In the existing API interface calling methods, the coding during the calling process is complex and takes a long time to code, resulting in a long time for interface docking. At the same time, the interface provider usually deploys multiple regions and multiple computer rooms. If a computer room fails during the calling process, it needs to be transferred to another computer room. During this period, more fault transfers are required and the process is long, resulting in low interface calling efficiency and poor user experience. Summary of the invention

[0006] In view of this, an embodiment of the present invention provides an API interface calling method and device, which can use a software development kit deployed on the client to obtain a domain name configuration list, and then determine the target domain name address to implement API interface calling, thereby reducing the fault transfer time required when a fault occurs, improving the interface calling efficiency, and enhancing the user experience.

[0007] To achieve the above object, according to one aspect of an embodiment of the present invention, a method for calling an API interface is provided, comprising:

[0008] In response to the startup of the software development kit deployed on the client, a domain name configuration list is obtained; wherein the domain name configuration list includes multiple domain name addresses and API interfaces corresponding to the domain name addresses;

[0009] Call the API interfaces in the domain name configuration list in sequence and determine the target domain name address based on the feedback results;

[0010] Call the API interface corresponding to the target domain name address to perform corresponding business processing.

[0011] Furthermore, it also includes:

[0012] Set the domain name detection cycle, and regularly call the API interface in the domain name configuration list according to the domain name detection cycle to obtain the detection results;

[0013] Update the domain name configuration list based on the detection results.

[0014] Furthermore, the step of updating the domain name configuration list according to the detection result includes:

[0015] If the detection result is that the access is successful, the corresponding domain name address is retained in the domain name configuration list;

[0016] If the detection result is access failure, the access failure frequency is determined, and if the access failure frequency exceeds the frequency threshold, the corresponding domain name address is deleted from the domain name configuration list.

[0017] Furthermore, it also includes:

[0018] Receive domain name address access priority;

[0019] Sort multiple domain name addresses in the domain name configuration list according to the domain name address access priority.

[0020] Furthermore, after the step of obtaining the domain name configuration list, the method further includes:

[0021] It is determined whether the domain name configuration list is the same as the locally stored domain name configuration list. If different, the locally stored domain name configuration list is updated.

[0022] Furthermore, it also includes:

[0023] In response to the startup of the software development kit deployed on the client, if obtaining the domain name configuration list fails;

[0024] Execute the API call based on the locally stored domain name configuration list.

[0025] Further, the steps of calling the API interface corresponding to the target domain name address and performing corresponding business processing include:

[0026] Encrypt the business data in the process of calling the API interface corresponding to the target domain name address.

[0027] According to another aspect of an embodiment of the present invention, there is provided an API interface calling device, comprising:

[0028] A domain name configuration list acquisition module is used to obtain a domain name configuration list in response to the startup of the software development kit deployed on the client; wherein the domain name configuration list includes multiple domain name addresses and API interfaces corresponding to the domain name addresses;

[0029] The target domain name address determination module is used to call the API interfaces in the domain name configuration list in sequence and determine the target domain name address according to the feedback results;

[0030] The API interface calling module is used to call the API interface corresponding to the target domain name address and perform corresponding business processing.

[0031] According to another aspect of an embodiment of the present invention, there is provided an electronic device for API interface calling, including:

[0032] one or more processors;

[0033] a storage device for storing one or more programs,

[0034] When one or more programs are executed by one or more processors, the one or more processors implement any of the above-mentioned API interface calling methods.

[0035] According to another aspect of an embodiment of the present invention, there is provided a computer-readable medium on which a computer program is stored, wherein the program implements any of the above-mentioned API interface calling methods when executed by a processor.

[0036] An embodiment of the above invention has the following advantages or beneficial effects: because a domain name configuration list is obtained in response to the startup of a software development kit deployed on the client; wherein the domain name configuration list includes multiple domain name addresses and API interfaces corresponding to the domain name addresses; the API interfaces in the domain name configuration list are called in sequence, and the target domain name address is determined according to the feedback results; the API interface corresponding to the target domain name address is called to perform corresponding business processing. Therefore, the technical means overcomes the problems in the existing methods, such as complex coding in the calling process, which takes up a long coding time and causes the interface docking to take a long time; if a computer room fails during the calling process, the interface call is transferred to another computer room, which requires more fault transfers and a long time, resulting in low interface call efficiency and poor user experience. The technical effect of being able to use the software development kit deployed on the client to obtain the domain name configuration list, and then determine the target domain name address, implement API interface calls, reduce the fault transfer time required when a fault occurs, improve interface call efficiency, and enhance user experience is achieved.

[0037] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.

[0039] Figure 1 It is a schematic diagram of the main process of the API interface calling method provided according to an embodiment of the present invention;

[0040] Figure 2 is a schematic diagram of the main process of an API interface calling method provided according to another embodiment of the present invention;

[0041] Figure 3 It is a schematic diagram of main modules of an API interface calling device provided according to an embodiment of the present invention;

[0042] Figure 4 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;

[0043] Figure 5 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION

[0044] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0045] Figure 1 is a schematic diagram of the main process of the API interface calling method provided according to an embodiment of the present invention; Figure 1 As shown, the API interface calling method provided by the embodiment of the present invention mainly includes:

[0046] Step S101, in response to the startup of the software development kit deployed on the client, a domain name configuration list is obtained; wherein the domain name configuration list includes multiple domain name addresses and API interfaces corresponding to the domain name addresses.

[0047] Through the above settings, a software development kit (SDK) is deployed in the client in advance. When the client starts, the SDK is loaded to obtain the domain name configuration list from the server, so that the available domain name addresses can be determined by accessing the domain name addresses in the domain name configuration list in sequence, and then the target domain name address can be quickly determined, and the corresponding API interface can be called to execute business processing, thereby improving the efficiency of interface calling.

[0048] Furthermore, according to an embodiment of the present invention, the method further includes:

[0049] Receive domain name address access priority;

[0050] Sort multiple domain name addresses in the domain name configuration list according to the domain name address access priority.

[0051] By sorting multiple domain name addresses in the domain name configuration list, it is helpful to subsequently determine the available target domain name address that best meets user needs, further improving the user experience.

[0052] Preferably, according to an embodiment of the present invention, after the above step of obtaining the domain name configuration list, the method further includes:

[0053] It is determined whether the domain name configuration list is the same as the locally stored domain name configuration list. If different, the locally stored domain name configuration list is updated.

[0054] The locally stored domain name configuration list is updated according to the latest domain name configuration list obtained. This helps in the subsequent operation of determining the target domain name address and calling the corresponding API interface to perform business processing when the latest domain name configuration list on the server cannot be obtained. This reduces the failover time required when a failure occurs, improves the interface call efficiency, and enhances the user experience.

[0055] Step S102, calling the API interfaces in the domain name configuration list in sequence, and determining the target domain name address according to the feedback results.

[0056] Specifically, according to an embodiment of the present invention, the corresponding API interfaces can be called in sequence according to the order of multiple domain name addresses in the domain name configuration list to determine whether the domain name address is available. If available, it is determined to be the target domain name address. Through the above settings, when the API interface call is actually executed, the API interface in the domain name configuration list is called again, so that when a failure occurs in a certain computer room and the domain name address is unavailable, the transfer process can be carried out in time, thereby improving the availability of the interface call, improving the business processing efficiency, and improving the user experience.

[0057] Specifically, according to an embodiment of the present invention, the method further includes:

[0058] Set the domain name detection cycle, and regularly call the API interface in the domain name configuration list according to the domain name detection cycle to obtain the detection results;

[0059] Update the domain name configuration list based on the detection results.

[0060] According to a specific implementation of an embodiment of the present invention, a resident thread can be started to periodically call the API interface in the domain name configuration list. When a domain name address is found to be unavailable, it is marked or deleted from the domain name configuration list (i.e., the domain name configuration list is updated according to the detection results).

[0061] Further, according to an embodiment of the present invention, the step of updating the domain name configuration list according to the detection result includes:

[0062] If the detection result is that the access is successful, the corresponding domain name address is retained in the domain name configuration list;

[0063] If the detection result is access failure, the access failure frequency is determined, and if the access failure frequency exceeds the frequency threshold, the corresponding domain name address is deleted from the domain name configuration list.

[0064] According to an embodiment of the present invention, when a domain name address is found to be unavailable, it is deleted from the domain name configuration list. A thread can be opened for the deleted domain name address to be accessed again regularly, and when it can be called, the domain name address can be added to the domain name configuration list.

[0065] Step S103, calling the API interface corresponding to the target domain name address to perform corresponding business processing.

[0066] Exemplarily, according to an embodiment of the present invention, the method further includes:

[0067] In response to the startup of the software development kit deployed on the client, if obtaining the domain name configuration list fails;

[0068] Execute the API call based on the locally stored domain name configuration list.

[0069] The above specific implementation method is a fallback strategy for this application. The SDK can also be used to periodically obtain the domain name configuration list, and then update the locally stored domain name configuration list.

[0070] Further, the steps of calling the API interface corresponding to the target domain name address and performing corresponding business processing include:

[0071] Encrypt the business data in the process of calling the API interface corresponding to the target domain name address.

[0072] By encrypting the business data in the interface calling process, it can prevent the business data from being tampered with or leaked, which helps to ensure the security of user information.

[0073] According to the technical solution of the embodiment of the present invention, a domain name configuration list is obtained in response to the startup of a software development kit deployed on the client; wherein the domain name configuration list includes multiple domain name addresses and API interfaces corresponding to the domain name addresses; the API interfaces in the domain name configuration list are called in sequence, and the target domain name address is determined according to the feedback results; the API interface corresponding to the target domain name address is called to perform corresponding business processing. Therefore, the technical means overcomes the problems in the existing method that the coding in the calling process is complex, which takes up a long coding time and leads to a long time for interface docking; if a computer room fails during the calling process, the interface call is transferred to another computer room, which requires more and longer fault transfers, resulting in low interface call efficiency and poor user experience. Therefore, the domain name configuration list can be obtained by using the software development kit deployed on the client, and then the target domain name address can be determined to implement API interface calls, reduce the fault transfer time required when a fault occurs, improve interface call efficiency, and enhance user experience.

[0074] Figure 2 is a schematic diagram of the main process of the API interface calling method provided according to another embodiment of the present invention; Figure 2 As shown, the API interface calling method provided by the embodiment of the present invention mainly includes:

[0075] Step S201, in response to the startup of the software development kit deployed on the client, a domain name configuration list is obtained; wherein the domain name configuration list includes multiple domain name addresses and API interfaces corresponding to the domain name addresses.

[0076] Through the above settings, the SDK is deployed in the client in advance. When the client starts, the SDK is loaded to obtain the domain name configuration list from the server, so that the available domain name addresses can be determined by accessing the domain name addresses in the domain name configuration list in sequence, and then the target domain name address can be quickly determined, and the corresponding API interface can be called to execute business processing, thereby improving the efficiency of interface calling.

[0077] Step S202, receiving a domain name address access priority; and sorting multiple domain name addresses in the domain name configuration list according to the domain name address access priority.

[0078] By sorting multiple domain name addresses in the domain name configuration list, it is helpful to subsequently determine the available target domain name address that best meets user needs, further improving the user experience.

[0079] Preferably, according to an embodiment of the present invention, after the above step of obtaining the domain name configuration list, the method further includes:

[0080] It is determined whether the domain name configuration list is the same as the locally stored domain name configuration list. If different, the locally stored domain name configuration list is updated.

[0081] The locally stored domain name configuration list is updated according to the latest domain name configuration list obtained. This helps in the subsequent operation of determining the target domain name address and calling the corresponding API interface to perform business processing when the latest domain name configuration list on the server cannot be obtained. This reduces the failover time required when a failure occurs, improves the interface call efficiency, and enhances the user experience.

[0082] Step S203, setting a domain name detection period, regularly calling an API interface in the domain name configuration list according to the domain name detection period, and obtaining a detection result; and updating the domain name configuration list according to the detection result.

[0083] According to a specific implementation of an embodiment of the present invention, a resident thread can be started to periodically call the API interface in the domain name configuration list. When a domain name address is found to be unavailable, it is marked or deleted from the domain name configuration list (i.e., the domain name configuration list is updated according to the detection results).

[0084] Specifically, according to an embodiment of the present invention, it also includes:

[0085] Set the domain name detection cycle, and regularly call the API interface in the domain name configuration list according to the domain name detection cycle to obtain the detection results;

[0086] Update the domain name configuration list based on the detection results.

[0087] According to a specific implementation of an embodiment of the present invention, a resident thread can be started to periodically call the API interface in the domain name configuration list. When a domain name address is found to be unavailable, it is marked or deleted from the domain name configuration list (i.e., the domain name configuration list is updated according to the detection results).

[0088] Further, according to an embodiment of the present invention, the step of updating the domain name configuration list according to the detection result includes:

[0089] If the detection result is that the access is successful, the corresponding domain name address is retained in the domain name configuration list;

[0090] If the detection result is access failure, the access failure frequency is determined, and if the access failure frequency exceeds the frequency threshold, the corresponding domain name address is deleted from the domain name configuration list.

[0091] According to an embodiment of the present invention, when a domain name address is found to be unavailable, it is deleted from the domain name configuration list. A thread can be opened for the deleted domain name address to be accessed again regularly, and when it can be called, the domain name address can be added to the domain name configuration list.

[0092] According to a specific implementation of an embodiment of the present invention, when a call is made, if detection results such as Connection Time Out, Read Time Out, or Connection Reset appear, it indicates that the connection has failed. The number of multiple connection failures is counted. If the preset access failure frequency is reached (such as 5 exceptions in 5s, 7 exceptions in 10s, and 11 exceptions in 30s, which can be set according to actual conditions), the corresponding domain name address is determined to be unavailable.

[0093] Step S204, calling the API interfaces in the domain name configuration list in sequence, and determining the target domain name address according to the feedback results.

[0094] Specifically, according to an embodiment of the present invention, the corresponding API interfaces can be called in sequence according to the order of multiple domain name addresses in the domain name configuration list to determine whether the domain name address is available. If available, it is determined to be the target domain name address. Through the above settings, when the API interface call is actually executed, the API interface in the domain name configuration list is called again, so that when a failure occurs in a certain computer room and the domain name address is unavailable, the transfer process can be carried out in time, thereby improving the availability of the interface call, improving the business processing efficiency, and improving the user experience.

[0095] Step S205, encrypting the business data in the process of calling the API interface.

[0096] By encrypting the business data in the interface calling process, it can prevent the business data from being tampered with or leaked, which helps to ensure the security of user information.

[0097] Step S206, calling the API interface corresponding to the target domain name address to perform corresponding business processing.

[0098] Exemplarily, according to an embodiment of the present invention, the method further includes:

[0099] In response to the startup of the software development kit deployed on the client, if obtaining the domain name configuration list fails;

[0100] Execute the API call based on the locally stored domain name configuration list.

[0101] The above specific implementation method is a fallback strategy for this application. The SDK can also be used to periodically obtain the domain name configuration list, and then update the locally stored domain name configuration list.

[0102] According to the technical solution of the embodiment of the present invention, a domain name configuration list is obtained in response to the startup of a software development kit deployed on the client; wherein the domain name configuration list includes multiple domain name addresses and API interfaces corresponding to the domain name addresses; the API interfaces in the domain name configuration list are called in sequence, and the target domain name address is determined according to the feedback results; the API interface corresponding to the target domain name address is called to perform corresponding business processing. Therefore, the technical means overcomes the problems in the existing method that the coding in the calling process is complex, which takes up a long coding time and leads to a long time for interface docking; if a computer room fails during the calling process, the interface call is transferred to another computer room, which requires more and longer fault transfers, resulting in low interface call efficiency and poor user experience. Therefore, the domain name configuration list can be obtained by using the software development kit deployed on the client, and then the target domain name address can be determined to implement API interface calls, reduce the fault transfer time required when a fault occurs, improve interface call efficiency, and enhance user experience.

[0103] Figure 3 Schematic diagram of the main modules of the API interface calling device provided according to an embodiment of the present invention; Figure 3 As shown, the API interface calling device 300 provided in the embodiment of the present invention mainly includes:

[0104] The domain name configuration list acquisition module 301 is used to obtain a domain name configuration list in response to the startup of the software development kit deployed on the client; wherein the domain name configuration list includes multiple domain name addresses and API interfaces corresponding to the domain name addresses.

[0105] Through the above settings, a software development kit (SDK) is deployed in the client in advance. When the client starts, the SDK is loaded to obtain the domain name configuration list from the server, so that the available domain name addresses can be determined by accessing the domain name addresses in the domain name configuration list in sequence, and then the target domain name address can be quickly determined, and the corresponding API interface can be called to execute business processing, thereby improving the efficiency of interface calling.

[0106] Further, according to an embodiment of the present invention, the API interface calling device 300 further includes a sorting module, which is used to:

[0107] Receive domain name address access priority;

[0108] Sort multiple domain name addresses in the domain name configuration list according to the domain name address access priority.

[0109] By sorting multiple domain name addresses in the domain name configuration list, it is helpful to subsequently determine the available target domain name address that best meets user needs, further improving the user experience.

[0110] Preferably, according to an embodiment of the present invention, the API interface calling device 300 further includes an updating module for a locally stored domain name configuration list, which is used, after the step of obtaining the domain name configuration list, to:

[0111] It is determined whether the domain name configuration list is the same as the locally stored domain name configuration list. If different, the locally stored domain name configuration list is updated.

[0112] The locally stored domain name configuration list is updated according to the latest domain name configuration list obtained. This helps in the subsequent operation of determining the target domain name address and calling the corresponding API interface to perform business processing when the latest domain name configuration list on the server cannot be obtained. This reduces the failover time required when a failure occurs, improves the interface call efficiency, and enhances the user experience.

[0113] The target domain name address determination module 302 is used to call the API interfaces in the domain name configuration list in sequence and determine the target domain name address according to the feedback results.

[0114] Specifically, according to an embodiment of the present invention, the target domain name address determination module 302 is further used to:

[0115] Set the domain name detection cycle, and regularly call the API interface in the domain name configuration list according to the domain name detection cycle to obtain the detection results;

[0116] Update the domain name configuration list based on the detection results.

[0117] According to a specific implementation of an embodiment of the present invention, a resident thread can be started to periodically call the API interface in the domain name configuration list. When a domain name address is found to be unavailable, it is marked or deleted from the domain name configuration list (i.e., the domain name configuration list is updated according to the detection results).

[0118] Further, according to an embodiment of the present invention, the target domain name address determination module 302 is further configured to:

[0119] If the detection result is that the access is successful, the corresponding domain name address is retained in the domain name configuration list;

[0120] If the detection result is access failure, the access failure frequency is determined, and if the access failure frequency exceeds the frequency threshold, the corresponding domain name address is deleted from the domain name configuration list.

[0121] According to an embodiment of the present invention, when a domain name address is found to be unavailable, it is deleted from the domain name configuration list. A thread can be opened for the deleted domain name address to be accessed again regularly, and when it can be called, the domain name address can be added to the domain name configuration list.

[0122] The API interface calling module 303 is used to call the API interface corresponding to the target domain name address to perform corresponding business processing.

[0123] Exemplarily, according to an embodiment of the present invention, the API interface calling module 303 is further used to:

[0124] In response to the startup of the software development kit deployed on the client, if obtaining the domain name configuration list fails;

[0125] Execute the API call based on the locally stored domain name configuration list.

[0126] The above specific implementation method is a fallback strategy for this application. The SDK can also be used to periodically obtain the domain name configuration list, and then update the locally stored domain name configuration list.

[0127] Furthermore, the API interface calling device 300 further includes an encryption module, which is used to:

[0128] Encrypt the business data in the process of calling the API interface corresponding to the target domain name address.

[0129] By encrypting the business data in the interface calling process, it can prevent the business data from being tampered with or leaked, which helps to ensure the security of user information.

[0130] According to the technical solution of the embodiment of the present invention, a domain name configuration list is obtained in response to the startup of a software development kit deployed on the client; wherein the domain name configuration list includes multiple domain name addresses and API interfaces corresponding to the domain name addresses; the API interfaces in the domain name configuration list are called in sequence, and the target domain name address is determined according to the feedback results; the API interface corresponding to the target domain name address is called to perform corresponding business processing. Therefore, the technical means overcomes the problems in the existing method that the coding in the calling process is complex, which takes up a long coding time and leads to a long time for interface docking; if a computer room fails during the calling process, the interface call is transferred to another computer room, which requires more and longer fault transfers, resulting in low interface call efficiency and poor user experience. Therefore, the domain name configuration list can be obtained by using the software development kit deployed on the client, and then the target domain name address can be determined to implement API interface calls, reduce the fault transfer time required when a fault occurs, improve interface call efficiency, and enhance user experience.

[0131] Figure 4 An exemplary system architecture 400 to which the API interface calling method or API interface calling device according to the embodiment of the present invention can be applied is shown.

[0132] like Figure 4 As shown, the system architecture 400 may include terminal devices 401, 402, 403, a network 404 and a server 405 (this architecture is only an example, and the components included in the specific architecture may be adjusted according to the specific application). The network 404 is used to provide a medium for a communication link between the terminal devices 401, 402, 403 and the server 405. The network 404 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0133] Users can use terminal devices 401, 402, 403 to interact with server 405 through network 404 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 401, 402, 403, such as API interface calling applications, web browser applications, search applications, data processing tools, social platform software, etc. (only as examples).

[0134] The terminal devices 401 , 402 , and 403 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.

[0135] Server 405 may be a server that provides various services, such as a server that (calls an API interface / processes data) for users using terminal devices 401, 402, and 403 (for example only). The server may analyze and process the received domain name configuration list and other data, and feed back the processing result (for example, the target domain name address - for example only) to the terminal device.

[0136] It should be noted that the API interface calling method provided in the embodiment of the present invention is generally executed by the server 405 , and accordingly, the API interface calling device is generally set in the server 405 .

[0137] It should be understood that Figure 4 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to the implementation requirements.

[0138] Reference below Figure 5 , which shows a schematic diagram of the structure of a computer system 500 of a terminal device or a server suitable for implementing an embodiment of the present invention. Figure 5 The terminal device or server shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0139] like Figure 5 As shown, the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage part 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the system 500 are also stored. The CPU 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0140] The following components are connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed, so that a computer program read therefrom is installed into the storage section 508 as needed.

[0141] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 509, and / or installed from the removable medium 511. When the computer program is executed by the central processing unit (CPU) 501, the above-mentioned functions defined in the system of the present invention are executed.

[0142] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0143] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0144] The modules involved in the embodiments of the present invention may be implemented in software or hardware. The modules described may also be set in a processor, for example, it may be described as: a processor includes a domain name configuration list acquisition module, a target domain name address determination module and an API interface calling module. The names of these modules do not constitute a limitation on the modules themselves in some cases. For example, the domain name configuration list acquisition module may also be described as "a module for acquiring a domain name configuration list in response to the startup of a software development kit deployed on a client".

[0145] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes: in response to the startup of the software development kit deployed on the client, obtaining a domain name configuration list; wherein the domain name configuration list includes multiple domain name addresses and API interfaces corresponding to the domain name addresses; calling the API interfaces in the domain name configuration list in sequence, and determining the target domain name address according to the feedback results; calling the API interface corresponding to the target domain name address to perform corresponding business processing.

[0146] According to the technical solution of the embodiment of the present invention, a domain name configuration list is obtained in response to the startup of a software development kit deployed on the client; wherein the domain name configuration list includes multiple domain name addresses and API interfaces corresponding to the domain name addresses; the API interfaces in the domain name configuration list are called in sequence, and the target domain name address is determined according to the feedback results; the API interface corresponding to the target domain name address is called to perform corresponding business processing. Therefore, the technical means overcomes the problems in the existing method that the coding in the calling process is complex, which takes up a long coding time and leads to a long time for interface docking; if a computer room fails during the calling process, the interface call is transferred to another computer room, which requires more and longer fault transfers, resulting in low interface call efficiency and poor user experience. Therefore, the domain name configuration list can be obtained by using the software development kit deployed on the client, and then the target domain name address can be determined to implement API interface calls, reduce the fault transfer time required when a fault occurs, improve interface call efficiency, and enhance user experience.

[0147] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. An API interface calling method, characterized in that: include: In response to the startup of a software development kit deployed on a client, a domain name configuration list is obtained; wherein the domain name configuration list includes a plurality of domain name addresses and API interfaces corresponding to the domain name addresses; Call the API interfaces in the domain name configuration list in sequence, and determine the target domain name address according to the feedback results; Call the API interface corresponding to the target domain name address to perform corresponding business processing.

2. The API interface calling method according to claim 1, characterized in that: Also includes: Set a domain name detection period, and regularly call the API interface in the domain name configuration list according to the domain name detection period to obtain the detection result; The domain name configuration list is updated according to the detection result.

3. The API interface calling method according to claim 2, characterized in that: The step of updating the domain name configuration list according to the detection result includes: If the detection result is that the access is successful, the corresponding domain name address is reserved in the domain name configuration list; If the detection result is an access failure, the access failure frequency is determined, and if the access failure frequency exceeds a frequency threshold, the corresponding domain name address is deleted from the domain name configuration list.

4. The API interface calling method according to claim 1, characterized in that: Also includes: Receive domain name address access priority; The multiple domain name addresses in the domain name configuration list are sorted according to the domain name address access priority.

5. The API interface calling method according to claim 1, characterized in that: After the step of obtaining the domain name configuration list, the method further includes: It is determined whether the domain name configuration list is the same as the locally stored domain name configuration list. If they are different, the locally stored domain name configuration list is updated.

6. The API interface calling method according to claim 5, characterized in that: Also includes: In response to the startup of the software development kit deployed on the client, if obtaining the domain name configuration list fails; Execute the API call based on the locally stored domain name configuration list.

7. The API interface calling method according to claim 1, characterized in that: The step of calling the API interface corresponding to the target domain name address to perform corresponding business processing includes: The business data in the process of calling the API interface corresponding to the target domain name address is encrypted.

8. An API interface calling device, characterized in that: include: A domain name configuration list acquisition module, used to obtain a domain name configuration list in response to the startup of a software development kit deployed on a client; wherein the domain name configuration list includes a plurality of domain name addresses and API interfaces corresponding to the domain name addresses; A target domain name address determination module is used to call the API interfaces in the domain name configuration list in sequence and determine the target domain name address according to the feedback results; The API interface calling module is used to call the API interface corresponding to the target domain name address to perform corresponding business processing.

9. An electronic device called by an API interface, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.

10. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.