Nothing Special   »   [go: up one dir, main page]

CN113760398A - Interface calling method, server, system and storage medium - Google Patents

Interface calling method, server, system and storage medium Download PDF

Info

Publication number
CN113760398A
CN113760398A CN202011045838.4A CN202011045838A CN113760398A CN 113760398 A CN113760398 A CN 113760398A CN 202011045838 A CN202011045838 A CN 202011045838A CN 113760398 A CN113760398 A CN 113760398A
Authority
CN
China
Prior art keywords
interface
calling
state
identifier
request
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011045838.4A
Other languages
Chinese (zh)
Inventor
邓高天
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN202011045838.4A priority Critical patent/CN113760398A/en
Publication of CN113760398A publication Critical patent/CN113760398A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4482Procedural

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The embodiment of the application provides an interface calling method, a server, a system and a storage medium, and a calling request of an interface is obtained, wherein the calling request comprises a calling parameter and an interface identifier, and a calling state of the interface corresponding to the interface identifier when the calling parameter is used is determined from an interface state table, wherein the interface state table is used for representing the calling state of the interface under different calling parameters, and the calling request is responded according to the calling state of the interface. According to the scheme, the calling state of the interface is determined by calling the parameter and the interface identifier, and then the calling request is responded, so that the response control of different services corresponding to the calling interface is realized, and the influence of the interface calling control on the processed service is reduced.

Description

