CN110865895A - Access flow control method and device, electronic equipment and storage medium - Google Patents
Access flow control method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN110865895A CN110865895A CN201911024086.0A CN201911024086A CN110865895A CN 110865895 A CN110865895 A CN 110865895A CN 201911024086 A CN201911024086 A CN 201911024086A CN 110865895 A CN110865895 A CN 110865895A
- Authority
- CN
- China
- Prior art keywords
- access
- provider system
- target provider
- interface
- target
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 48
- 238000012545 processing Methods 0.000 claims abstract description 16
- 230000001934 delay Effects 0.000 claims abstract description 5
- 230000003111 delayed effect Effects 0.000 claims description 50
- 230000004044 response Effects 0.000 claims description 29
- 230000002159 abnormal effect Effects 0.000 claims description 21
- 238000004590 computer program Methods 0.000 claims description 10
- 238000012544 monitoring process Methods 0.000 claims description 3
- 230000009286 beneficial effect Effects 0.000 abstract 1
- 238000011144 upstream manufacturing Methods 0.000 description 7
- 230000005856 abnormality Effects 0.000 description 6
- 230000005540 biological transmission Effects 0.000 description 3
- 230000001419 dependent effect Effects 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 230000003139 buffering effect Effects 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 230000015556 catabolic process Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000006731 degradation reaction Methods 0.000 description 1
- 230000000593 degrading effect Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000008676 import Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000007726 management method Methods 0.000 description 1
- 238000013507 mapping Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 238000011084 recovery Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/004—Error avoidance
-
- 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
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer And Data Communications (AREA)
Abstract
The embodiment of the application discloses an access flow control method, belongs to the technical field of computers, and is beneficial to solving the problem of system abnormity caused by overload of system flow of a certain provider. The method comprises the following steps: the direct connection system responds to the interface call for accessing the target provider system and calls an access request permission interface of the flow control module; the flow control module responds to the calling operation of the access request permission interface and outputs a return result according to the real-time state of the target supplier system, wherein the return result comprises: allowing real-time access to the target provider system or delaying access to the target provider system; and the direct connection system responds to a return result which allows real-time access to the target provider system, executes interface calling of the access target provider system, or responds to a return result which delays access to the target provider system, and outputs interface calling feedback information indicating waiting for processing.
Description
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for controlling access flow, an electronic device, and a computer-readable storage medium.
Background
The online trading platform generally comprises a trading system, a client and a direct connection system. The online trading platform interacts with the supplier system through the direct connection system so as to enable a user to access or purchase products provided by the supplier through a client of the online trading platform. Wherein, the direct connection system is a communication junction of the online trading platform and the supplier system. The OTA (on-line travel agency) system and the distribution system of the supplier realize the business flow of supply and sale through the interface interaction. Thus, the status of the vendor system directly affects the normal operation of the online trading platform. For example, when a provider system is out of order during peak business, the user's access to the provider system will be affected, and in severe cases, the direct connection system may be broken down.
In the prior art, in order to avoid a failure of a direct connection system or an online transaction platform due to a system abnormality of a provider system during a business peak period, fusing and degrading processing are generally performed on a downstream provider system or limiting an upstream access amount. For example, the response of the downstream dependent service is monitored, when the number of exceptions (e.g., interface timeouts) of the downstream dependent service exceeds a threshold, subsequent traffic no longer requests the provider system, or when the downstream dependent service fails to provide the service normally, the transaction system no longer requests the downstream system, either directly returns a failure or returns a default result. For another example, the upstream request flow is monitored, and the flow is rejected when the upstream request flow exceeds the limit, so that the condition that the upstream request flow exceeds the bearing capacity of the transaction system to cause the abnormality of the direct connection system is avoided. However, the fusing degradation can no longer request interfaces of some provider systems when the provider systems are abnormal, thereby avoiding direct connection systems being affected, ensuring that the subscribed traffic of other providers can be processed normally, and causing traffic loss of the fused and degraded provider. Although the flow limitation can reject partial flow when the upstream flow is overloaded so as to achieve the purpose of protecting the directly-connected system, the problem of abnormality of the directly-connected system caused by the overload of the flow of a certain provider system cannot be solved essentially.
It can be seen that there is still a need for improvement in the traffic management methods of the prior art.
Disclosure of Invention
The application provides an access flow control method which can improve the stability of a direct connection system.
In order to solve the above problem, in a first aspect, an embodiment of the present application provides an access flow control method, which is applied to an online transaction platform including a direct connection system, where the online transaction platform further includes a flow control module, and the method includes:
the direct connection system responds to the interface call for accessing the target provider system and calls an access request permission interface of the flow control module;
the flow control module responds to the calling operation of the access request permission interface and outputs a return result according to the real-time state of the target supplier system, wherein the return result comprises: allowing real-time access to the target provider system or delaying access to the target provider system;
and the direct connection system responds to a return result which allows real-time access to the target provider system, executes interface calling of the access target provider system, or responds to a return result which delays access to the target provider system, and outputs interface calling feedback information indicating waiting for processing.
In a second aspect, an embodiment of the present application provides an access flow control device, which is applied to an online transaction platform including a direct connection system, where the online transaction platform further includes a flow control module, where:
the direct connection system is used for responding to the interface call of the target supplier system and calling the access request permission interface of the flow control module;
the flow control module is configured to respond to a call operation of the access request permission interface, and output a return result according to a real-time state of the target provider system, where the return result includes: allowing real-time access to the target provider system or delaying access to the target provider system;
the direct connection system is further configured to execute the interface call for accessing the target provider system in response to a return result allowing real-time access to the target provider system, or output interface call feedback information indicating waiting for processing in response to a return result delaying access to the target provider system.
In a third aspect, an embodiment of the present application further discloses an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the access flow control method according to the embodiment of the present application when executing the computer program.
In a fourth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to perform the steps of the access flow control method disclosed in the present application.
According to the access flow control method disclosed by the embodiment of the application, the flow control module is arranged in the direct connection system, and then the direct connection system responds to the interface call of the access target provider system and calls the access request permission interface of the flow control module; the flow control module responds to the calling operation of the access request permission interface and outputs a return result according to the real-time state of the target supplier system, wherein the return result comprises: allowing real-time access to the target provider system or delaying access to the target provider system; and finally, the directly-connected system responds to a return result which allows real-time access to the target provider system, executes interface calling for accessing the target provider system, or responds to a return result which delays access to the target provider system, and outputs interface calling feedback information indicating waiting processing, so that system abnormity caused by overload of the flow of a certain provider system is solved, and the stability of the directly-connected system is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a flowchart of an access flow control method according to a first embodiment of the present application;
fig. 2 is a schematic structural diagram of an application platform of an access flow control method according to a first embodiment of the present application;
fig. 3 is a flowchart of an access flow control method according to a second embodiment of the present application;
fig. 4 is a schematic structural diagram of an access flow control device according to a third embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of 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.
Example one
An access flow control method disclosed in an embodiment of the present application is applied to an online transaction platform including a direct connection system, and as shown in fig. 1, the method includes: step 110 to step 130.
And step 110, the direct connection system responds to the interface call for accessing the target provider system and calls an access request permission interface of the flow control module.
The access flow control method in the embodiment of the application is applied to an online transaction platform comprising a direct connection system. Fig. 2 is a schematic structural diagram of an online transaction platform to which the access flow control method disclosed in the present application is applied. As shown in fig. 2, the online trading platform includes: client 210, trading system 220, direct connection system 230 and traffic control module 240, and several provider systems 250.
Taking an online transaction platform as an online travel agency as an example, when a user reserves a room of a hotel supplier system 250 through the client 210, the client 210 generates order data according to information such as order use time, hotel name, room type, hotel supplier name and the like selected by the user, and further sends the generated order data to the transaction system 220. Then, the transaction system 220 parses the received order data to obtain the identifier of the target provider system 250, and generates an interface call for accessing the target provider system by using the determined order information such as the identifier of the target provider system, the order usage time, and the like as the preset parameters of the interface for accessing the target provider system. The transaction system 220 sends the generated interface call to access the target provider system to the direct connection system 230.
The interface call for accessing the target provider system includes information such as an identifier of the target provider system, order usage time, and the like.
After receiving the interface call for accessing the target provider system, the direct connection system 230 first converts the interface call for accessing the target provider system into a call for an access request permission interface of the traffic control module 2301.
In some embodiments of the present application, the direct connection system 230 may encapsulate the interface call of the access target provider system, use all parameters of the interface call of the access target provider system and the interface call name of the access target provider system as parameters of an access request permission interface of the flow control module, and then transmit all parameters of the interface call of the access target provider system and the interface call name of the access target provider system to the flow control module 240 through the interface call, so that the flow control module 240 caches all parameters of the interface call of the access target provider system and the interface call name of the access target provider system.
In other embodiments of the present application, the direct connection system 230 may first parse the interface call for accessing the target provider system, and obtain necessary information for identifying the interface call for accessing the target provider system this time, for example, a provider identifier and an order using time, and other interface call information. Then, the direct connection system 230 allocates a call identifier to the interface call of the access target provider system, and transmits the call identifier, the provider identifier, and the order use time to the traffic control module 240 through the access request permission interface of the traffic control module 240.
In specific implementation, when the access request permission interface of the traffic control module 240 is called, the identifier of the target provider system carried in the interface call for accessing the target provider system must be used as a call parameter, so that the traffic control module 240 can determine and obtain the real-time status of the corresponding provider system.
And step 120, the flow control module responds to the calling operation of the access request permission interface and outputs a return result according to the real-time state of the target supplier system.
In some embodiments of the present application, the real-time status of the supplier includes: a delayed access state and a non-delayed access state.
In specific implementation, the flow control module 240 updates the real-time status of each provider system in real time by detecting the result of the interface call of the direct connection system 230 to each provider system. The interface call of the direct connection system 230 to each provider system detected by the flow control module 240 includes an interface call sent by the client 210 to access a target provider system, and also includes an interface call, which is sent by the direct connection system 230 to each provider system actively and acquires load capability, configuration information, real-time status, and the like of the provider system.
For example, when the direct connection system 230 responds to an interface call initiated by the client 210 to access the target provider system a, if the direct connection system 230 calls the interface a1 of the provider system a according to the interface call to access the target provider system a, if the direct connection system 230 calls the interface a1 of the provider system a 20 times, wherein 15 times of return failure, it may be considered that the provider system a has a status exception. The flow control module 240 may set the real-time status of the provider system a to a delayed access status by detecting a return result of the above interface call of the direct connection system 230. On the contrary, if the flow control module 240 finds that the number of times of failure in return is smaller than the preset ratio by detecting the return result called by the above interface of the direct connection system 230, it may be determined that the provider system a is in a normal working state, and the real-time state of the provider system a is set to be a non-delayed access state.
The flow control module 240 caches the real-time status of each provider system in local memory.
The returned result comprises: allowing real-time access to the target provider system or delaying access to the target provider system.
In some embodiments of the present application, the flow control module 240, in response to the call operation of the access request permission interface, outputs a return result according to the real-time status of the target provider system, including: the flow control module judges whether the locally stored real-time state of the target provider system is a delayed access state; responding to a judgment result that the real-time state of the target provider system is a non-delay access state, and outputting a return result allowing real-time access to the target provider system; and responding to the judgment result of the real-time state delay access state of the target provider system, outputting a return result of delaying access to the target provider system, and locally caching the interface call of the access target provider system corresponding to the access request permission interface in the flow control module.
After the traffic control module 240 receives the call operation of the access request permission interface, it is determined whether to allow the direct connection system 230 to directly access the target provider system according to the real-time status of the target provider system. Taking the flow control module 240 as an example, when the direct connection system 230 calls the access request permission interface, according to the locally cached real-time state of the provider system a as the delayed access state, the identifier of the provider system a is transmitted to the flow control module 240 through the interface parameter. The traffic control module 240 determines that the directly connected system 230 is not allowed to directly access the provider system a if the locally cached real-time status of the provider system a is determined to be the delayed access status. Therefore, the flow control module 240 returns to delay the access to the target provider system for the current call operation of the access request permission interface.
Taking the flow control module 240 as an example that the real-time state of the provider system B cached locally is a non-delayed access state, when the direct connection system 230 calls the access request permission interface, the identifier of the provider system B is transmitted to the flow control module 240 through an interface parameter. The traffic control module 240 determines that the directly connected system 230 is allowed to directly access the provider system B if the locally cached real-time status of the provider system B is determined to be the non-delayed access status. Therefore, the flow control module 240 returns permission to access the target provider system in real time for the current call operation of the access request permission interface.
When the traffic control module 240 returns a call operation for a current access request permission interface to delay access to the target provider system, that is, the traffic control module 240 does not currently allow the direct connection system 230 to access the target provider system, the traffic control module 240 may locally cache the interface call for accessing the target provider system corresponding to the access request permission interface, so as to recover the call for accessing the target provider system by the direct connection system 230 at an appropriate time.
And step 130, the direct connection system executes interface calling of the target provider system in response to a return result allowing real-time access to the target provider system, or outputs interface calling feedback information indicating waiting for processing in response to a return result delaying access to the target provider system.
After receiving the returned result output by the flow control module 240, the direct connection system 230 executes subsequent operations according to the returned result.
In some embodiments, the flow control module 240 outputs a return result for allowing real-time access to the target provider system for the call initiated by the direct connection system 230 to the access request permission interface, and after receiving the return result for allowing real-time access to the target provider system output by the flow control module 240, the direct connection system 230 may forward the interface call for accessing the target provider system received from the client 210 to the target provider system, that is, the direct connection system 230 imports the user traffic to the target provider system immediately.
In other embodiments, the flow control module 240 outputs a return result of delaying access to the target provider system for the call initiated by the direct connection system 230 to the access request permission interface, and after receiving the return result of delaying access to the target provider system and output by the flow control module 240, the direct connection system 230 does not forward the interface call received from the client 210 to the target provider system, but waits for a further trigger of the flow control module 240, and then starts to forward the interface call received from the client 210 to the target provider system. That is, the direct connection system 230 caches the user traffic to the traffic control module 240, and then receives the user traffic sent by the traffic control module 240 at an appropriate time according to the trigger of the traffic control module 240, and sends the user traffic to the target provider system. Further, in order to improve user experience, after the direct connection system 230 receives a return result output by the flow control module 240 and delaying access to the target provider system, the direct connection system 230 outputs feedback information to the client 210 for the current interface call, where the feedback information is used to indicate that the current interface call is waiting for processing.
According to the access flow control method disclosed by the embodiment of the application, the flow control module is arranged in the direct connection system, and then the direct connection system responds to the interface call of the access target provider system and calls the access request permission interface of the flow control module; the flow control module responds to the calling operation of the access request permission interface and outputs a return result according to the real-time state of the target supplier system, wherein the return result comprises: allowing real-time access to the target provider system or delaying access to the target provider system; and finally, the directly-connected system responds to a return result which allows real-time access to the target provider system, executes interface calling for accessing the target provider system, or responds to a return result which delays access to the target provider system, and outputs interface calling feedback information indicating waiting processing, so that system abnormity caused by overload of the flow of a certain provider system is solved, and the stability of the directly-connected system is improved.
According to the access flow control method, whether the target provider system is accessed in real time is determined according to the real-time state of the target provider system, when the flow load of the target provider system exceeds the capacity range or the target provider system breaks down or other abnormal conditions, the user access flow accessing the target provider system can be temporarily cached, the cached user access flow is sent to the target provider system after the target provider system can normally operate, and the problem that when the target provider system is abnormal, the direct connection system sends the user access flow to the target provider system and the direct connection system is dragged down due to instability of the target provider system or abnormity of a data transmission link is avoided. On the other hand, the user access traffic is prevented from being directly sent to the target provider system, but the user traffic loss is caused because the target provider system cannot normally receive the user access traffic.
Example two
The following describes a technical solution of an access flow control method disclosed in an embodiment of the present application in detail with reference to fig. 3. Still by way of example, when the access flow control method disclosed in the embodiment of the present application is applied to the online transaction platform shown in fig. 2, the method includes: step 310 to step 390.
And step 310, the direct connection system responds to the interface call for accessing the target provider system and calls an access request permission interface of the flow control module.
For a specific implementation of invoking an access request permission interface of the flow control module, referring to embodiment one, the direct connection system responds to an interface call for accessing a target provider system, and this embodiment is not described again.
In step 320, the traffic control module responds to the call operation of the access request permission interface and outputs a return result according to the real-time state of the target provider system.
The returned result comprises: allowing real-time access to the target provider system or delaying access to the target provider system.
The specific implementation manner of outputting the return result by the flow control module in response to the call operation of the access request permission interface according to the real-time state of the target provider system is referred to in the first embodiment, and details are not repeated in this embodiment.
In some embodiments of the present application, after outputting the returned result that allows real-time access to the target provider system, the method further includes: counting a number of calls of an interface call to access the target provider system; and when the calling times meet a preset frequency condition, setting the real-time state of the target provider system as a delayed access state, and setting the reason matched with the delayed access state as flow overload. In order to avoid the fault of the supplier system caused by the overhigh flow load caused by the overlarge access flow of the user, the flow control module monitors the access frequency of the direct connection system to each supplier system. Therefore, after the flow control module allows the direct connection system to access a certain provider system in real time, the flow control module counts the number of times that the direct connection system is allowed to access the provider system in real time, so as to determine the number of times that the direct connection system calls the provider system interface (i.e., the number of times that the direct connection system accesses the provider system) within a period of time. Then, it is further determined whether the determined access times satisfy a preset frequency condition (e.g., whether a preset access frequency threshold is exceeded), and if the call times satisfy the preset frequency condition, the flow control module sets the real-time status of the provider system to a delayed access status. And meanwhile, the flow control module sets the reason that the supplier system is in the delayed access state as the flow overload.
In other embodiments of the present application, after outputting the returned result that allows real-time access to the target provider system, the method further comprises: monitoring a calling result of the interface calling; and responding to the abnormal condition of the calling result to meet a preset abnormal judgment condition, setting the real-time state of the target supplier system as a delayed access state, and setting the reason matched with the delayed access state as system abnormity. In order to avoid the situation that the direct connection system is dragged down due to the fault of the supplier system, after the flow control module allows the direct connection system to access a certain supplier system in real time, the flow control module detects a return result of the direct connection system accessing the supplier system at this time, and determines the ratio of the number of times of call failure returned by the supplier system to the total number of times of interface call in a preset time period. And when the duty ratio of the return call failure of the supplier system in the preset time period meets a preset abnormal judgment condition (such as exceeding a preset ratio threshold), the supplier system is considered to be in an abnormal state, and the flow control module sets the real-time state of the supplier system to be a delayed access state. And meanwhile, the flow control module sets the reason that the supplier system is in the delayed access state as system abnormity.
In some embodiments of the present application, after the direct connection system invokes an interface of the provider system, an interface invocation result (e.g., a provider system interface invocation timeout, a data error, etc.) is sent to the message queue, and the flow control module listens for a message in the message queue, and the interface invocation result.
In still other embodiments of the application, when the traffic control module outputs a return result according to the real-time status of the target provider system in response to the call operation of the access request permission interface, if the output return result is to delay access to the target provider system, the traffic control module outputs the return result of delaying access to the target provider system in the determination result of delaying the access status in the real-time status of the target provider system, and after the traffic control module locally caches the interface call of the access target provider system corresponding to the access request permission interface, the traffic control module further includes: calculating a cache end time of the interface call to access the target provider system.
When the flow control module does not allow the direct connection system to access the target provider system in real time, the flow control module caches the interface call of the direct connection system to the target provider system, and restarts the interface call of the direct connection system to the target provider system at a proper time, so that the flow control module needs to calculate the end cache time of the interface call of the direct connection system to the target provider system, so as to restart the interface call of the direct connection system to the target provider system before the end cache time comes.
In some embodiments of the present application, the calculating the cache end time of the interface call for accessing the target provider system includes: acquiring a use date preset by a user according to the interface call of the access target provider system; if the using date is the current date, setting the cache ending time of the interface call of the access target provider system as a first time, otherwise, setting the cache ending time of the interface call of the access target provider system as a second time, wherein the second time is greater than the first time.
For example, in an online travel agency platform, when a user orders a hotel room in provider system C through a client, user1 calls an interface provided by the direct connection system to access provider system C (e.g., fountain 1) when the user submits an order for the order through user 1. When an interface (e.g., fountain 1) to access provider system C is called, the interface (i.e., fountain 1) needs to set information such as the identity of provider system C, the identity of the reservation order, and the date of use of the hotel room. When the direct connection system calls an access request permission interface provided by the flow control module, the information, such as the identifier of the supplier system C, the identifier of the reservation order, the use date of the hotel room, and the like, is transmitted to the flow control module. And then, the flow control module calculates the cache end time of the interface call of the access provider system C according to the service date of the hotel room. For example, when the use date of the hotel room is the current day, the buffer time of the interface call is set to a shorter time, for example, the buffer end time is set to a shorter time X (e.g., 10 minutes); when the use date of the hotel room is not the current day, the buffering time of the interface call is set to a longer time, for example, the buffering end time is set to a longer time Y (e.g., 1 hour). In particular implementations, Y > X, and the values of X and Y may be configured according to the traffic load and upstream access volume of the provider system.
In specific implementation, the direct connection system executes interface call for accessing the target provider system in response to a return result allowing real-time access to the target provider system, or outputs interface call feedback information indicating waiting for processing in response to a return result delaying access to the target provider system. And when the returned result is judged to be that the target provider system is allowed to be accessed in real time, the direct connection system calls the received interface for accessing the target provider system and immediately transmits the interface to the target provider system. When the returned result is judged to delay the access of the target provider system, the direct connection system does not access the interface of the target provider system in real time, but calls the current interface of the client, outputs feedback information to the client and informs the client that the current interface call is waiting for processing.
When the direct connection system receives a return result that real-time access to the target provider system is allowed, the direct connection system converts an interface (such as fountain 1) for accessing the target provider system, which is called by the client, into a call which is opened by the target provider system to a corresponding interface (such as fountain 2) of the direct connection system.
In specific implementation, the direct connection system realizes that the interface call of the client to the direct connection system is converted into the interface call of the direct connection system to the provider system according to a preset interface mapping rule.
And finishing data interaction between the client and the supplier system. For example, a user reservation operation in a hotel room of the target provider system is completed once.
When the returned result is judged to delay the access to the target provider system, the direct connection system outputs feedback information to the client (such as a user1) to inform the client that the interface call is waiting for processing.
In the running process of the system, the flow control module can periodically perform flow playback on the interface call of the access provider of the local cache, namely the flow control module can periodically restart part or all of the interface calls of the local cache to finish the access of the client to the provider system. Firstly, the flow control module traverses the interface calls of the access provider system cached locally, and determines the provider system in a delayed access state according to the provider system identifier carried in each interface call. For example, the target provider system C in a delayed access state is determined.
Step 370, for each target provider system, determining whether a delay cache reason of the target provider system in a delay access state is traffic overload, if yes, executing step 380; otherwise, step 390 is performed.
As can be seen from the foregoing description, there are two reasons why the flow control module sets the provider system in the delayed access state: traffic overload and system anomalies.
For each of the target provider systems in the delayed access state, in response to a cause of the delayed access state match being traffic overload, resuming execution of the interface call to access the target provider system that executes the local cache. That is, in the flow return visit, the flow control module directly starts the flow playback for the interface call accessing the provider system, which is temporarily cached due to the overload of the provider system flow.
For an interface call to the provider system, which is temporarily cached due to a system exception, it needs to be further determined whether the provider system is normal.
For example, for a certain target provider system C, it is first determined whether the target provider system C is overloaded when it is in a delayed cache cause of a delayed access state, or is abnormal. If the flow is overloaded, restoring and executing interface calling of local cache for accessing the target provider system C; if the system is abnormal, further judgment is needed to be made whether the target supplier system C is normal.
When the local cache interface calling for accessing the target provider system is recovered, the flow control module starts the direct connection system to call the cache interface calling for each provider system at constant speed according to the load capacity of each provider system, so that the user access flow is transmitted to the corresponding provider system.
In some embodiments of the present application, the resuming the interface call to access the target provider system that executes the local cache includes: acquiring the load capacity of the target supplier system; determining a frequency of executing interface calls to access the target provider system according to the load capacity; executing interface calling for accessing the target provider system according to the frequency and the cache end time, and setting the real-time state of the target provider system to be a non-delay access state until all interface calling for accessing the target provider system of the local cache is completely recovered and executed; or until the target supplier system is abnormal.
For example, each provider system may be configured with a system load capability value- -the frequency of requests supported by the provider system- -in the flow control module. And if the request frequency is n units per minute, the flow control module removes one cached interface call from the locally cached interface calls every 60/n seconds, sends the interface call to the direct connection system, and continuously executes the interface call by the direct connection system until all the cached interface calls are sent to the direct connection system. Preferably, the flow control module preferentially selects the interface call with the shortest time difference between the cache end time of the interface call and the current time to execute the recovery call.
In some embodiments of the present application, as described in the foregoing steps, the flow control module monitors an interface call of the direct connection system to the provider system and/or acquires an operating state of the provider system by calling the interface of the provider system. In the process of flow playback, when the provider system has an interface call failure or a system abnormality, the flow control module may suspend the flow playback of this period.
When determining that the interface call to the target provider system is cached due to a system exception, the traffic control module first determines whether the target provider system is recovered to be normal.
Then, when the target provider system is determined to be recovered to be normal, the interface call of the local cache for accessing the target provider system is recovered; and if the supplier system does not recover the normal state, the cached interface call is not processed, the traversal of the next period is waited, and whether the supplier system recovers the normal state is judged again.
In some embodiments of the present application, it may be detected whether the provider system is currently in a normal state by calling an interface provided by the provider system.
In specific implementation, the interface call for accessing the provider system to resume executing the local cache is described with reference to the foregoing corresponding steps, which is not described herein again.
According to the access flow control method disclosed by the embodiment of the application, the flow control module is arranged in the direct connection system, and then the direct connection system responds to the interface call of the access target provider system and calls the access request permission interface of the flow control module; the flow control module responds to the calling operation of the access request permission interface, when the real-time state of the target supplier system is a delayed access state, the interface calling of the access target supplier system is cached locally, and a return result of delaying the access of the target supplier system is output; the direct connection system responds to a return result of delaying access to the target provider system and outputs interface calling feedback information indicating waiting for processing; then, the flow control module regularly traverses the interface call of the access provider system cached locally, and judges the real-time state of the target provider system; for the target provider system, in response to the reason for the delayed access status match being traffic overload, resuming execution of the interface call to access the target provider system that is locally cached; for the target provider system, in response to the fact that the reason for the delayed access state matching is system abnormality and the target provider system returns to normal, the interface calling for accessing the target provider system, which is locally cached, is restored, and flow playback is performed through the method, so that user flow loss caused by flow limitation on upstream flow is avoided, meanwhile, the flow pressure of the provider system is effectively relieved, and the stability of a directly connected system is further improved.
On the other hand, the flow playback time is calculated according to the real-time requirement of user access, so that the user experience is better guaranteed on the premise of relieving the flow pressure of a provider system.
EXAMPLE III
An access flow control device disclosed in this embodiment is applied to an online transaction platform including a direct connection system, as shown in fig. 4, the device includes: direct connection system 410 and flow control module 420, wherein:
the direct connection system 410 is configured to invoke an access request permission interface of the traffic control module in response to an interface call for accessing a target provider system;
the flow control module 420 is configured to output a return result according to the real-time status of the target provider system in response to the call operation of the access request permission interface, where the return result includes: allowing real-time access to the target provider system or delaying access to the target provider system;
the direct connection system 410 is further configured to execute the interface call for accessing the target provider system in response to a return result allowing real-time access to the target provider system, or output interface call feedback information indicating waiting for processing in response to a return result delaying access to the target provider system.
In some embodiments of the present application, the flow control module 420 is further configured to:
judging whether the locally stored real-time state of the target provider system is a delayed access state;
responding to a judgment result that the real-time state of the target provider system is a non-delay access state, and outputting a return result allowing real-time access to the target provider system;
and in response to the determination result of the real-time delayed access state of the target provider system, outputting a return result of delaying access to the target provider system, and locally caching the interface call of the access target provider system corresponding to the access request permission interface in the flow control module 420.
In some embodiments of the subject application, after outputting the return results that allow real-time access to the target provider system, the flow control module 420 is further configured to,
counting a number of calls of an interface call to access the target provider system;
and when the calling times meet a preset frequency condition, setting the real-time state of the target provider system as a delayed access state, and setting the reason matched with the delayed access state as flow overload.
In some embodiments of the present application, after outputting the return result that allows real-time access to the target provider system, the traffic control module 420 is further configured to:
monitoring a calling result of the interface calling;
and responding to the abnormal condition of the calling result to meet a preset abnormal judgment condition, setting the real-time state of the target supplier system as a delayed access state, and setting the reason matched with the delayed access state as system abnormity.
In some embodiments of the present application, the flow control module 420 is further configured to:
after the flow control module 420 locally caches the interface call of the access target provider system corresponding to the access request permission interface, the cache end time of the interface call of the access target provider system is calculated.
In some embodiments of the present application, the calculating the cache end time of the interface call for accessing the target provider system includes:
acquiring a use date preset by a user according to the interface call of the access target provider system;
if the using date is the current date, setting the cache ending time of the interface call of the access target provider system as a first time, otherwise, setting the cache ending time of the interface call of the access target provider system as a second time, wherein the second time is greater than the first time.
In some embodiments of the present application, the flow control module 420 is further configured to:
traversing locally cached interface calls of the access provider systems, and determining the target provider system in a delayed access state;
for the target provider system, in response to the reason for the delayed access status match being traffic overload, resuming execution of the interface call to access the target provider system that is locally cached;
and for the target provider system, in response to the fact that the reason of the delayed access state matching is a system exception and the target provider system returns to be normal, restoring the execution of the interface call of the local cache for accessing the target provider system.
In some embodiments of the present application, the resuming the execution of the interface call to access the target provider system that is locally cached comprises:
acquiring the load capacity of the target supplier system;
determining a frequency of executing interface calls to access the target provider system according to the load capacity;
executing interface calling for accessing the target provider system according to the frequency and the cache end time, and setting the real-time state of the target provider system to be a non-delay access state until all interface calling for accessing the target provider system of the local cache is completely recovered and executed; or until the target supplier system is abnormal.
The access flow control device disclosed in the embodiment of the present application is configured to implement each step of the access flow control method described in the first embodiment and the second embodiment of the present application, and for specific implementation of each module of the device, reference is made to the corresponding step, which is not described herein again.
According to the access flow control device disclosed by the embodiment of the application, whether the target provider system is accessed in real time is determined according to the real-time state of the target provider system, when the flow load of the target provider system exceeds the capacity range or the target provider system breaks down or other abnormal conditions, the user access flow accessing the target provider system can be temporarily cached, the cached user access flow is sent to the target provider system when the target provider system can normally operate in a waiting mode, the problem that the direct connection system sends the user access flow to the target provider system when the target provider system is abnormal is avoided, and the problem that the direct connection system is dragged down due to instability of the target provider system or abnormal data transmission link. On the other hand, the user access traffic is prevented from being directly sent to the target provider system, but the user traffic loss is caused because the target provider system cannot normally receive the user access traffic.
On the other hand, according to the access flow control device disclosed by the application, whether the target provider system is accessed in real time is determined according to the real-time state of the target provider system, when the flow load of the target provider system exceeds the capacity range or the target provider system is in an abnormal condition such as a fault, the user access flow accessing the target provider system can be temporarily cached, the cached user access flow is sent to the target provider system when the target provider system can normally operate, and the problem that the direct connection system sends the user access flow to the target provider system when the target provider system is abnormal and the direct connection system is dragged down due to instability of the target provider system or abnormality of a data transmission link is solved. On the other hand, the user access traffic is prevented from being directly sent to the target provider system, but the user traffic loss is caused because the target provider system cannot normally receive the user access traffic.
On the other hand, the flow playback time is calculated according to the real-time requirement of user access, so that the user experience is better guaranteed on the premise of relieving the flow pressure of a provider system.
Correspondingly, the application also discloses an electronic device, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor executes the computer program to realize the access flow control method according to the first embodiment and the second embodiment of the application. The electronic device can be a PC, a mobile terminal, a personal digital assistant, a tablet computer and the like.
The present application also discloses a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the access flow control method as described in the first and second embodiments of the present application.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
The foregoing detailed description is directed to a method and an apparatus for controlling access flow provided by the present application, and specific examples are applied herein to illustrate the principles and implementations of the present application, and the descriptions of the foregoing examples are only used to help understand the method and the core ideas of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Claims (13)
1. An access flow control method is applied to an online transaction platform comprising a direct connection system, and is characterized in that the online transaction platform further comprises a flow control module, and the method comprises the following steps:
the direct connection system responds to the interface call for accessing the target provider system and calls an access request permission interface of the flow control module;
the flow control module responds to the calling operation of the access request permission interface and outputs a return result according to the real-time state of the target supplier system, wherein the return result comprises: allowing real-time access to the target provider system or delaying access to the target provider system;
and the direct connection system responds to a return result which allows real-time access to the target provider system, executes interface calling of the access target provider system, or responds to a return result which delays access to the target provider system, and outputs interface calling feedback information indicating waiting for processing.
2. The method according to claim 1, wherein the step of outputting the return result according to the real-time status of the target provider system by the traffic control module in response to the call operation of the access request permission interface comprises:
the flow control module judges whether the locally stored real-time state of the target provider system is a delayed access state;
responding to a judgment result that the real-time state of the target provider system is a non-delay access state, and outputting a return result allowing real-time access to the target provider system;
and responding to the judgment result of the real-time state delay access state of the target provider system, outputting a return result of delaying access to the target provider system, and locally caching the interface call of the access target provider system corresponding to the access request permission interface in the flow control module.
3. The method of claim 2, wherein after the step of outputting the returned results that allow real-time access to the target provider system, further comprising:
counting a number of calls of an interface call to access the target provider system;
and when the calling times meet a preset frequency condition, setting the real-time state of the target provider system as a delayed access state, and setting the reason matched with the delayed access state as flow overload.
4. The method of claim 2, wherein after the step of outputting the returned results that allow real-time access to the target provider system, further comprising:
monitoring a calling result of the interface calling;
and responding to the abnormal condition of the calling result to meet a preset abnormal judgment condition, setting the real-time state of the target supplier system as a delayed access state, and setting the reason matched with the delayed access state as system abnormity.
5. The method of claim 2, wherein the step of the traffic control module outputting a return result according to the real-time status of the target provider system in response to the call operation of the access request permission interface further comprises:
after the flow control module locally caches the interface call of the access target provider system corresponding to the access request permission interface, calculating the cache end time of the interface call of the access target provider system.
6. The method of claim 5, wherein the step of calculating the cache end time of the interface call to the target provider system comprises:
acquiring a use date preset by a user according to the interface call of the access target provider system;
if the using date is the current date, setting the cache ending time of the interface call of the access target provider system as a first time, otherwise, setting the cache ending time of the interface call of the access target provider system as a second time, wherein the second time is greater than the first time.
7. The method of any of claims 2 to 6, further comprising:
the flow control module traverses interface calls of the access provider system cached locally and determines the target provider system in a delayed access state;
for the target provider system, in response to the reason for the delayed access status match being traffic overload, resuming execution of the interface call to access the target provider system that is locally cached;
and for the target provider system, in response to the fact that the reason of the delayed access state matching is a system exception and the target provider system returns to be normal, restoring the execution of the interface call of the local cache for accessing the target provider system.
8. The method of claim 7, wherein the step of resuming execution of the locally cached interface call to the target provider system comprises:
acquiring the load capacity of the target supplier system;
determining a frequency of executing interface calls to access the target provider system according to the load capacity;
executing interface calling for accessing the target provider system according to the frequency and the cache end time, and setting the real-time state of the target provider system to be a non-delay access state until all interface calling for accessing the target provider system of the local cache is completely recovered and executed; or until the target supplier system is abnormal.
9. The utility model provides an access flow control device, is applied to the online trading platform including direct system, its characterized in that, online trading platform still includes the flow control module, wherein:
the direct connection system is used for responding to the interface call of the target supplier system and calling the access request permission interface of the flow control module;
the flow control module is configured to respond to a call operation of the access request permission interface, and output a return result according to a real-time state of the target provider system, where the return result includes: allowing real-time access to the target provider system or delaying access to the target provider system;
the direct connection system is further configured to execute the interface call for accessing the target provider system in response to a return result allowing real-time access to the target provider system, or output interface call feedback information indicating waiting for processing in response to a return result delaying access to the target provider system.
10. The apparatus of claim 9, wherein the flow control module is further configured to:
judging whether the locally stored real-time state of the target provider system is a delayed access state;
responding to a judgment result that the real-time state of the target provider system is a non-delay access state, and outputting a return result allowing real-time access to the target provider system;
and responding to the judgment result of the real-time state delay access state of the target provider system, outputting a return result of delaying access to the target provider system, and locally caching the interface call of the access target provider system corresponding to the access request permission interface in the flow control module.
11. The apparatus of claim 9 or 10, wherein the flow control module is further configured to:
traversing locally cached interface calls of the access provider systems, and determining the target provider system in a delayed access state;
for the target provider system, in response to the reason for the delayed access status match being traffic overload, resuming execution of the interface call to access the target provider system that is locally cached;
and for the target provider system, in response to the fact that the reason of the delayed access state matching is a system exception and the target provider system returns to be normal, restoring the execution of the interface call of the local cache for accessing the target provider system.
12. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the access flow control method of any one of claims 1 to 8 when executing the computer program.
13. A computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, is adapted to carry out the steps of the access flow control method according to any one of claims 1 to 8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911024086.0A CN110865895B (en) | 2019-10-25 | 2019-10-25 | Access flow control method, device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911024086.0A CN110865895B (en) | 2019-10-25 | 2019-10-25 | Access flow control method, device, electronic equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110865895A true CN110865895A (en) | 2020-03-06 |
CN110865895B CN110865895B (en) | 2023-07-04 |
Family
ID=69653222
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911024086.0A Active CN110865895B (en) | 2019-10-25 | 2019-10-25 | Access flow control method, device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110865895B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114579211A (en) * | 2022-02-21 | 2022-06-03 | 阿里巴巴(中国)有限公司 | Flow control method, device, equipment and system of service providing system |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6131165A (en) * | 1998-06-18 | 2000-10-10 | Sun Microsystems, Inc. | Permit for controlling access to services in protected memory systems |
CN106611223A (en) * | 2015-10-27 | 2017-05-03 | 亿阳信通股份有限公司 | Hotel business online ordering system and method |
CN108306874A (en) * | 2018-01-29 | 2018-07-20 | 口碑(上海)信息技术有限公司 | Service interface accesses current-limiting method and device |
CN108667916A (en) * | 2018-04-24 | 2018-10-16 | 百度在线网络技术(北京)有限公司 | A kind of data access method and system of Web applications |
CN108874324A (en) * | 2018-07-17 | 2018-11-23 | 郑州云海信息技术有限公司 | A kind of access request processing method, device, equipment and readable storage medium storing program for executing |
CN110138669A (en) * | 2019-04-15 | 2019-08-16 | 中国平安人寿保险股份有限公司 | Interface access processing method, device, computer equipment and storage medium |
-
2019
- 2019-10-25 CN CN201911024086.0A patent/CN110865895B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6131165A (en) * | 1998-06-18 | 2000-10-10 | Sun Microsystems, Inc. | Permit for controlling access to services in protected memory systems |
CN106611223A (en) * | 2015-10-27 | 2017-05-03 | 亿阳信通股份有限公司 | Hotel business online ordering system and method |
CN108306874A (en) * | 2018-01-29 | 2018-07-20 | 口碑(上海)信息技术有限公司 | Service interface accesses current-limiting method and device |
CN108667916A (en) * | 2018-04-24 | 2018-10-16 | 百度在线网络技术(北京)有限公司 | A kind of data access method and system of Web applications |
CN108874324A (en) * | 2018-07-17 | 2018-11-23 | 郑州云海信息技术有限公司 | A kind of access request processing method, device, equipment and readable storage medium storing program for executing |
CN110138669A (en) * | 2019-04-15 | 2019-08-16 | 中国平安人寿保险股份有限公司 | Interface access processing method, device, computer equipment and storage medium |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114579211A (en) * | 2022-02-21 | 2022-06-03 | 阿里巴巴(中国)有限公司 | Flow control method, device, equipment and system of service providing system |
Also Published As
Publication number | Publication date |
---|---|
CN110865895B (en) | 2023-07-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11677860B2 (en) | Decentralization processing method, communication proxy, host, and storage medium | |
US10447789B2 (en) | Distributed flow control | |
US9948791B2 (en) | Sharing group notification | |
EP3264723B1 (en) | Method, related apparatus and system for processing service request | |
CN1949774B (en) | Method and apparatus for managing web application program conversation | |
CN111124819A (en) | Method and device for monitoring full link | |
CN107257363B (en) | Method and system for responding request of request terminal | |
CN107360239A (en) | A kind of client connection status detection method and system | |
JP2023520057A (en) | METHOD, APPARATUS, ELECTRONIC DEVICE, SYSTEM AND STORAGE MEDIUM FOR MICROSERVICE COMPOSITION | |
CN113381944A (en) | System current limiting method, apparatus, electronic device, medium, and program product | |
CN112448987A (en) | Fusing degradation triggering method and system and storage medium | |
CN111104213B (en) | Method and device for adjusting fusing | |
CN110865895A (en) | Access flow control method and device, electronic equipment and storage medium | |
CN110071952B (en) | Service call quantity control method and device | |
JP2010152818A (en) | Server system | |
CN116302790A (en) | Operation resource management method, cloud gateway, electronic device and storage medium | |
CN111193760B (en) | Information sending method, device and storage medium | |
CN114285889A (en) | Method, device and equipment for processing configuration information of application service | |
CN113596170A (en) | Load balancing equipment-based shutdown processing method, device, medium and equipment | |
TW201800963A (en) | Data processing method and device | |
CN113362127A (en) | Second-hand car bidding system with high availability | |
CN113765705A (en) | Traffic switching method and traffic management server for cross-public-cloud dual-active structure | |
JP2002197005A (en) | Service surrogate control method | |
CN115378872B (en) | Flow control method, system, computer equipment and readable storage medium | |
CN111083213B (en) | Communication method and system |
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 | ||
TR01 | Transfer of patent right | ||
TR01 | Transfer of patent right |
Effective date of registration: 20231020 Address after: 22-01, 18th Floor, Building 38 Haidian Street, Haidian District, Beijing, 100089 Patentee after: BEIJING KUXUN TECHNOLOGY Co.,Ltd. Patentee after: BEIJING SANKUAI ONLINE TECHNOLOGY Co.,Ltd. Address before: 100083 2106-030, 9 North Fourth Ring Road, Haidian District, Beijing. Patentee before: BEIJING SANKUAI ONLINE TECHNOLOGY Co.,Ltd. |