CN113572701A - Service interface flow control method, device, equipment and storage medium - Google Patents

Service interface flow control method, device, equipment and storage medium Download PDF

Info

Publication number
CN113572701A
CN113572701A CN202110847637.4A CN202110847637A CN113572701A CN 113572701 A CN113572701 A CN 113572701A CN 202110847637 A CN202110847637 A CN 202110847637A CN 113572701 A CN113572701 A CN 113572701A
Authority
CN
China
Prior art keywords
flow control
service interface
target service
target
interface
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110847637.4A
Other languages
Chinese (zh)
Inventor
宋建明
魏安稳
李博
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Miluoxing Technology Group Co ltd
Original Assignee
Hangzhou Miluoxing Technology Group Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Miluoxing Technology Group Co ltd filed Critical Hangzhou Miluoxing Technology Group Co ltd
Priority to CN202110847637.4A priority Critical patent/CN113572701A/en
Publication of CN113572701A publication Critical patent/CN113572701A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/32Flow control; Congestion control by discarding or delaying data units, e.g. packets or frames
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/30Profiles
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Stored Programmes (AREA)

Abstract

The application provides a service interface flow control method, a device, equipment and a storage medium, and relates to the technical field of information processing. The method comprises the following steps: judging whether a target service interface is in a preset interface resource pool or not, wherein the interface resource pool comprises information of a plurality of service interfaces; if the target service interface is in the interface resource pool, judging whether the target service interface reaches a target flow control condition corresponding to the target service interface; and if the target service interface reaches the target flow control condition, executing flow control operation corresponding to the target service interface on the target service interface. Compared with the prior art, the problem that developers develop new middleware every time in the prior art to cause large development workload is solved.

Description

