CN113765986B - Flow control method of open platform and server - Google Patents
Flow control method of open platform and server Download PDFInfo
- Publication number
- CN113765986B CN113765986B CN202110064952.XA CN202110064952A CN113765986B CN 113765986 B CN113765986 B CN 113765986B CN 202110064952 A CN202110064952 A CN 202110064952A CN 113765986 B CN113765986 B CN 113765986B
- Authority
- CN
- China
- Prior art keywords
- application
- access
- calling interface
- interface
- calling
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 45
- 238000013475 authorization Methods 0.000 claims description 21
- 238000004590 computer program Methods 0.000 claims description 8
- 238000010586 diagram Methods 0.000 description 16
- 238000004891 communication Methods 0.000 description 6
- 230000006870 function Effects 0.000 description 6
- 230000008569 process Effects 0.000 description 6
- 238000012545 processing Methods 0.000 description 5
- 230000003287 optical effect Effects 0.000 description 4
- SPBWHPXCWJLQRU-FITJORAGSA-N 4-amino-8-[(2r,3r,4s,5r)-3,4-dihydroxy-5-(hydroxymethyl)oxolan-2-yl]-5-oxopyrido[2,3-d]pyrimidine-6-carboxamide Chemical compound C12=NC=NC(N)=C2C(=O)C(C(=O)N)=CN1[C@@H]1O[C@H](CO)[C@@H](O)[C@H]1O SPBWHPXCWJLQRU-FITJORAGSA-N 0.000 description 3
- 102100021677 Baculoviral IAP repeat-containing protein 2 Human genes 0.000 description 3
- 102100021662 Baculoviral IAP repeat-containing protein 3 Human genes 0.000 description 3
- 102100037024 E3 ubiquitin-protein ligase XIAP Human genes 0.000 description 3
- 101000896157 Homo sapiens Baculoviral IAP repeat-containing protein 2 Proteins 0.000 description 3
- 101000896224 Homo sapiens Baculoviral IAP repeat-containing protein 3 Proteins 0.000 description 3
- 101000804865 Homo sapiens E3 ubiquitin-protein ligase XIAP Proteins 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 230000008901 benefit Effects 0.000 description 2
- 239000000835 fiber Substances 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 239000004065 semiconductor Substances 0.000 description 2
- 206010033799 Paralysis Diseases 0.000 description 1
- 230000000903 blocking effect Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1001—Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/16—Threshold monitoring
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/133—Protocols for remote procedure calls [RPC]
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Storage Device Security (AREA)
- Telephonic Communication Services (AREA)
Abstract
The invention discloses a flow control method and a server for an open platform, and relates to the technical field of computers. One embodiment of the method comprises the following steps: receiving an access request to an open platform, wherein the access request comprises: an application ID authorized by the open platform and a feature identifier of a calling interface; determining a calling interface according to the characteristic identification of the calling interface; judging whether the access condition of the calling interface and the application ID combination reaches a preset current limiting condition, and if so, prohibiting the application ID from accessing through the calling interface; otherwise, the data is called for the application ID through the calling interface. The implementation mode can ensure that the calling interface in the server is balanced in use and realizes the flow control of the calling interface.
Description
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a flow control method and a server for an open platform.
Background
The open platform provides data interface capabilities for external merchants or companies through multiple servers. However, when the interfaces of the open platform are called in a large amount, the server can be paralyzed, and in order to ensure that the server can normally operate, flow control measures are generated.
The existing flow control mode mainly sets corresponding flow control threshold values for all servers, and intercepts access requests after the number of the access requests reaches the flow control threshold values.
In the process of implementing the present invention, the inventor finds that at least the following problems exist in the prior art:
The existing flow control mode does not consider the calling condition of a plurality of calling interfaces in the server, and can cause unbalanced use of the calling interfaces in the server, so that the calling interfaces are knocked down.
Disclosure of Invention
In view of this, the embodiment of the invention provides a flow control method and a server for an open platform, which can ensure that a call interface in the server is balanced in use and realize flow control for the call interface.
To achieve the above object, according to an aspect of the embodiments of the present invention, there is provided a flow control method for an open platform, including:
Receiving an access request to the open platform, wherein the access request comprises: the application ID authorized by the open platform and the feature identification of the calling interface;
determining a calling interface according to the characteristic identification of the calling interface;
judging whether the access condition of the calling interface and the application ID combination reaches a preset current limiting condition, and if so, prohibiting the application ID from accessing through the calling interface; otherwise, calling data for the application ID through the calling interface.
Preferably, the current limiting condition includes:
The current access quantity of the calling interface reaches a preset interface access threshold;
And/or the number of the groups of groups,
The access amount of the application ID in a set time period reaches an ID access threshold value of the application ID;
And/or the number of the groups of groups,
And the call quantity of the application ID to the call interface reaches a call threshold value allocated to the application ID by the call interface.
Preferably, the method comprises the steps of,
The access request further includes: authorization credentials for data to be accessed;
after judging that the combination of the calling interface and the application ID does not reach the preset current limiting condition, the method further comprises the following steps:
Judging whether the number of access requests comprising the authorization credentials in a set time period reaches a data access threshold of data to be accessed, if so, executing the step of prohibiting the access of the application ID through the calling interface, otherwise, executing the step of calling the data for the application ID through the calling interface.
Preferably, after determining that the combination of the calling interface and the application ID does not reach the preset current limit condition, the method further includes:
Judging whether the current access quantity of the server receiving the access request reaches a single machine access threshold of the server, if so, executing the step of prohibiting the access of the application ID through the call interface; otherwise, executing the step of calling data for the application ID through the calling interface.
Preferably, the method comprises the steps of,
The open platform is deployed on a plurality of servers;
the method further comprises: aiming at the servers, managing access conditions of application IDs and calling interfaces deployed on the servers through cache middleware; and manage the current limiting conditions of the multiple servers;
After any one of the servers receives the access request of the open platform, acquiring the access condition of the combination of the calling interface and the application ID from the access conditions of the servers managed by the cache middleware; and obtaining corresponding current limiting conditions from the cache middleware.
Preferably, the caching the access condition of the application ID managed by the middleware and the call interface deployed on the server includes:
any one or more of the current access amount of the calling interface, the access amount of the application ID in a set time period and the number of access requests comprising the same application ID and the characteristic identification of the same calling interface.
Preferably, the method comprises the steps of,
When a plurality of said servers receive a plurality of said access requests including the same said application ID and the same said identification of the characteristics of the call interface, and one of said servers responds to said access request,
And intercepting the access request by other servers in the plurality of servers.
In a second aspect, an embodiment of the present invention provides an open platform flow control server, including:
The receiving module is configured to receive an access request to the open platform, where the access request includes: the application ID authorized by the open platform and the feature identification of the calling interface;
The interface determining module is used for determining a calling interface according to the characteristic identification of the calling interface;
The flow control module is used for judging whether the access condition of the calling interface and the application ID combination reaches a preset current limiting condition, and if so, the application ID is forbidden to be accessed through the calling interface; otherwise, calling data for the application ID through the calling interface.
Preferably, the method comprises the steps of,
And the flow control module is further used for judging whether the number of access requests comprising authorization credentials of the data to be accessed reaches a data access threshold of the data to be accessed in a set time period after judging that the combination of the calling interface and the application ID does not reach a preset current limiting condition, if so, executing the step of prohibiting the access of the application ID through the calling interface, otherwise, executing the step of calling the data for the application ID through the calling interface.
One embodiment of the above invention has the following advantages or benefits: because the access condition of the calling interface and the application ID combination is comprehensively considered, whether the flow of the calling interface is limited or not is determined by judging whether the access condition of the calling interface and the application ID combination reaches a preset flow limiting condition, the control of the flow of the calling interface is realized.
Further effects of the above-described non-conventional alternatives are described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of an open platform deployment architecture according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of the main flow of an open platform flow control method according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of the main flow of authorization credential throttling based on data to be accessed according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a main flow based on single-machine current limiting during a service period according to an embodiment of the invention;
FIG. 5 is a schematic diagram of the main flow of multi-server flow control according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of the main flow of multi-server interaction with caching middleware according to an embodiment of the invention;
FIG. 7 is a schematic diagram of the main flow of an open platform flow control method according to another embodiment of the present invention;
FIG. 8 is a schematic diagram of the major modules of an open platform flow control server according to an embodiment of the present invention;
FIG. 9 is a schematic diagram of the primary devices of an open platform flow control system according to an embodiment of the present invention;
FIG. 10 is an exemplary system architecture diagram in which embodiments of the present invention may be applied;
Fig. 11 is a schematic diagram of a computer system suitable for use in implementing an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention will now be described with reference to the accompanying drawings, in which various details of the embodiments of the present invention are included to facilitate understanding, and are to be considered merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
The open platform is capable of providing data interface capabilities for external merchants or companies. For example, the open platform manages a large amount of data such as various merchant data, and other companies can obtain merchant data at the open platform through the interface. The open platform is often deployed on multiple servers in order to be able to handle a large number of access requests. The architecture of an open platform deployment is shown in fig. 1.
As can be seen from fig. 1, the open platform is deployed on a plurality of servers 1,2, …, n, and each server is deployed with a plurality of call interfaces API1, API2, API3, …. An external user may access data authorized for an application ID number (APPKEY) by applying the application ID number (APPKEY) to the open platform, via the call interfaces API1, API2, API3, ….
Wherein an application ID number (APPKEY) corresponds to an application or plug-in whose value may access a portion of the data on the open platform. For example, the application ID number (AP PKEY) for the order application/add-in may access order related data, the application ID number (AP PKEY) for the merchandise application/add-in may access merchandise related data, and so on.
In addition, the external user wants to obtain data of other merchants or other users through the open platform, and needs to obtain authorization credentials (TOKEN) of other merchants or other users. That is, the external user wants to access the data of other merchants or other users, needs to have an application ID number (APPK EY) and obtain the authorization credentials (TOKEN) of other merchants or other users, so as to call the call interfaces API1, API2, API3 and … in fig. 1 to access the authorized data.
However, since the calling interface has a calling limit, the same calling interface is called by a large number of access requests, which may cause the calling interface to crash. The existing current method for limiting the current of the server cannot prevent the calling interface from crashing.
In order to prevent the call interfaces of the open platform from crashing due to oversized access requests, and in order to balance the call interfaces of the open platform for each application ID number (APPKEY), frequent calls of certain application ID numbers (APPKEY) to the call interfaces are prevented. The embodiment of the invention provides a flow control method of an open platform.
Fig. 2 is a flow control method of an open platform according to an embodiment of the present invention, as shown in fig. 2, the flow control method of the open platform may include the following steps:
Step S201: receiving an access request to an open platform, wherein the access request comprises: an application ID authorized by the open platform and a feature identifier of a calling interface;
step S202: determining a calling interface according to the characteristic identification of the calling interface;
step S203: judging whether the access condition of the calling interface and the application ID combination reaches a preset current limiting condition, if so, executing step S204; otherwise, step S204 is performed;
step S204: the application ID is forbidden to be accessed through the calling interface, and the current flow is ended;
step S205: and calling data for the application ID through a calling interface.
The feature identifier of the calling interface refers to an identifier capable of uniquely characterizing the calling interface, for example, a code, a number, etc. of the calling interface. In the process of deploying the calling interface, the interface provider can set a limiting flow value for the calling interface, such as 1w times/min. In addition, a corresponding category can be set for the calling interface, such as an order management calling interface, a commodity information calling interface and the like, wherein the order management calling interface is mainly used for providing a service for calling data related to order management, and the commodity information calling interface is mainly used for providing a service for calling data related to commodity information.
The access condition of the combination of the calling interface and the application ID mainly refers to the condition that the application ID calls the calling interface, for example, the number of times of calling the calling interface in a set period of time, and the like.
The calling interface may allocate a corresponding APPKEY traffic packet to each application ID according to the priority, the weight, etc. of each application ID.
In the embodiment shown in fig. 2, because the access condition of the calling interface and the application ID combination is comprehensively considered, and whether the flow of the calling interface is controlled by judging whether the access condition of the calling interface and the application ID combination reaches a preset flow limiting condition or not is determined, in addition, the calling of the application ID to the interface can be controlled by combining the application ID, the same application ID is prevented from frequently calling the same interface, the calling of each application ID to the calling interface is balanced, and the flow of the calling interface is further controlled from the dimension of the application ID.
Wherein the flow limiting conditions may include: calling the current access quantity of the interface to reach a preset interface access threshold; and/or the access amount of the application ID in the set time period reaches the ID access threshold value of the application ID; and/or the call quantity of the application ID to the call interface reaches the call threshold value allocated by the call interface for the application ID.
The current access amount of the calling interface may refer to a total access amount of the calling interface in a current set time, and the current set time may be 1min, 5min, and the like.
The call amount of the application ID to the call interface may refer to a total access amount of the application ID to one call interface in the current set time.
The interface access threshold, the ID access threshold and the call threshold may be set accordingly according to actual requirements.
After the application ID is applied, the interface provider or the server allocates a corresponding APPKEY traffic packet for the application ID, so that the application ID is accessed based on the APPKEY traffic packet. For example, APPKEY (application ID) in test state, call interface (API) default traffic packet 1000 times/day; when APPKEY is on-line, a APPKEY traffic packet (e.g., 300W/day) is presented, etc., according to the operating policy configuration.
The current limiting condition realizes the current limiting and limiting of the calling interface from multiple dimensions (calling interface dimension: interface access threshold of the calling interface; application ID dimension: ID access threshold; calling interface and application ID combining dimension: calling threshold), and further ensures the running stability of the calling interface.
In an embodiment of the present invention, the access request may further include: authorization credentials for data to be accessed; accordingly, as shown in fig. 3, after determining that the combination of the calling interface and the application ID does not reach the preset current limit condition, the method may further include the following steps to implement current limit based on the authorization TOKEN (TOKEN) of the data to be accessed.
Step S301: judging whether the number of access requests including the authorization credentials within a set time period reaches a data access threshold of the data to be accessed, and if so, executing step S302; otherwise, step S303 is performed;
Step S302: access of the application ID through the calling interface is forbidden;
step S303: and calling data for the application ID through a calling interface.
Through the authorization credential dimension-based flow control, on one hand, the security of stored data can be ensured, and on the other hand, the user is prevented from frequently attacking the open platform through the authorization credential, so that the operation stability and the security of the open platform are further improved.
In an embodiment of the present invention, in order to enable the flow control to the server, as shown in fig. 4, the method may further include the following steps:
step S401: judging whether the current access quantity of the server receiving the access request reaches a single machine access threshold value of the server, if so, executing step S402; otherwise, step S403 is executed;
Step S402: access of the application ID through the calling interface is forbidden;
Step S403: and calling data for the application ID through a calling interface.
By controlling the flow based on the server dimension, the running stability and the safety of the open platform are further improved.
In the embodiment of the invention, an open platform is deployed on a plurality of servers; in order to avoid that the same access request initiates access on different servers, which causes waste of server resources, as shown in fig. 5 and fig. 6, the above method may further include the following steps:
step S501: aiming at a plurality of servers, managing access conditions of application IDs and calling interfaces deployed on the servers through cache middleware; and manage the current limiting condition of a plurality of servers;
Step S502: after any server receives an access request of an open platform, acquiring an access condition of calling interface and application ID combination from access conditions of a plurality of servers managed by a cache middleware; and obtaining the corresponding current limiting condition from the cache middleware.
As shown in fig. 6, the caching middleware stores the flow restriction condition, the flow control rule, and accumulates the number of requests of the access request having the same application ID, TOKEN, and feature identifier of the calling interface received by each server, etc. After a plurality of access requests with the same application ID, TOKEN and the feature identifier of the calling interface are sent to the server 1 and the server 2, the server 1 and the server 2 analyze the access requests, acquire the current limiting condition, the current control rule and the like from the cache middleware according to the application ID, TOKEN and the feature identifier of the calling interface included in the access requests, and if the server 1 judges that the access requests conform to the current limiting condition, the current control rule based on the current limiting condition, the current control rule, the access times of the access requests of the feature identifiers of the same application ID, TOKEN and calling interface and the like, the server 1 allows the access requests to access, and enables the cache middleware to send the access times of the access requests of the same application ID, TOKEN and the feature identifier of the calling interface to be added by 1. After the server 2 acquires the information such as the access times of the access requests of the same application ID, TOKEN and the feature identifier of the calling interface from the cache middleware again, the server 2 does not allow the access requests to continue to access because the access times meet the current limiting condition and the like, and returns an error result of 'the flow is exhausted' for the terminal device sending the access requests.
In the embodiment of the present invention, the access situations of the application ID managed by the cache middleware and the call interface deployed on the server may include: any one or more of the current access amount of the calling interface, the access amount of the application ID in a set time period and the number of access requests comprising the same application ID and the characteristic identification of the same calling interface.
The access conditions of the calling interfaces are managed in a unified way through the cache middleware, and the access conditions of all servers can be managed in a unified way. Each server can know whether the received access request has obtained data from other servers, so that server blocking caused by frequent access of multiple servers by the access request of the same application ID, TOKEN and feature identifier of the calling interface is avoided.
In the embodiment of the invention, when a plurality of servers receive a plurality of access requests comprising the same application ID and the characteristic identifier of the same calling interface, and one of the plurality of servers responds to the access request, the other servers intercept the access request.
As shown in fig. 7, taking one server of a plurality of servers deployed with an open platform as an example, the embodiment of the present invention expands and describes a flow control method of the open platform, where the flow control method of the open platform may include the following steps:
Step S701: the server receives an access request to the open platform, wherein the access request comprises: an application ID authorized by the open platform, a feature identifier of a calling interface and an authorization credential of data to be accessed;
Step S702: the server judges whether the current access quantity of the server reaches a single machine access threshold value of the server, if so, step S708 is executed; otherwise, step S703 is performed;
Step S703: determining a calling interface according to the characteristic identification of the calling interface;
Step S704: judging whether the calling interface reaches an interface access threshold, if so, executing step S708; otherwise, step S705 is performed;
Step S705: the server acquires the application ID, the feature identification of the calling interface, the current limiting condition of the authorization credential combination, the application ID, the feature identification of the calling interface and the access times corresponding to the authorization credential combination from the cache middleware;
step S706: judging whether the access times of the application ID to the call interface reach an ID access threshold value, if so, executing step S708; otherwise, step S707 is performed;
Step S707: judging whether the number of the access requests of the authorization credentials reaches a data access threshold of the data to be accessed within a set time period, and if so, executing step S708; otherwise, step S709 is performed;
Step S708: the application ID is forbidden to be accessed through the calling interface, and the current flow is ended;
Step S709: and calling data for the application ID through a calling interface.
As shown in fig. 8, an embodiment of the present invention provides an open platform flow control server 800, where the open platform flow control server 800 may include:
A receiving module 801, configured to receive an access request to an open platform, where the access request includes: an application ID authorized by the open platform and a feature identification of the calling interface 804;
An interface determining module 802, configured to determine a calling interface 804 according to the feature identifier of the calling interface 804;
The flow control module 803 is configured to determine whether an access condition of the combination of the calling interface 804 and the application ID reaches a preset current limit condition, and if so, prohibit the application ID from being accessed through the calling interface 804; otherwise, data is invoked for the application ID through the invocation interface 804.
In an embodiment of the present invention, the flow restriction conditions set by the flow control module 803 may include: calling the current access quantity of the interface to reach a preset interface access threshold; and/or the access amount of the application ID in the set time period reaches the ID access threshold value of the application ID; and/or the call quantity of the application ID to the call interface reaches the call threshold value allocated by the call interface for the application ID.
In the embodiment of the present invention, the flow control module 803 is further configured to determine, after determining that the combination of the calling interface and the application ID does not reach the preset current limit condition, whether the number of access requests including the authorization credentials of the data to be accessed in the set period of time reaches the data access threshold of the data to be accessed, if so, execute the step of prohibiting the access of the application ID through the calling interface 804, otherwise, execute the step of calling the data for the application ID through the calling interface 804.
In the embodiment of the present invention, the flow control module 803 is further configured to, after determining that the combination of the calling interface and the application ID does not reach the preset current limiting condition, determine whether the current access amount of the server receiving the access request reaches the single access threshold of the server, and if so, execute the step of prohibiting the access of the application ID through the calling interface 804; otherwise, the step of calling data for the application ID through the call interface 804 is performed.
In the embodiment of the present invention, the flow control module 803 is further configured to obtain, after receiving an access request of the open platform, an access condition of a combination of a calling interface and an application ID from access conditions of a plurality of servers managed by an external cache middleware; and obtaining the corresponding current limiting condition from the cache middleware.
In the embodiment of the present invention, the access situations of the application ID managed by the cache middleware and the call interface deployed on the server may include: any one or more of the current access amount of the calling interface, the access amount of the application ID in a set time period and the number of access requests comprising the same application ID and the characteristic identification of the same calling interface.
As shown in fig. 9, an embodiment of the present invention provides an open platform flow control system, which includes a plurality of servers 901 and a caching middleware 902, wherein,
The cache middleware 902 is used for managing the access conditions of the application ID and the calling interface deployed on the server; and manage the current limiting condition of a plurality of servers;
the server 901 is configured to obtain, from among access conditions of a plurality of servers managed by the cache middleware, an access condition of a combination of a calling interface and an application ID after receiving an access request of the open platform; and obtaining the corresponding flow limiting conditions from the cache middleware, so as to realize the flow control method of the open platform provided by each embodiment.
In an embodiment of the present invention, the access situations of the application ID managed by the cache middleware 902 and the call interface deployed on the server may include: any one or more of the current access amount of the calling interface, the access amount of the application ID in a set time period and the number of access requests comprising the same application ID and the characteristic identification of the same calling interface.
In the embodiment of the present invention, a server 901 is configured to intercept an access request that includes the same application ID and the feature identifier of the same call interface, which are the same as other servers, when it has been determined that one server responds to the access request; if the other servers do not respond to the access request, the relevant calling interfaces are called for the access request, and a message that the access request has obtained the calling interfaces is sent to the cache middleware 902, so that the cache middleware records the message, and the other servers can conveniently and accurately know whether the access request is completed or not.
Fig. 10 illustrates an exemplary system architecture 1000 of an open platform flow control method or open platform flow control server to which embodiments of the present invention may be applied.
As shown in fig. 10, the system architecture 1000 may include terminal devices 1001, 1002, 1003, a network 1004, an open platform server 1005, and a cache server 1006. The network 1004 is a medium for providing a communication link between the terminal devices 1001, 1002, 1003 and the open platform server 1005, and between the open platform server 1005 and the cache server 1006. The network 1004 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
A user may interact with the open platform server 1005 over the network 1004 using the terminal devices 1001, 1002, 1003 to receive or send messages or the like. The terminal devices 1001, 1002, 1003 may have installed thereon various service applications APPKEY provided by an open platform, such as an order application, order plug-in, merchandise plug-in, etc. (for example only).
The terminal devices 1001, 1002, 1003 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop and desktop computers, and the like.
The open platform server 1005 may be a server providing various services, such as a background management server (merely an example) providing storage and management of data requested by a user using the terminal apparatuses 1001, 1002, 1003. The background management server may analyze and process the received data such as the access request, and feed back the processing result (e.g., information about access rejection, data requested by the user—only an example) to the terminal device.
The cache server 1006 may be a server that provides various services for the open platform server 1005, such as a background management server (by way of example only) that provides storage and management for throttling conditions, access situations, etc. requested by the open platform server 1005. The cache server 1006 may analyze and process data such as an access request sent by the open platform server 1005, and feed back the processing result (e.g., information that the access request has been processed, a current limit condition—just an example) to the open platform server 1005.
It should be noted that, the flow control method of the open platform provided by the embodiment of the present invention is generally executed by the open platform server 1005.
It should be understood that the number of terminal devices, networks, open platform servers, and cache servers in fig. 10 are merely illustrative. There may be any number of terminal devices, networks, open platform servers, and cache servers, as desired for implementation.
Referring now to FIG. 11, there is illustrated a schematic diagram of a computer system 1100 suitable for use in implementing the terminal device of an embodiment of the present invention. The terminal device or server shown in fig. 11 is only an example, and should not impose any limitation on the functions and scope of use of the embodiments of the present invention.
As shown in fig. 11, the computer system 1100 includes a Central Processing Unit (CPU) 1101 that can execute various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 1102 or a program loaded from a storage portion Y08 into a Random Access Memory (RAM) 1103. In the RAM 1103, various programs and data required for the operation of the system 1100 are also stored. The CPU 1101, ROM 1102, and RAM 1103 are connected to each other by a bus 1104. An input/output (I/O) interface 1105 is also connected to bus 1104.
The following components are connected to the I/O interface 1105: an input section 1106 including a keyboard, a mouse, and the like; an output portion 1107 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like; a storage section 1108 including a hard disk or the like; and a communication section 1109 including a network interface card such as a LAN card, a modem, and the like. The communication section 1109 performs communication processing via a network such as the internet. The drive 1110 is also connected to the I/O interface 1105 as needed. Removable media 1111, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like, is installed as needed in drive 1110, so that a computer program read therefrom is installed as needed in storage section 1108.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network via the communication portion 1109, and/or installed from the removable media 1111. The above-described functions defined in the system of the present invention are performed when the computer program is executed by the central processing unit (C PU) 1101.
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 two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules involved in the embodiments of the present invention may be implemented in software or in hardware. The described modules may also be provided in a processor, for example, as: a processor includes a receiving module, an interface determination module, and a flow control module. The names of these modules do not in any way constitute a limitation of the module itself, for example, a receiving module may also be described as a "module receiving an access request to the open platform".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be present alone without being fitted into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to include: receiving an access request to an open platform, wherein the access request comprises: an application ID authorized by the open platform and a feature identifier of a calling interface; determining a calling interface according to the characteristic identification of the calling interface; judging whether the access condition of the calling interface and the application ID combination reaches a preset current limiting condition, and if so, prohibiting the application ID from accessing through the calling interface; otherwise, the data is called for the application ID through the calling interface.
According to the technical scheme of the embodiment of the invention, because the access condition of the calling interface and the application ID combination is comprehensively considered, whether the flow of the calling interface is controlled is determined by judging whether the access condition of the calling interface and the application ID combination reaches the preset flow limiting condition, in addition, the calling of the application ID to the interface can be controlled by combining the application ID, the same application ID is prevented from frequently calling the same interface, the calling of each application ID to the calling interface is balanced, and the flow of the calling interface is further controlled from the dimension of the application ID.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives can occur depending upon design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.
Claims (9)
1. A method of flow control for an open platform, comprising:
Receiving an access request to the open platform, wherein the access request comprises: the application ID authorized by the open platform and the feature identification of the calling interface;
determining a calling interface according to the characteristic identification of the calling interface;
Judging whether the access condition of the calling interface and the application ID combination reaches a preset current limiting condition, and if so, prohibiting the application ID from accessing through the calling interface; otherwise, calling data for the application ID through the calling interface;
the open platform is deployed on a plurality of servers;
the method further comprises: aiming at the servers, managing access conditions of application IDs and calling interfaces deployed on the servers through cache middleware; and manage the current limiting conditions of the multiple servers;
After any one of the servers receives the access request of the open platform, acquiring the access condition of the combination of the calling interface and the application ID from the access conditions of the servers managed by the cache middleware; obtaining corresponding current limiting conditions from the cache middleware;
And after a plurality of servers receive a plurality of access requests comprising the same application ID, the same authorization credential and the same feature identification of the call interface, one of the servers responds to the access requests, and the other servers intercept the access requests.
2. The open platform flow control method of claim 1 wherein the flow restricting conditions comprise:
The current access quantity of the calling interface reaches a preset interface access threshold;
And/or the number of the groups of groups,
The access amount of the application ID in a set time period reaches an ID access threshold value of the application ID;
And/or the number of the groups of groups,
And the call quantity of the application ID to the call interface reaches a call threshold value allocated to the application ID by the call interface.
3. The method of claim 1, wherein the flow control of the open platform,
The access request further includes: authorization credentials for data to be accessed;
after judging that the combination of the calling interface and the application ID does not reach the preset current limiting condition, the method further comprises the following steps:
Judging whether the number of access requests comprising the authorization credentials in a set time period reaches a data access threshold of data to be accessed, if so, executing the step of prohibiting the access of the application ID through the calling interface, otherwise, executing the step of calling the data for the application ID through the calling interface.
4. A method of flow control for an open platform according to any one of claims 1 to 3, further comprising:
Judging whether the current access quantity of the server receiving the access request reaches a single machine access threshold of the server, if so, executing the step of prohibiting the access of the application ID through the call interface; otherwise, executing the step of calling data for the application ID through the calling interface.
5. The flow control method of the open platform according to claim 1, wherein the caching of the application ID managed by the middleware and the access condition of the call interface deployed on the server includes:
any one or more of the current access amount of the calling interface, the access amount of the application ID in a set time period and the number of access requests comprising the same application ID and the characteristic identification of the same calling interface.
6. An open platform flow control server, comprising:
The receiving module is configured to receive an access request to the open platform, where the access request includes: the application ID authorized by the open platform and the feature identification of the calling interface;
The interface determining module is used for determining a calling interface according to the characteristic identification of the calling interface;
The flow control module is used for judging whether the access condition of the calling interface and the application ID combination reaches a preset current limiting condition, and if so, the application ID is forbidden to be accessed through the calling interface; otherwise, calling data for the application ID through the calling interface;
Aiming at a plurality of servers included in the open platform, managing access conditions of an application ID and a calling interface deployed on the servers through a cache middleware; and manage the current limiting condition of a plurality of servers;
After any one of the servers receives the access request of the open platform, acquiring the access condition of the combination of the calling interface and the application ID from the access conditions of the servers managed by the cache middleware; obtaining corresponding current limiting conditions from the cache middleware; and after a plurality of servers receive a plurality of access requests comprising the same application ID, the same authorization credential and the same feature identification of the call interface, one of the servers responds to the access requests, and the other servers intercept the access requests.
7. The open platform flow control server of claim 6 wherein,
And the flow control module is further used for judging whether the number of access requests comprising authorization credentials of the data to be accessed reaches a data access threshold of the data to be accessed in a set time period after judging that the combination of the calling interface and the application ID does not reach a preset current limiting condition, if so, executing the step of prohibiting the access of the application ID through the calling interface, otherwise, executing the step of calling the data for the application ID through the calling interface.
8. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs,
When executed by the one or more processors, causes the one or more processors to implement the method of any of claims 1-5.
9. A computer readable medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any of claims 1-5.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202110064952.XA CN113765986B (en) | 2021-01-18 | 2021-01-18 | Flow control method of open platform and server |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202110064952.XA CN113765986B (en) | 2021-01-18 | 2021-01-18 | Flow control method of open platform and server |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN113765986A CN113765986A (en) | 2021-12-07 |
| CN113765986B true CN113765986B (en) | 2024-05-21 |
Family
ID=78786362
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202110064952.XA Active CN113765986B (en) | 2021-01-18 | 2021-01-18 | Flow control method of open platform and server |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN113765986B (en) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN115567449A (en) * | 2022-09-07 | 2023-01-03 | 浙江极氪智能科技有限公司 | An access request processing method and device |
| CN116680330A (en) * | 2023-06-02 | 2023-09-01 | 北京沃东天骏信息技术有限公司 | Interface call method, device, equipment and storage medium |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103379090A (en) * | 2012-04-12 | 2013-10-30 | 腾讯科技(北京)有限公司 | Open platform access frequency control method and system and frequency server |
| CN109949064A (en) * | 2017-12-20 | 2019-06-28 | 北京京东尚科信息技术有限公司 | A kind of open interface calls charging method and device |
| CN110535777A (en) * | 2019-08-12 | 2019-12-03 | 新华三大数据技术有限公司 | Access request control method, device, electronic equipment and readable storage medium storing program for executing |
| CN110661815A (en) * | 2019-10-22 | 2020-01-07 | 中国林业科学研究院热带林业研究所 | Request processing method, device, system and medium based on frequency limitation microservice |
| CN111741016A (en) * | 2020-07-23 | 2020-10-02 | 南京梦饷网络科技有限公司 | Method, computing device, and computer storage medium for managing application interfaces |
-
2021
- 2021-01-18 CN CN202110064952.XA patent/CN113765986B/en active Active
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103379090A (en) * | 2012-04-12 | 2013-10-30 | 腾讯科技(北京)有限公司 | Open platform access frequency control method and system and frequency server |
| CN109949064A (en) * | 2017-12-20 | 2019-06-28 | 北京京东尚科信息技术有限公司 | A kind of open interface calls charging method and device |
| CN110535777A (en) * | 2019-08-12 | 2019-12-03 | 新华三大数据技术有限公司 | Access request control method, device, electronic equipment and readable storage medium storing program for executing |
| CN110661815A (en) * | 2019-10-22 | 2020-01-07 | 中国林业科学研究院热带林业研究所 | Request processing method, device, system and medium based on frequency limitation microservice |
| CN111741016A (en) * | 2020-07-23 | 2020-10-02 | 南京梦饷网络科技有限公司 | Method, computing device, and computer storage medium for managing application interfaces |
Also Published As
| Publication number | Publication date |
|---|---|
| CN113765986A (en) | 2021-12-07 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US20210185093A1 (en) | Fine grained network security | |
| US20240259474A1 (en) | Method and procedure for dynamic services orchestration that runs within an on-device software container | |
| CN109478134B (en) | Executing on-demand network code with cross-account aliases | |
| US11716325B2 (en) | Limiting scopes in token-based authorization systems | |
| US20220217182A1 (en) | Dynamic security policy management | |
| US10331505B2 (en) | Application programming interface (API) hub | |
| US10757079B2 (en) | Method and system for controlling remote session on computer systems using a virtual channel | |
| US11509693B2 (en) | Event-restricted credentials for resource allocation | |
| US10481756B2 (en) | Controlling application access to applications and resources via graphical representation and manipulation | |
| US10831915B2 (en) | Method and system for isolating application data access | |
| US20200412736A1 (en) | Dynamic security policy consolidation | |
| US20130276120A1 (en) | System, method, and computer program product for determining whether a security status of data is known at a server | |
| US10757088B2 (en) | YARN REST API protection | |
| US20130298203A1 (en) | Apparatus and method of providing security to cloud data to prevent unauthorized access | |
| US20130160115A1 (en) | Sandboxing for multi-tenancy | |
| US10178103B2 (en) | System and method for accessing a service | |
| CN115203653A (en) | Associating user accounts with enterprise workspaces | |
| CN113765986B (en) | Flow control method of open platform and server | |
| US9906510B2 (en) | Virtual content repository | |
| CN117193940A (en) | Data access method, device, electronic equipment and computer readable medium | |
| US11431711B2 (en) | Method, device and computer program product for service access | |
| US11411813B2 (en) | Single user device staging | |
| CN118449989A (en) | Method, apparatus, device and computer readable medium for calling business service | |
| CN112953719A (en) | Token authentication method and device | |
| CN114374657B (en) | Data processing method and device |
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 | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |