CN112350950A - Request message control method and device - Google Patents
Request message control method and device Download PDFInfo
- Publication number
- CN112350950A CN112350950A CN202011175174.3A CN202011175174A CN112350950A CN 112350950 A CN112350950 A CN 112350950A CN 202011175174 A CN202011175174 A CN 202011175174A CN 112350950 A CN112350950 A CN 112350950A
- Authority
- CN
- China
- Prior art keywords
- request message
- time period
- current time
- request
- request messages
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 55
- 230000004044 response Effects 0.000 claims abstract description 22
- 230000001960 triggered effect Effects 0.000 claims description 4
- 230000000903 blocking effect Effects 0.000 abstract description 5
- 238000012545 processing Methods 0.000 description 9
- 238000010586 diagram Methods 0.000 description 7
- 238000004590 computer program Methods 0.000 description 6
- 238000005516 engineering process Methods 0.000 description 5
- 230000008569 process Effects 0.000 description 5
- 238000012360 testing method Methods 0.000 description 4
- 238000004891 communication Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 238000006243 chemical reaction Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 238000013459 approach Methods 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Images
Classifications
-
- 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
- H04L47/12—Avoiding congestion; Recovering from congestion
- H04L47/122—Avoiding congestion; Recovering from congestion by diverting traffic away from congested entities
-
- 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
- H04L47/29—Flow control; Congestion control using a combination of thresholds
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/14—Session management
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/14—Session management
- H04L67/143—Termination or inactivation of sessions, e.g. event-controlled end of session
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention discloses a request message control method and a device, which are applied to an API gateway in a micro-service system architecture and can obtain a request message sent by a calling party; recording the request message, and determining the total number of the recorded request messages in the current time period; and determining whether the total number of the request messages is greater than a preset threshold value of the number of the request messages, if so, refusing to respond to the request messages, and if not, responding to the request messages. The invention limits the number of response request messages in the current time period by presetting the threshold value of the number of the request messages, avoids the problem of request message blocking caused by the sudden increase of the number of the request messages, and further improves the stability of the micro-service system architecture.
Description
Technical Field
The present invention relates to the field of micro service technologies, and in particular, to a method and an apparatus for controlling a request message.
Background
Microservices are an architectural approach for building applications. The micro service system architecture is different from the traditional monolithic scheme, and the micro service system architecture can split the application into a plurality of core functions. Each function is called a micro-service and can be built and deployed individually, which means that the micro-services do not affect each other when working and failing.
At present, the calling of the calling party to the interface of the micro service in the micro service system architecture cannot be limited, so that when the calling party uses a multi-thread concurrent request or the calling party generates a bug, the number of the interface request messages of a certain micro service is increased suddenly, the request messages are not in time to respond, and the blocking is caused, so that the micro service system architecture is broken down integrally, and the stability of the micro service system architecture is reduced.
Disclosure of Invention
The embodiment of the invention aims to provide a request message control method and a device, and the technical scheme is as follows:
a request message control method is applied to an API gateway in a micro service system architecture, and comprises the following steps:
obtaining a request message sent by a calling party;
recording the request message, and determining the total number of the recorded request messages in the current time period;
and determining whether the total number of the request messages is greater than a preset threshold value of the number of the request messages, if so, refusing to respond to the request messages, and if not, responding to the request messages.
Optionally, after the rejecting responds to the request message, the method further includes:
and feeding back rejection information corresponding to the request message to the calling party.
Optionally, the responding to the request message includes:
an interface that allows the caller to invoke at least one microservice corresponding to the request message.
Optionally, the method further includes:
after the current time period is over, the total number of the request messages recorded in the current time period is reset to zero;
and determining the next time period after the current time period as the current time period, and recording the total number of the request messages again.
Optionally, after the rejecting responds to the request message, the method further includes:
adding the request message into a preset sequence to be responded;
determining the next time period after the current time period as the current time period, and recording each request message in the preset sequence to be responded to the total number of the request messages in the current time period;
and responding the request message of which the number of the sequence numbers in the preset sequence to be responded is not more than the threshold value of the number of the preset request messages.
Optionally, after the adding the request message to a preset to-be-responded sequence, the method further includes:
and feeding back the information to be responded corresponding to the request message to the calling party.
A request message control apparatus applied to an API gateway in a microservice system architecture, the apparatus comprising: a request message obtaining unit, a counter, a current limit filter, a request message response unit and a request message rejection unit,
the request message obtaining unit is used for obtaining a request message sent by a calling party;
the counter is used for recording the request message and determining the total number of the request messages recorded in the current time period;
the current limiting filter is used for determining whether the total number of the request messages is greater than a preset request message number threshold value, if so, the request message rejection unit is triggered, and if not, the request message response unit is triggered;
the request message rejection unit is used for rejecting to respond to the request message;
and the request message response unit is used for responding to the request message.
Optionally, the apparatus further comprises: a first feedback unit for providing a feedback signal to the mobile station,
the first feedback unit is configured to feed back rejection information corresponding to the request message to the caller after the request message rejection unit rejects to respond to the request message.
Optionally, the request message response unit is specifically configured to allow the caller to invoke an interface of at least one microservice corresponding to the request message.
Optionally, the counter is further configured to, after the current time period ends, zero the total number of request messages recorded in the current time period, determine a next time period after the current time period as the current time period, and record the total number of request messages again.
The method and the device for controlling the request message are applied to an API gateway in a micro-service system architecture and can obtain the request message sent by a calling party; recording the request message, and determining the total number of the recorded request messages in the current time period; and determining whether the total number of the request messages is greater than a preset threshold value of the number of the request messages, if so, refusing to respond to the request messages, and if not, responding to the request messages. The embodiment of the invention limits the number of response request messages in the current time period by presetting the threshold value of the number of the request messages, avoids the problem of request message blocking caused by the sudden increase of the number of the request messages, and further improves the stability of the micro-service system architecture.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart illustrating a request message control method according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating another request message control method according to an embodiment of the present invention;
fig. 3 is a flowchart illustrating another request message control method according to an embodiment of the present invention;
fig. 4 is a flowchart illustrating another request message control method according to an embodiment of the present invention;
fig. 5 is a flowchart illustrating another request message control method according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram illustrating a request message control apparatus according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. 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 invention.
As shown in fig. 1, a request message control method provided in an embodiment of the present invention is applied to an API gateway in a microservice system architecture, and the method includes:
s100, obtaining the request message sent by the calling party.
The microservice is a software development technology of a Service Oriented Architecture (SOA) architecture style, and can be a microservice system architecture which constructs an application program into a group of loosely coupled services. Each microservice of the same application can be independently deployed, operated and upgraded, but is functionally represented as a unified whole. An API (Application Programming Interface) gateway, also called an Application Programming Interface, is a set of definitions, programs and protocols to implement communication between computer software. The API gateway may be responsible for request message routing, combining, and protocol conversion. The caller's request message may be routed through the API gateway to the corresponding microservice. The API gateway may invoke multiple microservices to process a request message and may translate between Web protocols (e.g., HTTP and WebSocket) and internally used non-Web-friendly protocols.
Wherein the caller may be a client requesting to invoke at least one microservice. The request message may be information of an interface of the at least one microservice requested to be invoked by the caller. It is understood that when the request message sent by the caller reaches the API gateway, the embodiment of the present invention may automatically obtain the request message.
S200, recording the request message, and determining the total number of the recorded request messages in the current time period.
The current time period may be a recording period of a preset duration. For example: the preset time period may be 30 seconds, 60 seconds, or 100 seconds. The embodiment of the invention can record the request message when the current time period starts. And in the current time period, adding 1 to the recorded count value every time one request message is obtained, and further counting the total number of the request messages obtained in the current time period. For example: the initial count value is 0 at the beginning of the current time period, the recorded count value is 1 at the time of the first request message obtained in the current time period, and the recorded count value is 2 at the time of the second request message obtained in the current time period. The count value recorded by the embodiment of the invention can reflect the number of the request messages obtained in the current time period in real time. It is understood that the count value recorded in the embodiment of the present invention may be changed in the current time period, that is, the count value may be different at different times in the current time period.
S300, determining whether the total number of the request messages is larger than a preset request message number threshold, if so, executing the step S400, and if not, executing the step S500.
Specifically, the embodiment of the present invention may determine whether the total number of request messages recorded in the current time period is greater than a preset threshold value of the number of request messages every time one request message is obtained. Alternatively, the preset threshold for the number of request messages may be a threshold set by a technician according to actual conditions to limit the number of response request messages. Optionally, the preset request message number threshold may be related to the online number of the caller and the hardware resource configuration of the micro service system architecture. Optionally, in the embodiment of the present invention, the preset request message number threshold may be set to 200.
The total number of the request messages recorded in the current time period is also called as the number of the concurrent requests, and the number of the concurrent requests is easy to observe and count, and can reflect the current request message processing pressure of the micro-service system architecture, so that the subsequent request message processing pressure of the micro-service system architecture is estimated. Therefore, the embodiment of the invention can ensure the stability of the micro-service system architecture by carrying out the processing pressure test on the micro-service system architecture and determining the reasonable threshold value of the number of the preset request messages according to the test result.
S400, refusing to respond to the request message.
Optionally, based on the method shown in fig. 1, as shown in fig. 2, in another request message control method provided in the embodiment of the present invention, after step S400, the method further includes:
s600, feeding back rejection information corresponding to the request message to the calling party.
Wherein the rejection information may be prompt information that the request message has been rejected from responding. Alternatively, the rejection information may be presented in a form visible to the user at the calling party. For example: the rejection message can be presented in text form at the caller to inform the user that the request message has been rejected for response.
And S500, responding the request message.
Optionally, based on the method shown in fig. 1, as shown in fig. 3, in another request message control method provided in the embodiment of the present invention, step S500 may include:
s510, allowing the caller to call at least one micro service interface corresponding to the request message.
The request message control method provided by the embodiment of the invention is applied to an API gateway in a micro-service system architecture and can obtain the request message sent by a calling party; recording the request message, and determining the total number of the recorded request messages in the current time period; and determining whether the total number of the request messages is greater than a preset threshold value of the number of the request messages, if so, refusing to respond to the request messages, and if not, responding to the request messages. The embodiment of the invention limits the number of response request messages in the current time period by presetting the threshold value of the number of the request messages, avoids the problem of request message blocking caused by the sudden increase of the number of the request messages, and further improves the stability of the micro-service system architecture.
Optionally, in the embodiment of the present invention, after the current time period ends, the total number of the request messages recorded in the current time period may be returned to zero; and determining the next time period after the current time period as the current time period, and recording the total number of the request messages again.
It can be understood that, when a recording period of a preset duration is set, the embodiment of the present invention may set the total number of recorded request messages to be zero after the current time period ends, so as to record the total number of request messages in the next current time period after the current time period ends.
Optionally, based on the method shown in fig. 1, as shown in fig. 4, in another request message control method provided in the embodiment of the present invention, after step S400, the method further includes:
s700, adding the request message into a preset sequence to be responded.
The preset to-be-responded sequence can store a request message which is refused to respond in the current time period and is expected to respond in a time period after the current time period. The embodiment of the invention can sequence the request messages in the preset to-be-responded sequence according to the acquisition time of the request messages.
Optionally, based on the method shown in fig. 4, as shown in fig. 5, in another request message control method provided in the embodiment of the present invention, after step S700, the method further includes:
s710, feeding back the information to be responded corresponding to the request message to the calling party.
It can be understood that, after the request message is added to the preset to-be-responded sequence, the embodiment of the present invention may feed back the to-be-responded information to the caller corresponding to the request message. Optionally, the information to be responded may be presented in a form visible to the user at the caller. For example: the information to be responded can be displayed on the calling party in a text form so as to inform the user that the request message is waiting for response.
It is to be understood that fig. 5 illustrates only an optional order of execution of steps. For example: step S710 may be performed before step S800, or may be performed after step S800.
S800, determining the next time period after the current time period as the current time period, and recording each request message in the preset sequence to be responded to the total number of the request messages in the current time period.
Specifically, the embodiment of the present invention may preferentially respond to the request message in the preset to-be-responded sequence in the next time period after the current time period. Optionally, in the embodiment of the present invention, each request message in a preset sequence to be responded may be recorded in the total number of request messages in the current time period, and if the total number of request messages in the current time period is greater than a preset threshold value of the number of request messages, step S400 is performed on subsequently obtained request messages.
And S900, responding to the request message of which the number of the sequence numbers in the preset sequence to be responded is not more than the threshold value of the number of the preset request messages.
Specifically, the embodiment of the present invention may determine the number of the sequence numbers of the request messages in the preset sequence to be responded according to the sequence of the acquisition time of the request messages, where the number of the sequence numbers of the request messages with the earlier acquisition time is smaller, so as to preferentially respond to the request messages with the earlier acquisition time.
Optionally, in the embodiment of the present invention, the request message in the preset to-be-responded sequence may be cleared according to the preset clearing time, so as to avoid a problem that the subsequent request message obtained cannot be processed in time due to too many request messages in the preset to-be-responded sequence.
Corresponding to the above method embodiment, an embodiment of the present invention further provides a request message control apparatus, which is applied to an API gateway in a microservice system architecture, and a structure of the apparatus is shown in fig. 6, where the apparatus includes: a request message obtaining unit 100, a counter 200, a limited flow filter 300, a request message response unit 500, and a request message rejection unit 400.
The request message obtaining unit 100 is configured to obtain a request message sent by a caller.
The microservice is a software development technology of a Service Oriented Architecture (SOA) architecture style, and can be a microservice system architecture which constructs an application program into a group of loosely coupled services. Each microservice of the same application can be independently deployed, operated and upgraded, but is functionally represented as a unified whole. An API (Application Programming Interface) gateway, also called an Application Programming Interface, is a set of definitions, programs and protocols to implement communication between computer software. The API gateway may be responsible for request message routing, combining, and protocol conversion. The caller's request message may be routed through the API gateway to the corresponding microservice. The API gateway may invoke multiple microservices to process a request message and may translate between Web protocols (e.g., HTTP and WebSocket) and internally used non-Web-friendly protocols.
Wherein the caller may be a client requesting to invoke at least one microservice. The request message may be information of an interface of the at least one microservice requested to be invoked by the caller. It is understood that when the request message sent by the caller reaches the API gateway, the embodiment of the present invention may automatically obtain the request message.
The counter 200 is configured to record the request message, and determine the total number of the request messages recorded in the current time period.
The current time period may be a recording period of a preset duration. For example: the preset time period may be 30 seconds, 60 seconds, or 100 seconds. The embodiment of the invention can record the request message when the current time period starts. And in the current time period, adding 1 to the recorded count value every time one request message is obtained, and further counting the total number of the request messages obtained in the current time period. For example: the initial count value is 0 at the beginning of the current time period, the recorded count value is 1 at the time of the first request message obtained in the current time period, and the recorded count value is 2 at the time of the second request message obtained in the current time period. The count value recorded by the embodiment of the invention can reflect the number of the request messages obtained in the current time period in real time. It is understood that the count value recorded in the embodiment of the present invention may be changed in the current time period, that is, the count value may be different at different times in the current time period.
Optionally, the counter 200 is further configured to, after the current time period ends, zero the total number of request messages recorded in the current time period, determine a next time period after the current time period as the current time period, and record the total number of request messages again.
The current limiting filter 300 is configured to determine whether the total number of the request messages is greater than a preset threshold of the number of the request messages, if so, trigger the request message rejection unit 400, and if not, trigger the request message response unit 500.
Specifically, the limited flow filter 300 may determine whether the total number of request messages recorded in the current time period is greater than a preset threshold number of request messages each time a request message is obtained. Alternatively, the preset threshold for the number of request messages may be a threshold set by a technician according to actual conditions to limit the number of response request messages. Optionally, the preset request message number threshold may be related to the online number of the caller and the hardware resource configuration of the micro service system architecture.
The total number of the request messages recorded in the current time period is also called as the number of the concurrent requests, and the number of the concurrent requests is easy to observe and count, and can reflect the current request message processing pressure of the micro-service system architecture, so that the subsequent request message processing pressure of the micro-service system architecture is estimated. Therefore, the embodiment of the invention can ensure the stability of the micro-service system architecture by carrying out the processing pressure test on the micro-service system architecture and determining the reasonable threshold value of the number of the preset request messages according to the test result.
The request message rejecting unit 400 is configured to reject to respond to the request message.
Optionally, another request message control apparatus provided in the embodiment of the present invention may further include: a first feedback unit.
The first feedback unit is configured to, after the request message rejection unit 400 rejects to respond to the request message, feed back rejection information corresponding to the request message to the caller.
The request message response unit 500 is configured to respond to the request message.
Optionally, the request message response unit 500 is specifically configured to allow the caller to invoke an interface of at least one microservice corresponding to the request message.
The request message control device provided by the embodiment of the invention is applied to an API gateway in a micro-service system architecture and can obtain a request message sent by a calling party; recording the request message, and determining the total number of the recorded request messages in the current time period; and determining whether the total number of the request messages is greater than a preset threshold value of the number of the request messages, if so, refusing to respond to the request messages, and if not, responding to the request messages. The embodiment of the invention limits the number of response request messages in the current time period by presetting the threshold value of the number of the request messages, avoids the problem of request message blocking caused by the sudden increase of the number of the request messages, and further improves the stability of the micro-service system architecture.
Optionally, another request message control apparatus provided in the embodiment of the present invention may further include: a request message adding unit.
The request message adding unit is configured to add the request message to a preset sequence to be responded after the request message rejecting unit 400 rejects to respond to the request message.
Optionally, another request message control apparatus provided in the embodiment of the present invention may further include: and a second feedback unit.
The second feedback unit is configured to feed back to-be-responded information corresponding to the request message to the caller after the request message adding unit adds the request message to a preset to-be-responded sequence.
The counter 200 is further configured to determine a next time period after the current time period as the current time period, and record each request message in the preset sequence to be responded to the total number of request messages in the current time period.
The request message responding unit 500 is further configured to respond to the request message in which the number of sequence numbers in the preset sequence to be responded is not greater than the preset threshold value of the number of request messages.
An embodiment of the present invention provides a storage medium on which a program is stored, the program implementing the request message control method when executed by a processor.
The embodiment of the invention provides a processor, which is used for running a program, wherein the request message control method is executed when the program runs.
The embodiment of the invention provides equipment, which comprises at least one processor, at least one memory and a bus, wherein the memory and the bus are connected with the processor; the processor and the memory complete mutual communication through a bus; the processor is used for calling the program instructions in the memory to execute the request message control method. The device herein may be a server, a PC, a PAD, a mobile phone, etc.
The present application also provides a computer program product adapted to perform a program, when executed on a data processing device, for initializing the steps of the above-described request message control method.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a device includes one or more processors (CPUs), memory, and a bus. The device may also include input/output interfaces, network interfaces, and the like.
The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip. The memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The above are merely examples of the present application and are not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims (10)
1. A request message control method is applied to an API gateway in a microservice system architecture, and comprises the following steps:
obtaining a request message sent by a calling party;
recording the request message, and determining the total number of the recorded request messages in the current time period;
and determining whether the total number of the request messages is greater than a preset threshold value of the number of the request messages, if so, refusing to respond to the request messages, and if not, responding to the request messages.
2. The method of claim 1, wherein after said denying the response to the request message, the method further comprises:
and feeding back rejection information corresponding to the request message to the calling party.
3. The method of claim 1, wherein responding to the request message comprises:
an interface that allows the caller to invoke at least one microservice corresponding to the request message.
4. The method of claim 1, further comprising:
after the current time period is over, the total number of the request messages recorded in the current time period is reset to zero;
and determining the next time period after the current time period as the current time period, and recording the total number of the request messages again.
5. The method of claim 1, wherein after said denying the response to the request message, the method further comprises:
adding the request message into a preset sequence to be responded;
determining the next time period after the current time period as the current time period, and recording each request message in the preset sequence to be responded to the total number of the request messages in the current time period;
and responding the request message of which the number of the sequence numbers in the preset sequence to be responded is not more than the threshold value of the number of the preset request messages.
6. The method according to claim 5, wherein after the adding the request message to a preset to-be-responded sequence, the method further comprises:
and feeding back the information to be responded corresponding to the request message to the calling party.
7. A request message control apparatus, applied to an API gateway in a microservice system architecture, the apparatus comprising: a request message obtaining unit, a counter, a current limit filter, a request message response unit and a request message rejection unit,
the request message obtaining unit is used for obtaining a request message sent by a calling party;
the counter is used for recording the request message and determining the total number of the request messages recorded in the current time period;
the current limiting filter is used for determining whether the total number of the request messages is greater than a preset request message number threshold value, if so, the request message rejection unit is triggered, and if not, the request message response unit is triggered;
the request message rejection unit is used for rejecting to respond to the request message;
and the request message response unit is used for responding to the request message.
8. The apparatus of claim 7, further comprising: a first feedback unit for providing a feedback signal to the mobile station,
the first feedback unit is configured to feed back rejection information corresponding to the request message to the caller after the request message rejection unit rejects to respond to the request message.
9. The apparatus of claim 7, wherein the request message response unit is specifically configured to allow the caller to invoke an interface of at least one microservice corresponding to the request message.
10. The apparatus of claim 7, wherein the counter is further configured to zero the total number of request messages recorded in the current time period after the current time period ends, determine a next time period after the current time period as the current time period, and record the total number of request messages again.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011175174.3A CN112350950A (en) | 2020-10-28 | 2020-10-28 | Request message control method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011175174.3A CN112350950A (en) | 2020-10-28 | 2020-10-28 | Request message control method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112350950A true CN112350950A (en) | 2021-02-09 |
Family
ID=74355216
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011175174.3A Pending CN112350950A (en) | 2020-10-28 | 2020-10-28 | Request message control method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112350950A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113242245A (en) * | 2021-05-12 | 2021-08-10 | 上海绚显科技有限公司 | TCP message flow limiting method, device, server and storage medium |
CN113590563A (en) * | 2021-07-28 | 2021-11-02 | 深圳Tcl新技术有限公司 | Data request method, system, storage medium and server |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107659460A (en) * | 2017-11-09 | 2018-02-02 | 广东技术师范学院 | A kind of method of provisioning API visit capacity |
CN108845910A (en) * | 2018-05-31 | 2018-11-20 | 康键信息技术(深圳)有限公司 | Monitoring method, device and the storage medium of extensive micro services system |
CN109547282A (en) * | 2018-10-22 | 2019-03-29 | 中国平安人寿保险股份有限公司 | Overload protection method, device, computer readable storage medium and server |
CN110768912A (en) * | 2019-10-21 | 2020-02-07 | 中国民航信息网络股份有限公司 | API gateway current limiting method and device |
CN110830280A (en) * | 2018-08-10 | 2020-02-21 | 深圳市鸿合创新信息技术有限责任公司 | Micro-service gateway device and method and electronic equipment |
CN111600807A (en) * | 2020-04-14 | 2020-08-28 | 网宿科技股份有限公司 | Flow control method and system based on API gateway equipment |
-
2020
- 2020-10-28 CN CN202011175174.3A patent/CN112350950A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107659460A (en) * | 2017-11-09 | 2018-02-02 | 广东技术师范学院 | A kind of method of provisioning API visit capacity |
CN108845910A (en) * | 2018-05-31 | 2018-11-20 | 康键信息技术(深圳)有限公司 | Monitoring method, device and the storage medium of extensive micro services system |
CN110830280A (en) * | 2018-08-10 | 2020-02-21 | 深圳市鸿合创新信息技术有限责任公司 | Micro-service gateway device and method and electronic equipment |
CN109547282A (en) * | 2018-10-22 | 2019-03-29 | 中国平安人寿保险股份有限公司 | Overload protection method, device, computer readable storage medium and server |
CN110768912A (en) * | 2019-10-21 | 2020-02-07 | 中国民航信息网络股份有限公司 | API gateway current limiting method and device |
CN111600807A (en) * | 2020-04-14 | 2020-08-28 | 网宿科技股份有限公司 | Flow control method and system based on API gateway equipment |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113242245A (en) * | 2021-05-12 | 2021-08-10 | 上海绚显科技有限公司 | TCP message flow limiting method, device, server and storage medium |
CN113590563A (en) * | 2021-07-28 | 2021-11-02 | 深圳Tcl新技术有限公司 | Data request method, system, storage medium and server |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11740917B2 (en) | System and method for platform-integrated custom applications | |
CN113037831B (en) | Service gateway message processing method and device | |
JP2019517040A (en) | Cloud platform based client application information statistics method and apparatus | |
CN110289983B (en) | Load balancing application creation method and device, computer equipment and storage medium | |
CN112350950A (en) | Request message control method and device | |
CN106411825A (en) | WeChat access token acquisition method and system thereof | |
CN110324317B (en) | Service processing method, device, equipment and storage medium | |
CN114040032A (en) | Protocol conversion method, system, storage medium and electronic equipment | |
CN111291053B (en) | Workflow data processing method and device and workflow data processing platform | |
CN111130900A (en) | Data acquisition method and device based on distributed interconnection of coordination services | |
CN109542401B (en) | Web development method and device, storage medium and processor | |
US20060166623A1 (en) | Service provisioning method, system and computer program product | |
CN115220887A (en) | Processing method of scheduling information, task processing system, processor and electronic equipment | |
CN116980526A (en) | Method, device and equipment for realizing multi-channel queuing machine applied to converged communication | |
CN114338124A (en) | Management method and system of cloud password computing service, electronic device and storage medium | |
US11115528B1 (en) | Call control service | |
CN112866265A (en) | CSRF attack protection method and device | |
CN111913789A (en) | Program tracking method, device and medium supporting micro-service architecture | |
CN110012053B (en) | System calling method, device and equipment under SOA system architecture and SOA system architecture | |
CN106844056B (en) | Hadoop big data platform multi-tenant job management method and system | |
Kryvinska et al. | Conceptual framework for services creation/development environment in telecom domain | |
CN113347665B (en) | Method and device for controlling real-time transaction amount in gateway system | |
CN113055419B (en) | Information sending method and device | |
US20230110404A1 (en) | System and method for centralized multichannel outbound call campaign management | |
CN117956080A (en) | Calling method, calling device, electronic equipment and 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 |