Interface calling method, server, system and storage medium
Technical Field
The present application relates to the field of information technology, and in particular, to an interface calling method, a server, a system, and a storage medium.
Background
The interface failure means that the computer system is not down and the network is not interrupted, but the computer system has a problem in processing the service. For example: a large number of accesses are timed out, or a large number of accesses are abnormal, etc.
Interface failures are mainly caused by too high a load on the computer system. The common way to deal with the interface failure is to perform processing such as current limiting and fusing. The current limiting process only allows the amount of access that the system can tolerate to come in, and excess capacity will be discarded. The fusing process is to directly stop calling the interface when the interface is found to be unavailable.
However, the current failure mode of the corresponding interface causes the computer system to be unable to continue processing the current service.
Disclosure of Invention
The embodiment of the application provides an interface calling method, a server, a system and a storage medium, aiming at reducing the influence of interface calling control on the service processed by a computer system, and the computer system can continue to process part of processing.
In a first aspect, the present application provides an interface calling method, including:
acquiring a calling request of an interface, wherein the calling request comprises a calling parameter and an interface identifier;
determining a calling state of an interface corresponding to the interface identifier when the calling parameter is used from an interface state table, wherein the interface state table is used for representing the calling state of the interface under different calling parameters;
and responding the calling request according to the calling state of the interface.
Optionally, determining, from the interface state table, a call state of the interface corresponding to the interface identifier when the call parameter is used includes:
and determining the calling state of the interface corresponding to the interface identifier when receiving a calling request initiated by equipment corresponding to the calling equipment identifier from the interface state table.
Optionally, determining, from the interface state table, a call state of the interface corresponding to the interface identifier when receiving a call request initiated by the device corresponding to the call device identifier, specifically includes:
determining the area where the calling equipment is located according to the calling equipment identifier;
and determining the calling state of the interface corresponding to the area where the calling equipment is located from the interface state table.
Optionally, determining, from the interface state table, a call state of the interface corresponding to the interface identifier when receiving a request initiated by the device corresponding to the call device identifier, specifically includes:
generating an interface state request according to the interface identifier and the calling equipment identifier;
and sending an interface state request to the state server so that the state server determines the calling state of the interface corresponding to the interface identifier when receiving the request initiated by the equipment corresponding to the calling equipment identifier from the interface state table.
Optionally, responding to the call request according to the call state of the interface specifically includes:
when the calling state of the interface when receiving a request initiated by equipment corresponding to a calling equipment identifier is a current limiting state, counting the number of times that the interface has been called in the current time period;
when the first calling times are smaller than a first preset time threshold value, continuing to call the interface; or
When the calling state of the interface when receiving a request initiated by equipment corresponding to the calling equipment identifier is a fusing state, stopping calling the interface; or
And when the calling state of the interface is a normal state when receiving the request initiated by the equipment corresponding to the calling equipment identifier, continuing to call the interface.
Optionally, after responding to the call request according to the call state of the interface, the method further includes:
and sending the response result to the state server so that the state server counts the calling state of the response result generation interface.
Optionally, the response result includes any one or more of a response time, an interface identifier, a calling device identifier, and a calling result.
In a second aspect, the present application provides an interface calling method, including:
receiving an interface state request sent by an interface server, wherein the interface state request comprises an interface identifier and interface parameters;
determining a calling state of an interface corresponding to the interface identifier when receiving a request initiated by equipment corresponding to the calling equipment identifier from an interface state table;
and sending the calling state to the interface server so that the interface server responds to the calling request according to the calling state of the interface.
Optionally, the method further comprises:
receiving a response result of the calling request sent by the interface server;
and determining the calling state of the interface according to the response result.
Optionally, determining the calling state of the interface according to the response result specifically includes:
acquiring first response time for responding to a call request in the same region;
counting a first number of first response times exceeding a preset time threshold;
when the first quantity exceeds a first preset quantity threshold value, determining that the calling state of the equipment calling interface in the area is a fusing state; or
Acquiring a first calling result responding to a calling request in the same region;
counting a second number of first invocation results indicating response failures;
when the second quantity exceeds a second preset quantity threshold value, determining that the calling state of the equipment calling interface in the area is a fusing state; or
Acquiring a second calling frequency of calling requests initiated in the same region in unit time;
and when the second calling times exceed a second preset time threshold, determining that the calling state of the equipment calling interface in the area is a current limiting state.
In a third aspect, the present application provides an interface server, comprising: a memory, a processor;
a memory; a memory for storing processor-executable instructions;
wherein the processor is configured to implement the interface call method according to the first aspect and the alternative.
In a fourth aspect, the present application provides a state server comprising: a memory, a processor;
a memory; a memory for storing processor-executable instructions;
wherein the processor is configured to implement the interface call method according to the first aspect and the alternative.
In a fifth aspect, the present application provides a calling system, including the interface server according to the third aspect and the state server according to the fourth aspect.
In a sixth aspect, the present application provides a computer-readable storage medium having stored thereon computer-executable instructions for implementing the interface calling method according to the first aspect or the second aspect or the alternative when executed by a processor.
The embodiment of the application provides an interface calling method, a server, a system and a storage medium, and the method comprises the steps of obtaining a calling parameter and an interface identifier in a calling request of an interface, determining a calling state of the interface according to the calling parameter and the interface identifier, and responding to the calling request according to the calling state of the interface. Because the calling parameter in the interface represents different services, the scheme determines the calling state of the interface through the calling parameter and the interface identifier, and then responds to the calling request, realizes response control on the different services corresponding to the calling interface, and reduces the influence of the interface calling control on the processed service. In addition, the interface calling state is determined according to the calling equipment identifier and the interface identifier, so that the control of calling interfaces of equipment in different areas can be realized, and the influence of the interface calling control on the service of the request initiated by the key area is reduced.
Drawings
Fig. 1 is a schematic structural diagram of a calling system according to an embodiment of the present application;
fig. 2 is a schematic flowchart of an interface calling method according to another embodiment of the present application;
fig. 3 is a schematic flowchart of an interface calling method according to another embodiment of the present application;
fig. 4 is a schematic structural diagram of a state server according to another embodiment of the present application;
fig. 5 is a schematic flow chart of data processing of a state server according to another embodiment of the present application;
fig. 6 is a schematic structural diagram of an interface invoking device according to another embodiment of the present application;
FIG. 7 is a schematic structural diagram of an interface invoking device according to another embodiment of the present application
Fig. 8 is a schematic structural diagram of an interface server according to another embodiment of the present application
Fig. 9 is a schematic structural diagram of a state server according to another embodiment of the present application.
Detailed Description
To make the purpose, technical solutions and advantages of the present application clearer, the technical solutions in the present application will be clearly and completely described below with reference to the drawings in the present application, and it is obvious that the described embodiments are some, but not all embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The interface failure means that the computer system is not down and the network is not interrupted, but the computer system has a problem in processing the service. For example: a large number of accesses are timed out, or a large number of accesses are abnormal, etc. Interface failures are mainly caused by too high a load on the computer system. The common way to deal with the interface failure is to perform processing such as current limiting and fusing. The current limiting process only allows the amount of access that the system can tolerate to come in, and excess capacity will be discarded. The fusing process is to directly stop calling the interface when the interface is found to be unavailable. However, the current failure mode of the corresponding interface causes the computer system to be unable to continue processing the current service.
The embodiment of the application provides an interface calling method, a server, a system and a storage medium, aiming at reducing the influence of interface calling control on the service processed by a computer system, and the computer system can continue to process part of processing. The inventive concept of the embodiment of the application is as follows: because the calling parameter in the interface represents different services, the scheme determines the calling state of the interface according to the calling parameter and the interface identifier, and further determines the mode of responding to the interface request, realizes response control on different services corresponding to the calling interface, and reduces the influence of the interface calling control on the processed service.
As shown in fig. 1, an embodiment of the present application provides an interface calling system, where the interface calling system applies an interface calling method provided in the following embodiment. The interface calling system includes an interface server 101, a state server 102, and a calling device 103. The interface server is configured to receive a call request from the call device 103, and send a call parameter and an interface identifier of an interface to the state server 102, so that the state server 102 determines an interface call state. The state server 102 sends the interface call state to the interface server 101 so that the interface server determines the manner of responding to the interface request according to the interface call state.
As shown in fig. 2, an embodiment of the present application provides an interface calling method, which is applied to an interface server, and the method includes the following steps:
s201, the interface server obtains a calling request of the interface.
Wherein an interface is a data type, a class that is more abstract than an abstract class. An interface is a collection of functions that describes only the way the function is provided. When the interface needs to be called, specific calling parameters are set to realize specific calling service. I.e. rewriting the methods in the interface class to implement the specific calling service.
The interface calling request may be sent by a calling device, or may be a call request of an interface generated inside an interface server. The call request includes a call parameter and an interface identification. And calling the parameters to realize specific calling service.
The following description takes a print interface as an example:
interface Printer interface
void print ()// printer printing method
}
When the interface is called, the specific calling parameter is input, namely, the interface printing method is rewritten, and the computer calls the printing interface. The calling code is as follows:
class computers documents Printer {// Computer calls Printer interface
@override
public void print(){
Print ln ("i is a computer");
}
}
and rewriting the interface printing method to realize the calling of the printing interface by the mobile phone. The calling code is as follows:
class SmartPhone documents Printer {// Mobile phone connected with Printer
@override
public void print(){
Print ln ("i is a smartphone"); method of println () of mobile phone
}
}
S202, the interface server determines the calling state of the interface corresponding to the interface identification when the calling parameter is used from the interface state table.
The interface state table records the calling states of the interfaces corresponding to different interface identifications under different calling parameters. Determining the calling state through the calling result of the statistical interface, for example: normal call state, current limiting state, fusing state.
The interface state table may be stored locally or in a state server. And determining the calling state of the interface corresponding to the interface identifier when the calling parameter is used from the interface state table, so as to respond to the calling request according to the calling state.
Continuing to explain by taking the print interface in S201 as an example, the interface state table records a call state when the computer calls the print interface, and also records a call state when the mobile phone calls the print interface.
S203, the interface server responds to the calling request according to the calling state of the interface.
And the mode of responding to the call request comprises stopping calling the interface or continuing calling the interface. And when the calling state of the interface when the calling parameter is used is a normal calling state, directly responding to the interface calling request. When the calling state of the interface when using the calling parameter is a current limiting state, when the calling times in unit time are less than the preset times, the interface is continuously called, otherwise, the interface is stopped calling. And when the calling state of the interface when the calling parameter is used is a fusing state, stopping calling the interface.
In the interface calling method provided by the embodiment of the application, the calling state of the interface corresponding to the interface identifier when the calling parameter is used is determined from the interface state table, and according to the corresponding calling state response mode, response control on different services corresponding to the calling interface is realized, and the influence of the interface calling control on a processed service is reduced.
As shown in fig. 3, another embodiment of the present application provides an interface calling method, which is applied to a calling system, and includes the following steps:
s301, the interface server receives a calling request of the interface sent by the calling equipment.
The calling request comprises an interface identifier and a calling equipment identifier. The calling device identification is the identification of the calling device, and the area where the calling device is located can be determined through the calling device identification.
S302, the interface server generates an interface state request according to the interface identifier and the calling equipment identifier.
The interface state request is used for requesting to obtain the calling state of the interface corresponding to the interface identifier when receiving a request initiated by equipment corresponding to the calling equipment identifier. After receiving a calling request sent by calling equipment, analyzing an interface identifier and a calling equipment identifier from the calling request, and generating a corresponding interface state request according to the interface identifier and the calling equipment identifier.
S303, the interface server sends an interface state request to the state server.
S304, the state server determines the calling state of the interface corresponding to the interface identification when receiving the request initiated by the equipment corresponding to the calling equipment identification from the interface state table.
The state server analyzes the interface state request to obtain an interface identifier and a calling equipment identifier, and searches a response interface calling state in the interface state table according to the interface identifier and the calling equipment identifier. That is, the calling state of the interface corresponding to the interface identifier when receiving the request initiated by the device corresponding to the calling device identifier is obtained.
Preferably, the area where the calling device is located is determined according to the calling device identifier, and the calling state of the interface corresponding to the area where the calling device is located is determined from the interface state table.
The statistical information and the calling state of the interface are stored in a state server in a centralized manner, the storage and the capacity expansion are adjusted according to the actual situation, the local memory resource is not relied on, the expansion is convenient, and the problem of insufficient local storage is solved. The state server obtains the calling information, calculates the calling state, and strips the calculation rule from the service interface, thereby reducing the calculation loss during calling and solving the problem that the complex rule occupies the service system resource.
S305, the interface server receives the calling state of the interface sent by the state server.
S306, the interface server responds to the calling request according to the calling state of the interface.
The calling state comprises a normal calling state, a current limiting state and a fusing state.
The normal call state means that no restriction is made on the call request. The current limiting state means that the interface is stopped to be called when the calling times of the interface in unit time exceed a preset value. The blown state is to stop calling an interface when a call request is received.
And when the calling state of the interface when receiving the request initiated by the equipment corresponding to the calling equipment identifier is a normal state, continuing to call the interface so as to respond to the calling request of the interface.
When the calling state of the interface when receiving the request initiated by the equipment corresponding to the calling equipment identifier is the current limiting state, counting the first calling times of the interface which has been called in the current time period, and continuing to call the interface when the first calling times is smaller than a first preset time threshold value so as to respond to the calling request of the interface.
And when the calling state of the interface when receiving the request initiated by the equipment corresponding to the calling equipment identifier is the fusing state, stopping calling the interface so as to respond to the calling request of the interface.
S307, the interface server sends a response result to the state server.
The response result comprises any one or more of response time, interface identification, calling equipment identification and calling result.
The response time refers to the time for responding to the call request, and the calling device identification refers to the identification of the calling device which initiates the call request. The calling result is divided into an interface calling result and a service calling result. And when the interface calling result and the service calling result are both successfully called, the calling result is successfully called. And when any one of the interface calling result and the service calling result is calling failure, the calling result is calling failure.
S308, the state server counts the response result to generate the calling state of the interface.
As one specific implementation manner, when the response result is the response time, the first response time for responding to the call request in the same area is obtained. The area where the calling device is located can be determined according to the calling device identification. Counting a first quantity of first response time exceeding a preset time threshold, and determining that the calling state of the device calling interface in the region is a fusing state when the first quantity exceeds the first preset quantity threshold.
As another specific implementation, when the response result is a call result, a first call result responding to the call request in the same region is obtained. And counting a second quantity of the first calling results indicating response failure, and determining that the calling state of the equipment calling interface in the region is a fusing state when the second quantity exceeds a second preset quantity threshold value.
As another specific embodiment, the second number of times of invocation of the invocation request initiated in the same area per unit time is obtained. And when the second calling times exceed a second preset time threshold value, determining that the calling state of the equipment calling interface in the area is a current limiting state.
In the interface calling method provided by the embodiment of the application, the calling state of the interface corresponding to the interface identifier when receiving the request initiated by the device corresponding to the calling device identifier is determined, response control over the calling requests in different areas is realized according to the corresponding calling state response mode, and the influence of the interface calling control on the processed service is reduced.
The following describes a state server provided in an embodiment of the present application with reference to specific examples. As shown in fig. 4, the state server includes external services, state calculation services, data processing, and storage.
The external service comprises a calling information storage module, an interface state acquisition module and an interface state pushing module. The data processing comprises data formatting, dimension statistics, time window information combination and distributed interface information combination. The storage comprises calling information caching, rule storage and result archiving.
Another embodiment of the present application provides an interface calling method, which is applied to a calling system, and includes the following steps:
s401, the interface server receives a calling request of an interface sent by calling equipment.
Wherein the computer device initiates a call request to call the print interface. The calling code is as follows:
ComputerA=new Computer();
Computer.print();
and parses the interface identification "Printer" and the calling device identification "120.205.57.13" from the call request.
S402, the interface server generates an interface state request according to the interface identifier and the calling equipment identifier.
After the interface identifier and the calling parameter are analyzed from the calling request, an interface state request is generated according to the interface identifier and the calling equipment identifier.
S403, the interface server sends an interface state request to the state server.
S404, determining the calling state of the interface corresponding to the interface identification when the calling parameter is used from the interface state table.
The interface state obtaining module is used for determining the calling state of the interface corresponding to the interface identifier when receiving a request initiated by equipment corresponding to the calling equipment identifier from the interface state table. And obtaining the calling state of the calling request of the computer equipment for calling the printing interface as a normal state.
S405, the interface server receives the state server calling state.
The interface state pushing module is used for sending the calling state to the interface server.
S406, the interface server responds to the calling request according to the calling state of the interface.
The calling state of the calling request for calling the printing interface initiated by the computer equipment is a normal state, and the printing interface is directly called.
S407, the interface server sends a response result to the state server.
And the interface server sends a response result responding to the calling request to the state server so that the state server generates a calling state of the interface according to the response result.
S408, the state server counts the calling state of the response result generation interface.
As shown in fig. 5, the external service receives a request for querying the interface state, takes the calculation result stored by the state calculation service from the cache, and returns the calculation result to the caller. Modules such as data formatting, dimension statistics, time window information combination, distributed interface information combination and the like in calling information data processing pushed by external services are subjected to preprocessing such as formatting, filtering and combination, and then the formatted data are stored in a cache to provide data for state calculation services. The state calculation service periodically pulls information such as configured rules from the database, takes calling information of a latest period of time from the cache, calculates according to the configured rules, and puts calculation results into the cache. And if the interface triggers the fusing rule, the interface state pushing module is used for pushing the corresponding state to the state server.
The interface of the state server is required to be called to obtain the interface state before the protected execution, whether the protected code and the service are to be executed or not is judged according to the return state, and the calling information is pushed to the state server after the calling is finished.
The state computing service pulls the configured rules in real time, and according to the calling information, the rules are from multiple dimensions: calculating the dimensionality of the method, the dimensionality of the parameters, the time, the returned result and other dimensionalities, and updating the state; since the computing service is asynchronous and resides on a state server, complex computing and convenient scaling can be supported without any impact on the system being protected.
In the interface calling method provided by the embodiment of the application, the calling state of the interface is determined by calling the parameters and the interface identifier, and then the calling request is responded, so that the response control of different services corresponding to the calling interface is realized, and the influence of the interface calling control on the processed service is reduced.
As shown in fig. 6, another embodiment of the present application provides an interface invoking device 500, where the interface invoking device 500 includes:
an obtaining module 501, configured to obtain a call request of an interface, where the call request includes a call parameter and an interface identifier;
a processing module 502, configured to determine, from an interface state table, a call state of an interface corresponding to an interface identifier when using a call parameter, where the interface state table is used to indicate the call state of the interface under different call parameters;
the processing module 502 is further configured to respond to the call request according to the call state of the interface.
Optionally, the processing module 502 is specifically configured to:
and determining the calling state of the interface corresponding to the interface identifier when receiving a calling request initiated by equipment corresponding to the calling equipment identifier from the interface state table.
Optionally, the processing module 502 is specifically configured to:
determining the area where the calling equipment is located according to the calling equipment identifier;
and determining the calling state of the interface corresponding to the area where the calling equipment is located from the interface state table.
Optionally, the processing module 502 is specifically configured to generate an interface state request according to the interface identifier and the calling device identifier;
the sending module 503 is configured to send an interface status request to the status server, so that the status server determines, from the interface status table, a call status of the interface corresponding to the interface identifier when receiving a request initiated by the device corresponding to the call device identifier.
Optionally, the processing module 502 is specifically configured to:
when the calling state of the interface when receiving a request initiated by equipment corresponding to a calling equipment identifier is a current limiting state, counting the number of times that the interface has been called in the current time period;
when the first calling times are smaller than a first preset time threshold value, continuing to call the interface; or
When the calling state of the interface when receiving a request initiated by equipment corresponding to the calling equipment identifier is a fusing state, stopping calling the interface; or
And when the calling state of the interface is a normal state when receiving the request initiated by the equipment corresponding to the calling equipment identifier, continuing to call the interface.
Optionally, the sending module 503 is specifically configured to:
and sending the response result to the state server so that the state server counts the calling state of the response result generation interface.
Optionally, the response result includes any one or more of a response time, an interface identifier, a calling device identifier, and a calling result.
As shown in fig. 7, another embodiment of the present application provides an interface calling apparatus 600, where the interface calling apparatus 600 includes:
a receiving module 601, configured to receive an interface status request sent by an interface server, where the interface status request includes an interface identifier and an interface parameter;
a processing module 602, configured to determine, from the interface state table, a call state of an interface corresponding to the interface identifier when receiving a request initiated by a device corresponding to the call device identifier;
the sending module 603 is configured to send the call state to the interface server, so that the interface server responds to the call request according to the call state of the interface.
Optionally, the processing module 602 is further configured to:
receiving a response result of the calling request sent by the interface server;
and determining the calling state of the interface according to the response result.
Optionally, the processing module 602 is further configured to:
acquiring first response time for responding to a call request in the same region;
counting a first number of first response times exceeding a preset time threshold;
when the first quantity exceeds a first preset quantity threshold value, determining that the calling state of the equipment calling interface in the area is a fusing state; or
Acquiring a first calling result responding to a calling request in the same region;
counting a second number of first invocation results indicating response failures;
when the second quantity exceeds a second preset quantity threshold value, determining that the calling state of the equipment calling interface in the area is a fusing state; or
Acquiring a second calling frequency of calling requests initiated in the same region in unit time;
and when the second calling times exceed a second preset time threshold, determining that the calling state of the equipment calling interface in the area is a current limiting state.
As shown in fig. 8, an interface server 700 according to another embodiment of the present application includes: a transmitter 701, a receiver 702, a memory 703, and a processor 702.
A transmitter 701 for transmitting instructions and data;
a receiver 702 for receiving instructions and data;
a memory 703 for storing computer-executable instructions;
the processor 704 is configured to execute the computer-executable instructions stored in the memory to implement the steps performed by the interface calling method in the above embodiments. Reference may be specifically made to the related description in the foregoing interface calling method embodiment.
Alternatively, the memory 703 may be separate or integrated with the processor 704. When the memory 703 is provided separately, the processing device further includes a bus for connecting the memory 703 and the processor 704.
As shown in fig. 9, another embodiment of the present application provides a state server 800 including: a transmitter 801, a receiver 802, a memory 803, and a processor 802.
A transmitter 801 for transmitting instructions and data;
a receiver 802 for receiving instructions and data;
a memory 803 for storing computer-executable instructions;
the processor 804 is configured to execute the computer-executable instructions stored in the memory to implement the steps performed by the interface calling method in the above embodiments. Reference may be specifically made to the related description in the foregoing interface calling method embodiment.
Alternatively, the memory 803 may be separate or integrated with the processor 804. When the memory 803 is provided separately, the processing device further includes a bus for connecting the memory 803 and the processor 804.
An embodiment of the present application further provides a computer-readable storage medium, where a computer execution instruction is stored in the computer-readable storage medium, and when the processor executes the computer execution instruction, the interface calling method executed by the processing device is implemented.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.