Service interface flow control method, device, equipment and storage medium
Technical Field
The present application relates to the field of information processing technologies, and in particular, to a method, an apparatus, a device, and a storage medium for service interface flow control.
Background
With the continuous development of information technology, the application of micro services is more and more extensive, wherein each micro service node is called by other applications through a service interface of the micro service node.
At present, in order to ensure the operational reliability of a micro service node, a current limiting rule is usually set to perform current limiting or flow control on a service interface of the micro service node, and a data flow at an outlet is controlled based on the current limiting rule, so that risk control is realized, that is, only a certain number of requests are allowed to pass through, and if the number of requests exceeds the threshold, the requests are rejected.
However, if the micro server limits all the flow control, the micro server needs a development middleware to process the flow control, that is, a developer needs to develop a new middleware every time, which results in a large development workload.
Disclosure of Invention
An object of the present application is to provide a method, an apparatus, a device, and a storage medium for controlling a flow of a service interface, so as to solve the problem in the prior art that a developer develops a new middleware each time, resulting in a large development workload.
In order to achieve the above purpose, the technical solutions adopted in the embodiments of the present application are as follows:
in a first aspect, an embodiment of the present application provides a service interface flow control method, where the method includes:
judging whether a target service interface is in a preset interface resource pool or not, wherein the interface resource pool comprises information of a plurality of service interfaces;
if the target service interface is in the interface resource pool, judging whether the target service interface reaches a target flow control condition corresponding to the target service interface;
and if the target service interface reaches the target flow control condition, executing flow control operation corresponding to the target service interface on the target service interface.
Optionally, the determining whether the target service interface reaches the target flow control condition corresponding to the target service interface includes:
acquiring a flow control unit threshold corresponding to the target service interface, wherein the flow control unit threshold is a threshold of the number of requests of the target service interface in a flow control unit time;
judging whether the request times of the target service interface in the flow control unit time reach the flow control unit threshold value;
if the request times reach the flow control unit threshold, determining that the target service interface reaches the target flow control condition;
and if the request times do not reach the flow control unit threshold value, determining that the target service interface does not reach the target flow control condition.
Optionally, the obtaining a flow control unit threshold corresponding to the target service interface includes:
obtaining a flow control configuration parameter of the target service interface from a configuration file of the target service interface, wherein the flow control configuration parameter comprises: the flow control unit threshold and the flow control unit time.
Optionally, the flow control configuration parameters further include: the excess flow control strategy corresponding to the target service interface;
the executing the flow control operation corresponding to the target service interface includes:
and executing flow control operation corresponding to the excess flow control strategy on the target service interface according to the excess flow control strategy.
Optionally, if the excess flow control policy is an excess discard policy, the executing, according to the excess flow control policy, a flow control operation corresponding to the excess flow control policy on the target service interface includes:
and discarding the call request of the target service interface according to the excess discarding strategy.
Optionally, if the excess flow control policy is an excess retry policy, the executing, according to the excess flow control policy, a flow control operation corresponding to the excess flow control policy on the target service interface includes:
and adding the call request of the target service interface into an interface call queue again according to the excess retry strategy.
Optionally, the method further comprises:
detecting whether the configuration files of the plurality of service interfaces are updated;
and if the service interface for updating the configuration file exists in the plurality of service interfaces, updating the flow control configuration parameters of the corresponding service interface according to the updated configuration file.
In a second aspect, another embodiment of the present application provides a service interface flow control apparatus, including: judge module and execution module, wherein:
the judging module is used for judging whether a target service interface is in a preset interface resource pool or not, wherein the interface resource pool comprises information of a plurality of service interfaces; if the target service interface is in the interface resource pool, judging whether the target service interface reaches a target flow control condition corresponding to the target service interface;
and the execution module is used for executing the flow control operation corresponding to the target service interface on the target service interface if the target service interface reaches the target flow control condition.
Optionally, the apparatus further comprises: an acquisition module and a determination module, wherein:
the obtaining module is configured to obtain a flow control unit threshold corresponding to the target service interface, where the flow control unit threshold is a threshold of the number of requests of the target service interface in a flow control unit time;
the judging module is specifically configured to judge whether the number of requests of the target service interface in the flow control unit time reaches the flow control unit threshold;
the determining module is configured to determine that the target service interface reaches the target flow control condition if the number of requests reaches the flow control unit threshold; and if the request times do not reach the flow control unit threshold value, determining that the target service interface does not reach the target flow control condition.
Optionally, the obtaining module is specifically configured to obtain a flow control configuration parameter of the target service interface from a configuration file of the target service interface, where the flow control configuration parameter includes: the flow control unit threshold and the flow control unit time.
Optionally, the flow control configuration parameters further include: the excess flow control strategy corresponding to the target service interface;
the execution module is specifically configured to execute, according to the excess flow control policy, a flow control operation corresponding to the excess flow control policy on the target service interface.
Optionally, if the excess flow control policy is an excess discard policy, the apparatus further includes: and the discarding module is used for discarding the calling request of the target service interface according to the excess discarding strategy.
Optionally, if the excess flow control policy is an excess retry policy, the apparatus further includes: and the retry module is used for adding the call request of the target service interface into the interface call queue again according to the excess retry strategy.
Optionally, the apparatus further comprises: detection module and update module, wherein:
the detection module is used for detecting whether the configuration files of the plurality of service interfaces are updated;
and the updating module is used for updating the flow control configuration parameters of the corresponding service interfaces according to the updated configuration files if the service interfaces with the updated configuration files exist in the plurality of service interfaces.
In a third aspect, another embodiment of the present application provides a service interface flow control apparatus, including: a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, when the service interface flow control device is operated, the processor communicates with the storage medium through the bus, and the processor executes the machine-readable instructions to perform the steps of the method according to any one of the first aspect.
In a fourth aspect, another embodiment of the present application provides a storage medium having a computer program stored thereon, where the computer program is executed by a processor to perform the steps of the method according to any one of the above first aspects.
The beneficial effect of this application is: by adopting the service interface flow control method provided by the application, the server side is pre-configured with the preset interface resource pool, the interface resource pool comprises information of a plurality of service interfaces, when the service interface is called, whether a target service interface is in the preset interface resource pool or not needs to be judged firstly, if so, whether the target service interface reaches the target flow control condition corresponding to the target service interface or not is continuously judged, and if so, the flow control operation corresponding to the target service interface is executed, the setting method does not need to configure logic codes for each service interface, but directly pre-configures the information of each service interface on the server side, directly executes the corresponding calling operation according to the flow control operation corresponding to the calling rule and the flow control condition in the calling process, and does not need to wait for the return of the target service interface side in the calling process, but directly according to the information of the target service interface on the server side, and determining the flow control operation strategy corresponding to the current target service interface, thereby reducing the development workload and improving the calling efficiency of calling the service interface.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
Fig. 1 is a schematic flowchart of a service interface flow control method according to an embodiment of the present application;
fig. 2 is a schematic flowchart of a service interface flow control method according to another embodiment of the present application;
fig. 3 is a schematic flowchart of a service interface flow control method according to another embodiment of the present application;
fig. 4 is a schematic structural diagram of a service interface flow control apparatus according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a service interface flow control apparatus according to another embodiment of the present application;
fig. 6 is a schematic structural diagram of a service interface flow control apparatus according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, 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 embodiments of the present application, but not all embodiments.
The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application.
Additionally, the flowcharts used in this application illustrate operations implemented according to some embodiments of the present application. It should be understood that the operations of the flow diagrams may be performed out of order, and steps without logical context may be performed in reverse order or simultaneously. One skilled in the art, under the guidance of this application, may add one or more other operations to, or remove one or more operations from, the flowchart.
A flow control method for a service interface provided in the embodiments of the present application is explained below with reference to a plurality of specific application examples. Fig. 1 is a schematic flowchart of a flow control method for a service interface according to an embodiment of the present application, and as shown in fig. 1, the method includes:
s101: and judging whether the target service interface is in a preset interface resource pool or not.
Each application program has a corresponding preset interface resource pool, the interface resource pool comprises information of a plurality of service interfaces, and the number and the information of the service interfaces in different interface resource pools are not necessarily the same; the service interface may be, for example, a login service interface, a payment service interface, an authorization service interface, or the like, and it should be understood that the foregoing embodiments are merely illustrative, and the type and included content of the specific service interface may be flexibly adjusted according to the user's needs, and are not limited to the foregoing embodiments.
In one embodiment of the present application, the information of the service interface may include, for example: address information of the service interface, flow control unit information of the service interface, unit threshold information of the flow control unit of the service interface, excess policy information, and the like; the flow control unit information may also be referred to as flow control information, and may be, for example, unit time information, for example, the unit time of flow control may be every minute, every hour, or every day; the excess policy information is flow control operation information, that is, flow control operation information, corresponding to the target service interface when the target service interface does not satisfy the target flow control condition corresponding to the target service interface, and in some possible embodiments, the flow control operation information may be retry or discard, for example.
S102: and if the target service interface is in the interface resource pool, judging whether the target service interface reaches a target flow control condition corresponding to the target service interface.
In an embodiment of the present application, the target flow control condition may be unit threshold information of a flow control unit of a service interface, and target flow control conditions corresponding to different target service interfaces may be different, and in some possible embodiments, the target flow control condition may be, for example, that the target service interface may be invoked by an invocation request initiated at most 60 times per second, or invoked by an invocation request initiated at most 1000 times per minute.
S103: and if the target service interface reaches the target flow control condition, executing flow control operation corresponding to the target service interface on the target service interface.
In some possible embodiments, the flow control operation may be related to a currently executed target service, for example, a service currently calling a target service interface has a high requirement on the calling accuracy, for example, for a payment service or a login service, etc., it may be set that when the target flow control condition is reached by the target service interface, the corresponding flow control operation is retried, that is, when the calling fails due to reaching the target flow control condition, the target service interface is tried to be called again according to a preset rule, so as to ensure the accuracy of the service; if the requirement of the service currently calling the target service interface on the accuracy is not high, for example, when the service such as sending a short message is used, it may be set that when the target service interface reaches the target flow control condition, the corresponding flow control operation is discarded, that is, when the target flow control condition is reached, the current call request may be directly discarded for the case of call failure.
By adopting the service interface flow control method provided by the application, the server side is pre-configured with the preset interface resource pool, the interface resource pool comprises information of a plurality of service interfaces, when the service interface is called, whether a target service interface is in the preset interface resource pool or not needs to be judged firstly, if so, whether the target service interface reaches the target flow control condition corresponding to the target service interface or not is continuously judged, and if so, the flow control operation corresponding to the target service interface is executed, the setting method does not need to configure logic codes for each service interface, but directly pre-configures the information of each service interface on the server side, directly executes the corresponding calling operation according to the flow control operation corresponding to the calling rule and the flow control condition in the calling process, and does not need to wait for the return of the target service interface side in the calling process, but directly according to the information of the target service interface on the server side, and determining the flow control operation strategy corresponding to the current target service interface, thereby reducing the development workload and improving the calling efficiency of calling the service interface.
Optionally, on the basis of the foregoing embodiment, an embodiment of the present application may further provide a service interface flow control method, and an implementation process of determining whether a service interface reaches a corresponding target flow control condition in the foregoing method is described as follows with reference to the accompanying drawings. Fig. 2 is a flowchart illustrating a service interface flow control method according to another embodiment of the present application, and as shown in fig. 2, S102 may include:
s104: and acquiring a flow control unit threshold corresponding to the target service interface.
In an embodiment of the present application, for example, a flow control configuration parameter of a target service interface may be obtained from a configuration file of the target service interface, and the flow control configuration parameter may include: the flow control unit threshold is a threshold for calling the target service interface within the flow control unit time, and may be specifically adjusted according to the user requirement, and is not limited to the above embodiment.
The flow control unit threshold is a threshold of the number of times of calling a target service interface in a flow control unit time; for example, the threshold may be a threshold of the number of times the target service interface is called by the call request within each second, or a threshold of the number of times the target service interface is called by the call request within each minute, or a threshold of the number of times the target service interface is called by the call request within each hour.
S105: and judging whether the request times of the target service interface in the flow control unit time reach a flow control unit threshold value or not.
The flow control unit threshold and the flow control unit time corresponding to different target service interfaces are preset in advance, the different target service interfaces may correspond to different conditions, and the preset flow control unit threshold and the preset flow control unit time of each target service interface can be adjusted according to user requirements in the using process.
S106: and if the request times reach the flow control unit threshold, determining that the target service interface reaches the target flow control condition.
In one embodiment of the present application, the flow control configuration parameters further include: the method comprises the steps that a flow control excess strategy corresponding to a target service interface is determined, namely when the number of requests for calling the target service interface is larger than a flow control unit threshold value, the current target service interface reaches a target flow control condition, namely the number of calls for the current request target service interface is already excess, the target excess strategy corresponding to the target service interface needs to be triggered, and the target excess strategy is executed.
At this time, for example, in S103, a flow control operation corresponding to the excess flow control policy may be executed on the target service interface according to the excess flow control policy.
In the embodiment of the present application, the excess flow control policy may be, for example, an excess retry policy or an excess discard policy, and if the excess flow control policy is an excess discard policy, when the access target service interface is excess, the excess service request may be directly discarded, that is, S103 is to discard the call request of the target service interface according to the excess discard policy; if the excess flow control policy is an excess retry policy, when the access target service interface is excess, the excess service request may be placed in a queue, and then waiting for the next execution according to the execution rule, that is, S103 is to add the call request of the target service interface into the interface call queue again according to the excess retry policy.
In some possible embodiments, the interface call queue may be, for example, an interface call queue to be executed corresponding to the entire application program, that is, service requests corresponding to all service interfaces in the current application program are all placed in the interface call queue, for example, the latest placed service request may be placed at the tail of the interface call queue in sequence according to the placement time, and the service requests are executed in sequence according to the queue order; it should be understood that the above embodiments are merely illustrative, and the setting manner of the specific interface call queue, the setting number can be flexibly adjusted according to the user's needs, and the setting manner of the interface call queue is not limited to the above embodiments.
S107: and if the request times do not reach the flow control unit threshold value, determining that the target service interface does not reach the target flow control condition.
That is, when the number of requests is less than or equal to the flow control unit threshold, it may be determined that the current target service interface does not meet the target flow control condition, which indicates that the number of calls of the current target service interface is not excessive, that is, the call request may be normally executed through the target service interface.
Optionally, on the basis of the foregoing embodiment, an embodiment of the present application may further provide a service interface flow control method, and an implementation process of the foregoing method is described as follows with reference to the accompanying drawings. Fig. 3 is a schematic flowchart of a service interface flow control method according to another embodiment of the present application, and as shown in fig. 3, the method may further include:
s108: whether the configuration files of the plurality of service interfaces are updated is detected.
In an embodiment of the present application, for example, whether the configuration file is updated may be determined by looking up the state of the configuration file, for example, if the configuration file is updated, the current state of the configuration file is updated; if the configuration file is not updated, the current state of the configuration file is normal; in another embodiment of the present application, for example, after the configuration file is updated, an update instruction may be actively sent, and after receiving the update instruction, the server determines that the configuration file corresponding to the update instruction is updated; it should be understood that the above embodiments are only exemplary, and the determination manner of whether the specific configuration file is updated, and the representation manner, may be flexibly adjusted according to the user's needs, and are not limited to the embodiments described above.
S109: and if the service interface for updating the configuration file exists in the plurality of service interfaces, updating the flow control configuration parameters of the corresponding service interface according to the updated configuration file.
By adopting the service interface flow control method provided by the application, the server side is configured with the preset interface resource pool corresponding to the current application program according to the protocol pre-signed between the current application program and each service, and the interface resource pool comprises the information of a plurality of service interfaces, therefore, when the service interface is called, the application program side directly judges whether the target service interface is in the preset interface resource pool, if so, when the target service interface application does not reach the target flow control condition corresponding to the target service interface, the target service interface is called to execute the corresponding calling operation, and when the target flow control condition corresponding to the target service interface is reached, the flow control operation corresponding to the target service interface is executed, the setting method does not need to configure logic codes for each service interface every time, but directly configures the information of each service interface on the server side of the application program in advance, in the calling process, the corresponding calling operation is directly executed according to the flow control operation corresponding to the calling rule and the flow control condition, and in the calling process, the flow control operation strategy corresponding to the current target service interface is determined directly according to the information of the target service interface at the server side without waiting for the return of the target service interface party, so that the development workload is reduced, and the calling efficiency of the calling service interface is improved.
The service interface flow control apparatus provided in the present application is explained with reference to the accompanying drawings, and the service interface flow control apparatus can execute any one of the service interface flow control methods shown in fig. 1 to fig. 3, and specific implementation and beneficial effects thereof are referred to above, and are not described again below.
Fig. 4 is a schematic structural diagram of a service interface flow control apparatus according to an embodiment of the present application, and as shown in fig. 3, the apparatus includes: a judging module 201 and an executing module 202, wherein:
a determining module 201, configured to determine whether a target service interface is in a preset interface resource pool, where the interface resource pool includes information of multiple service interfaces; if the target service interface is in the interface resource pool, judging whether the target service interface reaches a target flow control condition corresponding to the target service interface;
the executing module 202 is configured to execute a flow control operation corresponding to the target service interface on the target service interface if the target service interface meets the target flow control condition.
Optionally, on the basis of the foregoing embodiments, the present application may further provide a service interface flow control apparatus, and the implementation process of the apparatus shown in fig. 4 is described as follows with reference to the accompanying drawings. Fig. 5 is a schematic structural diagram of a service interface flow control apparatus according to another embodiment of the present application, and as shown in fig. 5, the apparatus further includes: an obtaining module 203 and a determining module 204, wherein:
the obtaining module 203 is configured to obtain a flow control unit threshold corresponding to the target service interface, where the flow control unit threshold is a threshold of request times of the target service interface in a flow control unit time;
the determining module 201 is specifically configured to determine whether the number of requests of the target service interface in a flow control unit time reaches a flow control unit threshold;
a determining module 204, configured to determine that the target service interface reaches a target flow control condition if the number of requests reaches a flow control unit threshold; and if the request times do not reach the flow control unit threshold value, determining that the target service interface does not reach the target flow control condition.
Optionally, the obtaining module 203 is specifically configured to obtain a flow control configuration parameter of the target service interface from a configuration file of the target service interface, where the flow control configuration parameter includes: a flow control unit threshold and a flow control unit time.
Optionally, the flow control configuration parameters further include: excess flow control strategy corresponding to the target service interface;
the execution module 202 is specifically configured to execute a flow control operation corresponding to the excess flow control policy on the target service interface according to the excess flow control policy.
As shown in fig. 5, if the excess flow control policy is an excess drop policy, the apparatus further includes: and a discarding module 205, configured to discard the call request of the target service interface according to the excess discarding policy.
Optionally, if the excess flow control policy is an excess retry policy, the apparatus further includes: and the retry module 206 is configured to add the call request of the target service interface to the interface call queue again according to the excess retry policy.
As shown in fig. 5, the apparatus further includes: a detection module 207 and an update module 208, wherein:
a detecting module 207, configured to detect whether configuration files of a plurality of service interfaces are updated;
the updating module 208 is configured to update the flow control configuration parameter of the corresponding service interface according to the updated configuration file if it is detected that the service interface of the updated configuration file exists in the plurality of service interfaces.
The above-mentioned apparatus is used for executing the method provided by the foregoing embodiment, and the implementation principle and technical effect are similar, which are not described herein again.
These above modules may be one or more integrated circuits configured to implement the above methods, such as: one or more Application Specific Integrated Circuits (ASICs), or one or more microprocessors, or one or more Field Programmable Gate Arrays (FPGAs), etc. For another example, when one of the above modules is implemented in the form of a Processing element scheduler code, the Processing element may be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
Fig. 6 is a schematic structural diagram of a service interface flow control device according to an embodiment of the present application, where the service interface flow control device may be integrated in a terminal device or a chip of the terminal device.
As shown in fig. 6, the service interface flow control apparatus includes: a processor 501, a storage medium 502, and a bus 503.
The processor 501 is used for storing a program, and the processor 501 calls the program stored in the storage medium 502 to execute the method embodiment corresponding to fig. 1-4. The specific implementation and technical effects are similar, and are not described herein again.
Optionally, the present application also provides a program product, such as a storage medium, on which a computer program is stored, including a program, which, when executed by a processor, performs embodiments corresponding to the above-described method.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to perform some steps of the methods according to the embodiments of the present application. And the aforementioned storage medium includes: a U disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.