Claims (13)

1. An interface calling method, comprising:
acquiring a call request of an interface, wherein the call request comprises a call parameter and an interface identifier;
determining a calling state of an interface corresponding to the interface identifier when the calling parameter is used from a preset interface state table, wherein the interface state table is used for representing the calling state of the interface under different calling parameters;
and responding the calling request according to the calling state of the interface when the calling parameter is used.
2. The interface calling method according to claim 1, wherein determining a calling state of an interface corresponding to the interface identifier when the calling parameter is used from an interface state table specifically includes:
and determining the calling state of the interface corresponding to the interface identifier when receiving the calling request initiated by the calling equipment corresponding to the calling equipment identifier from the interface state table.
3. The interface calling method according to claim 2, wherein determining, from the interface state table, a calling state of the interface corresponding to the interface identifier when receiving a call request initiated by a device corresponding to a calling device identifier specifically includes:
determining the area where the calling equipment is located according to the calling equipment identifier;
and determining the calling state of the interface corresponding to the area where the calling equipment is located from the interface state table.
4. The interface calling method according to claim 2, wherein determining, from the interface state table, a calling state of the interface corresponding to the interface identifier when receiving a request initiated by a device corresponding to a calling device identifier specifically includes:
generating an interface state request according to the interface identifier and the calling equipment identifier;
and sending the interface state request to a state server so that the state server determines the calling state of the interface corresponding to the interface identifier when receiving the request initiated by the equipment corresponding to the calling equipment identifier from the interface state table.
5. The interface calling method according to claim 1, wherein responding to the call request according to the call state of the interface specifically includes:
when the calling state of the interface when receiving a request initiated by equipment corresponding to a calling equipment identifier is a current limiting state, counting a first calling frequency of the interface which is called in the current time period;
when the first calling times are smaller than a first preset time threshold value, continuing to call the interface; or
When the calling state of the interface when receiving a request initiated by equipment corresponding to the calling equipment identifier is a fusing state, stopping calling the interface; or
And when the calling state of the interface is a normal state when receiving a request initiated by equipment corresponding to the calling equipment identifier, continuing to call the interface.
6. The interface call method according to claim 1, wherein after responding to the call request according to a call state of the interface when using the call parameter, the method further comprises:
sending a response result to a state server so that the state server counts the response result to generate the calling state of the interface;
the response result comprises any one or more of response time, interface identification, calling equipment identification and calling result.
7. An interface calling method, comprising:
receiving an interface state request sent by an interface server, wherein the interface state request comprises an interface identifier and interface parameters;
determining a calling state of an interface corresponding to the interface identifier when receiving a request initiated by equipment corresponding to a calling equipment identifier from an interface state table;
and sending the calling state to the interface server so that the interface server responds to the calling request according to the calling state of the interface when the calling parameter is used.
8. The interface call method according to claim 7, further comprising:
receiving a response result of the calling request sent by the interface server;
and determining the calling state of the interface according to the response result.
9. The interface calling method according to claim 8, wherein determining a calling state of the interface when using the calling parameter according to the response result specifically includes:
acquiring first response time for responding to a call request in the same region;
counting a first number of the first response times exceeding a preset time threshold;
when the first quantity exceeds a first preset quantity threshold value, determining that the calling state of the equipment in the area calling the interface is a fusing state; or
Acquiring a first calling result responding to a calling request in the same region;
counting a second number of first invocation results indicating response failures;
when the second number exceeds a second preset number threshold, determining that the calling state of the equipment in the area for calling the interface is a fusing state; or
Acquiring a second calling frequency of calling requests initiated in the same region in unit time;
and when the second calling times exceed a second preset time threshold, determining that the calling state of the interface called by the equipment in the area is a current limiting state.
10. An interface server, comprising: a memory, a processor;
a memory; a memory for storing the processor-executable instructions;
wherein the processor is configured to implement the interface call method of any of claims 1 to 6.
11. A state server, comprising: a memory, a processor;
a memory; a memory for storing the processor-executable instructions;
wherein the processor is configured to implement the interface call method of any of claims 7 to 9.
12. A calling system comprising an interface server according to claim 10 and a state server according to claim 11.
13. A computer-readable storage medium having computer-executable instructions stored therein, which when executed by a processor, are configured to implement the interface call method of any one of claims 1 to 6 or any one of claims 7 to 9.
CN202011045838.4A 2020-09-29 2020-09-29 Interface calling method, server, system and storage medium Pending CN113760398A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011045838.4A CN113760398A (en) 2020-09-29 2020-09-29 Interface calling method, server, system and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011045838.4A CN113760398A (en) 2020-09-29 2020-09-29 Interface calling method, server, system and storage medium