Claims (10)

1. A method for controlling flow of a service interface, the method comprising:
judging whether a target service interface is in a preset interface resource pool or not, wherein the interface resource pool comprises information of a plurality of service interfaces;
if the target service interface is in the interface resource pool, judging whether the target service interface reaches a target flow control condition corresponding to the target service interface;
and if the target service interface reaches the target flow control condition, executing flow control operation corresponding to the target service interface on the target service interface.
2. The method of claim 1, wherein the determining whether the target service interface meets the target flow control condition corresponding to the target service interface comprises:
acquiring a flow control unit threshold corresponding to the target service interface, wherein the flow control unit threshold is a threshold of the number of requests of the target service interface in a flow control unit time;
judging whether the request times of the target service interface in the flow control unit time reach the flow control unit threshold value;
if the request times reach the flow control unit threshold, determining that the target service interface reaches the target flow control condition;
and if the request times do not reach the flow control unit threshold value, determining that the target service interface does not reach the target flow control condition.
3. The method of claim 2, wherein the obtaining the flow control unit threshold corresponding to the target service interface comprises:
obtaining a flow control configuration parameter of the target service interface from a configuration file of the target service interface, wherein the flow control configuration parameter comprises: the flow control unit threshold and the flow control unit time.
4. The method of claim 3, wherein the flow control configuration parameters further comprise: the excess flow control strategy corresponding to the target service interface;
the executing the flow control operation corresponding to the target service interface includes:
and executing flow control operation corresponding to the excess flow control strategy on the target service interface according to the excess flow control strategy.
5. The method according to claim 4, wherein if the excess flow control policy is an excess drop policy, the performing, according to the excess flow control policy, a flow control operation corresponding to the excess flow control policy on the target service interface includes:
and discarding the call request of the target service interface according to the excess discarding strategy.
6. The method according to claim 4, wherein if the excess flow control policy is an excess retry policy, the performing, according to the excess flow control policy, a flow control operation corresponding to the excess flow control policy on the target service interface includes:
and adding the call request of the target service interface into an interface call queue again according to the excess retry strategy.
7. The method of any one of claims 1-6, wherein the method further comprises:
detecting whether the configuration files of the plurality of service interfaces are updated;
and if the service interface for updating the configuration file exists in the plurality of service interfaces, updating the flow control configuration parameters of the corresponding service interface according to the updated configuration file.
8. A service interface flow control apparatus, the apparatus comprising: judge module and execution module, wherein:
the judging module is used for judging whether a target service interface is in a preset interface resource pool or not, wherein the interface resource pool comprises information of a plurality of service interfaces; if the target service interface is in the interface resource pool, judging whether the target service interface reaches a target flow control condition corresponding to the target service interface;
and the execution module is used for executing the flow control operation corresponding to the target service interface on the target service interface if the target service interface reaches the target flow control condition.
9. A service interface flow control apparatus, characterized in that the apparatus comprises: a processor, a storage medium and a bus, the storage medium storing machine-readable instructions executable by the processor, the processor and the storage medium communicating via the bus when the service interface flow control apparatus is operated, the processor executing the machine-readable instructions to perform the method of any one of claims 1 to 7.
10. A storage medium, characterized in that the storage medium has stored thereon a computer program which, when being executed by a processor, performs the method of any of the preceding claims 1-7.
CN202110847637.4A 2021-07-26 2021-07-26 Service interface flow control method, device, equipment and storage medium Pending CN113572701A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110847637.4A CN113572701A (en) 2021-07-26 2021-07-26 Service interface flow control method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110847637.4A CN113572701A (en) 2021-07-26 2021-07-26 Service interface flow control method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113572701A true CN113572701A (en) 2021-10-29