Publications (1)

Publication Number Publication Date
CN113760398A true CN113760398A (en) 2021-12-07

Family

ID=78785816

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011045838.4A Pending CN113760398A (en) 2020-09-29 2020-09-29 Interface calling method, server, system and storage medium

Country Status (1)

Country Link
CN (1) CN113760398A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023231413A1 (en) * 2022-05-31 2023-12-07 杭州数梦工场科技有限公司 Service processing method, apparatus, cascade system, electronic device and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102868770A (en) * 2011-07-05 2013-01-09 腾讯科技(北京)有限公司 Method, equipment and system for distributing interface
WO2017166713A1 (en) * 2016-03-30 2017-10-05 乐视控股(北京)有限公司 Service request processing method and device
CN109976924A (en) * 2019-03-22 2019-07-05 北京奇艺世纪科技有限公司 Interface call method and device
CN110650186A (en) * 2019-09-06 2020-01-03 上海陆家嘴国际金融资产交易市场股份有限公司 Interface calling method and device, computer equipment and storage medium
CN110727555A (en) * 2019-09-20 2020-01-24 平安普惠企业管理有限公司 Service interface management method, device, medium and computer equipment
CN110858843A (en) * 2018-08-22 2020-03-03 重庆小雨点小额贷款有限公司 Service request processing method and device and computer readable storage medium
CN110995756A (en) * 2019-12-20 2020-04-10 广州酷狗计算机科技有限公司 Method and device for calling service
CN111209060A (en) * 2018-11-21 2020-05-29 中国移动通信集团广东有限公司 Capability development platform processing method and device

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102868770A (en) * 2011-07-05 2013-01-09 腾讯科技(北京)有限公司 Method, equipment and system for distributing interface
WO2017166713A1 (en) * 2016-03-30 2017-10-05 乐视控股(北京)有限公司 Service request processing method and device
CN110858843A (en) * 2018-08-22 2020-03-03 重庆小雨点小额贷款有限公司 Service request processing method and device and computer readable storage medium
CN111209060A (en) * 2018-11-21 2020-05-29 中国移动通信集团广东有限公司 Capability development platform processing method and device
CN109976924A (en) * 2019-03-22 2019-07-05 北京奇艺世纪科技有限公司 Interface call method and device
CN110650186A (en) * 2019-09-06 2020-01-03 上海陆家嘴国际金融资产交易市场股份有限公司 Interface calling method and device, computer equipment and storage medium
CN110727555A (en) * 2019-09-20 2020-01-24 平安普惠企业管理有限公司 Service interface management method, device, medium and computer equipment
CN110995756A (en) * 2019-12-20 2020-04-10 广州酷狗计算机科技有限公司 Method and device for calling service

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李中;王刚;刘;: "基于服务质量需求的存储系统动态优先权调度策略", 计算机研究与发展, no. 11, 28 November 2006 (2006-11-28) *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023231413A1 (en) * 2022-05-31 2023-12-07 杭州数梦工场科技有限公司 Service processing method, apparatus, cascade system, electronic device and storage medium