Family

ID=78167705

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110847637.4A Pending CN113572701A (en) 2021-07-26 2021-07-26 Service interface flow control method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113572701A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115037653A (en) * 2022-06-28 2022-09-09 北京奇艺世纪科技有限公司 Service flow monitoring method and device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110535777A (en) * 2019-08-12 2019-12-03 新华三大数据技术有限公司 Access request control method, device, electronic equipment and readable storage medium storing program for executing
CN111478857A (en) * 2019-01-24 2020-07-31 北京嘀嘀无限科技发展有限公司 Interface current limiting control method and device and electronic equipment
WO2021068205A1 (en) * 2019-10-11 2021-04-15 深圳市欢太科技有限公司 Access control method and apparatus, and server and computer-readable medium
CN112751847A (en) * 2020-12-28 2021-05-04 深圳市优必选科技股份有限公司 Interface call request processing method and device, electronic equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111478857A (en) * 2019-01-24 2020-07-31 北京嘀嘀无限科技发展有限公司 Interface current limiting control method and device and electronic equipment
CN110535777A (en) * 2019-08-12 2019-12-03 新华三大数据技术有限公司 Access request control method, device, electronic equipment and readable storage medium storing program for executing
WO2021068205A1 (en) * 2019-10-11 2021-04-15 深圳市欢太科技有限公司 Access control method and apparatus, and server and computer-readable medium
CN112751847A (en) * 2020-12-28 2021-05-04 深圳市优必选科技股份有限公司 Interface call request processing method and device, electronic equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115037653A (en) * 2022-06-28 2022-09-09 北京奇艺世纪科技有限公司 Service flow monitoring method and device, electronic equipment and storage medium
CN115037653B (en) * 2022-06-28 2023-10-13 北京奇艺世纪科技有限公司 Service flow monitoring method, device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN106533805B (en) Micro-service request processing method, micro-service controller and micro-service architecture
US8732694B2 (en) Method and system for performing services in server and client of client/server architecture
CN110442502B (en) Point burying method, device, equipment and storage medium
KR20130108613A (en) Method and device for interprocess communication and computer storage medium
CN112383585A (en) Message processing system and method and electronic equipment
US10715628B2 (en) Attribute operating method and device
CN115033352A (en) Task scheduling method, device and equipment for multi-core processor and storage medium
CN113791867B (en) Method and application for adjusting KVM virtual machine service process priority
CN113572701A (en) Service interface flow control method, device, equipment and storage medium
CN112530074A (en) Queuing and calling reminding method, device, equipment and storage medium
CN110750365A (en) Remote procedure calling method, system, terminal and storage medium
CN111064636B (en) Control method, device and system for connection of front-end processor and computer equipment
CN111800496B (en) Interface calling method, device, computer equipment and storage medium
CN110837431A (en) Service control method, service control device, computer equipment and computer-readable storage medium
CN112130900A (en) User information management method, system, equipment and medium for BMC
CN111984484A (en) Non-invasive micro-service access method and system
CN112637121A (en) Data port updating method and device, electronic equipment and readable storage medium
CN111698266A (en) Service node calling method, device, equipment and readable storage medium
CN111488236A (en) Order abnormity processing method, server, storage medium and processing device
CN116089020B (en) Virtual machine operation method, capacity expansion method and capacity expansion system
CN112771499A (en) Message loading method, message loading device and mobile terminal
CN115190178B (en) Micro-service distribution method, device and equipment
CN111444008B (en) Inter-cluster service migration method and device
CN107438070B (en) Protocol configuration method and device
CN112532699B (en) Data port updating method and device, electronic equipment and readable storage medium

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20211029