Similar Documents

Publication Publication Date Title
CN111198759B (en) Memory optimization method, system, terminal equipment and readable storage medium
WO2021000416A1 (en) Micro-service early warning method and apparatus based on management platform, and computer device
CN109902103A (en) Service data management method, device, equipment and computer readable storage medium
CN110233843B (en) User request processing method and device
CN113760398A (en) Interface calling method, server, system and storage medium
CN106612263B (en) Method and equipment for processing application access request
CN117938515A (en) Access request processing method and device, electronic equipment and storage medium
CN112148508A (en) Information processing method and related device
CN112804301A (en) Method and device for determining equipment state, gateway and storage medium
CN111367934A (en) Data consistency checking method, device, server and medium
CN115514665B (en) Service expansion method, device, electronic equipment and storage medium
CN115658745A (en) Data processing method, data processing device, computer equipment and computer readable storage medium
CN115296979A (en) Fault processing method, device, equipment and storage medium
CN111049938B (en) Message notification method and device, electronic equipment and readable storage medium
CN111010676B (en) Short message caching method, device and system
CN107957942B (en) SQL script fault repairing method and terminal thereof
CN112860292A (en) Configuration management method and device based on application
CN113971093A (en) Message processing method, device, equipment and computer storage medium
CN113411828A (en) Method, device and equipment for sensing call quality and computer readable storage medium
CN111614747B (en) Information processing method and device
CN110716963B (en) Method for providing adaptively configured user data and related equipment
CN108718285A (en) Flow control methods, device and the server of cloud computing cluster
CN110620702B (en) Pressure detection method, device and system for server
KR20010025922A (en) Exchange management function system using ooad and method for the exchange resourses installation
CN115766858A (en) Traffic processing method and device, computer readable storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination