CN115567601A - Request processing method and device, electronic equipment and storage medium - Google Patents

Request processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115567601A
CN115567601A CN202211250399.XA CN202211250399A CN115567601A CN 115567601 A CN115567601 A CN 115567601A CN 202211250399 A CN202211250399 A CN 202211250399A CN 115567601 A CN115567601 A CN 115567601A
Authority
CN
China
Prior art keywords
request
target
current limiting
instance
current
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
CN202211250399.XA
Other languages
Chinese (zh)
Inventor
张峰孝
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Zhenshi Information Technology Co Ltd
Original Assignee
Beijing Jingdong Zhenshi Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Zhenshi Information Technology Co Ltd filed Critical Beijing Jingdong Zhenshi Information Technology Co Ltd
Priority to CN202211250399.XA priority Critical patent/CN115567601A/en
Publication of CN115567601A publication Critical patent/CN115567601A/en
Pending legal-status Critical Current

Links

Images

Abstract

The disclosure provides a request processing method, a request processing device, electronic equipment and a storage medium, which can be applied to the technical field of computers. The method comprises the following steps: the method comprises the steps that preset annotations in target application are used as tangent points of a current limiting tangent plane, and a first target request is obtained through the tangent points, wherein the first target request carries request parameters; matching the request parameters with a plurality of current limiting examples in an example library to obtain a matching result; determining a current limiting result based on the request frequency information of the first target current limiting example under the condition that the matching result characterization request parameter hits the first target current limiting example; and under the condition that the matching result represents that the request parameter does not hit any one current-limiting example in the example library, acquiring a first target request through a monitoring section so as to generate a new current-limiting example based on the acquired request.

Description

Request processing method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of computer technology and the field of finance, and more particularly, to a request processing method and apparatus, an electronic device, and a storage medium.
Background
With the continuous development of the internet technology, the threshold of the internet technology is also reduced, and under the condition of low learning cost, a user can acquire data of various web applications through a crawler and other tools, and the data acquisition process requires a server of the web applications to respond to requests, and high-frequency data acquisition can cause a large number of requests to be processed by the server in a short time, so that the stable operation of the web applications is affected. Therefore, various web applications have no way to avoid the user-requested throttling control.
In implementing the disclosed concept, the inventors found that there are at least the following problems in the related art: in the related art, the current-limiting control method for the user request is poor in flexibility, and the user requests with different granularities cannot be accurately processed.
Disclosure of Invention
In view of the above, the present disclosure provides a request processing method, apparatus, electronic device, readable storage medium and computer program product.
One aspect of the present disclosure provides a request processing method, including: the method comprises the steps that preset annotations in target application are used as cut points of a current limiting cut surface, and first target requests are obtained through the cut points, wherein the first target requests carry request parameters; matching the request parameters with a plurality of current limiting examples in an example library to obtain a matching result; determining a current limiting result based on the request frequency information of the first target current limiting example under the condition that the matching result represents that the request parameter hits the first target current limiting example; and collecting the first target request through a monitoring section under the condition that the matching result represents that the request parameter does not hit any one current limiting example in the example library so as to generate a new current limiting example based on the collected request.
According to an embodiment of the present disclosure, the collecting the first target request through the monitoring section so as to generate a new current limiting instance based on the collected request includes: using the preset annotation in the target application as a tangent point of the monitoring tangent plane, and collecting the first target request through the tangent point; extracting at least one current limiting factor from the request parameters of the first target request; determining a target current limiting factor combination based on at least one of the current limiting factors; storing the first target request into a target request set associated with the target current limiting factor combination; and generating a new current limiting instance based on the target current limiting factor combination in case that the number of requests stored in the target request set satisfies a preset current limiting condition.
According to an embodiment of the present disclosure, the first target request is configured with a time tag; wherein, in the case that the number of the requests stored in the target request set satisfies a preset current limiting condition, generating a new current limiting instance based on the target current limiting factor combination includes: determining the number of second target requests stored in the target request set within a sliding time window based on the time tags of the requests stored in the target request set, wherein the time represented by the time tag of the second target request is located within the sliding time window; and generating a new current limiting instance based on the target current limiting factor combination under the condition that the number of the second target requests reaches a first preset threshold value.
According to an embodiment of the present disclosure, the above-mentioned current limiting instance has an instance primary key associated with a combination of current limiting factors used to generate the above-mentioned current limiting instance; wherein, the matching of the request parameters with a plurality of current limiting examples in the example library to obtain a matching result comprises: determining a target instance main key based on the target current limiting factor combination; and respectively matching the example main keys of the plurality of current limiting examples by using the target example main key to obtain a matching result.
According to the embodiment of the present disclosure, the above current limiting example is configured with a current limiting period; wherein, the matching between the request parameters and the multiple current limiting instances in the instance library to obtain the matching result comprises: acquiring the current system time; determining at least one second target current limiting instance from a plurality of current limiting instances in the instance base based on the current system time, wherein the current system time is within a current limiting period of the second target current limiting instance; and matching the request parameters with at least one second target current limiting example to obtain the matching result.
According to an embodiment of the present disclosure, the method further includes: loading the request wrapper into the initialization container to obtain a target container; and storing the request parameter of the first target request by using the target container so as to read the request parameter of the first target request for multiple times.
According to an embodiment of the present disclosure, the method further includes: embedding a filter into a request reading method of the target application; and resetting the first target request by using the filter in response to the target application calling the request reading method so that the target application responds to the first target request.
According to an embodiment of the present disclosure, in the case that the matching result indicates that the request parameter hits a first target current limiting instance, determining a current limiting result based on the request frequency information of the first target current limiting instance includes: determining target request frequency information of the first target current limiting instance from a cache under the condition that the matching result represents that the request parameter hits the first target current limiting instance, wherein the first target current limiting instance has a time window, and the target request frequency information represents the hit frequency of the first target current limiting instance in the time window; under the condition that the hit times represented by the target request time information are greater than or equal to a second preset threshold value, obtaining the current limiting result representing that the target request is refused to be responded; and obtaining the current limiting result representing the response of the target request and modifying the target request frequency information under the condition that the hit frequency represented by the target request frequency information is smaller than the second preset threshold value.
According to an embodiment of the present disclosure, the method further includes: and writing the initialization request frequency information of the first target current limiting example into the cache under the condition that the target request frequency information of the first target current limiting example cannot be acquired from the cache, wherein the hit frequency represented by the initialization request frequency information is less than the second preset threshold.
According to an embodiment of the present disclosure, the method further includes: and responding to the first target request when the matching result indicates that the request parameter does not hit the first target current limiting example.
Another aspect of the present disclosure provides a request processing apparatus including: the system comprises an acquisition module, a processing module and a display module, wherein the acquisition module is used for acquiring a first target request through a tangent point by using a preset annotation in a target application as the tangent point of a current-limiting tangent plane, and the first target request carries a request parameter; the matching module is used for matching the request parameters with a plurality of current limiting examples in an example library to obtain a matching result; the determining module is used for determining a current limiting result based on the request frequency information of a first target current limiting example under the condition that the matching result represents that the request parameter hits the first target current limiting example; and the acquisition module is used for acquiring the first target request through a monitoring section under the condition that the matching result represents that the request parameter does not hit any current-limiting example in the example library so as to generate a new current-limiting example based on the acquired request.
Another aspect of the present disclosure provides an electronic device including: one or more processors; a memory for storing one or more instructions, wherein the one or more instructions, when executed by the one or more processors, cause the one or more processors to implement a method as described above.
Another aspect of the present disclosure provides a computer-readable storage medium storing computer-executable instructions for implementing the method as described above when executed.
Another aspect of the disclosure provides a computer program product comprising computer executable instructions that when executed are for implementing a method as described above.
According to the embodiment of the disclosure, by adding the preset annotation in the source code of the target application, in the running process of the target application, the preset annotation can be used as a tangent point of a current limiting tangent plane to obtain a first target request received by the target application, then, a request parameter of the first target request can be used for matching a current limiting instance, and in the case of determining that the target current limiting instance is matched, a current limiting result is determined according to the request frequency information of the target current limiting instance. By the technical means, the automatic current-limiting processing of the user request and the automatic collection of the non-current-limiting request are realized by adopting the current-limiting section and the monitoring section, the technical problems that the current-limiting control method for the user request in the related technology is poor in flexibility and cannot realize the accurate processing of the user requests with different granularities are at least partially solved, the current-limiting processing precision and flexibility of the user request are effectively improved, and the stability of target application during operation is improved.
Drawings
The above and other objects, features and advantages of the present disclosure will become more apparent from the following description of embodiments of the present disclosure with reference to the accompanying drawings, in which:
fig. 1 schematically illustrates an exemplary system architecture to which the request processing method and apparatus may be applied, according to an embodiment of the present disclosure.
Fig. 2 schematically shows a flow chart of a request processing method according to an embodiment of the present disclosure.
Fig. 3 schematically shows a diagram of a current limiting factor in a request parameter according to an embodiment of the disclosure.
Fig. 4 schematically shows a timing diagram of a user requested current limiting process according to an embodiment of the present disclosure.
Fig. 5 schematically illustrates a timing diagram of a flow of generating a current limit instance according to an embodiment of the disclosure.
Fig. 6 schematically shows a block diagram of a request processing device according to an embodiment of the present disclosure.
Fig. 7 schematically shows a block diagram of an electronic device adapted to implement a request processing method according to an embodiment of the present disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is illustrative only and is not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It is noted that the terms used herein should be interpreted as having a meaning that is consistent with the context of this specification and should not be interpreted in an idealized or overly formal sense.
Where a convention analogous to "A, B and at least one of C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B and C" would include, but not be limited to, systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.). Where a convention analogous to "A, B or at least one of C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B or C" would include, but not be limited to, systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).
In the related art, when a technician performs current limiting control on a user request received by a web application, a relatively extensive processing mode is usually adopted, for example, when the user is found to crawl data through a crawler, the current limiting control on the specific request of a certain user often cannot be performed, all users are subjected to current limiting, and the current limiting standard is mostly determined according to the subjective judgment of the technician. The specific reason is that the request monitoring is usually realized by collecting jar packets generated in the web application by using a collection component in the related art, and the monitoring mode cannot analyze user requests with fine granularity and reasonably perform service management and module division. Therefore, the current limiting control method for the user request in the related technology has poor flexibility and low accuracy.
In view of this, in the embodiment of the present disclosure, a tangent point is added in a source code of a web application in a tangent plane programming manner, so as to intercept and limit a current of a user from the tangent point, thereby implementing a fully automated current limiting, reducing system stability risks caused by human brain judgment, human brain analysis, manual current limiting, and the like, and improving flexibility and accuracy of requesting current limiting.
Specifically, the embodiment of the disclosure provides a request processing method, a request processing device, an electronic device, a readable storage medium and a computer program product. The method comprises the following steps: the method comprises the steps that preset annotations in target application are used as tangent points of a current limiting tangent plane, and a first target request is obtained through the tangent points, wherein the first target request carries request parameters; matching the request parameters with a plurality of current limiting examples in an example library to obtain a matching result; determining a current limiting result based on the request frequency information of the first target current limiting example under the condition that the matching result characterization request parameter hits the first target current limiting example; and under the condition that the matching result represents that the request parameter does not hit any one current-limiting example in the example library, acquiring a first target request through a monitoring section so as to generate a new current-limiting example based on the acquired request.
In the technical scheme of the disclosure, the acquisition, storage, application and the like of the personal information of the related user all accord with the regulations of related laws and regulations, necessary security measures are taken, and the customs of the public order is not violated.
In the technical scheme of the disclosure, before the personal information of the user is acquired or collected, the authorization or the consent of the user is acquired.
It should be noted that, unless explicitly stated that there is an execution sequence between different operations or there is an execution sequence between different operations in technical implementation, the execution sequence between multiple operations may not be sequential, or multiple operations may be executed simultaneously in the flowchart in this disclosure.
Fig. 1 schematically illustrates an exemplary system architecture to which the request processing method and apparatus may be applied, according to an embodiment of the present disclosure. It should be noted that fig. 1 is only an example of a system architecture to which the embodiments of the present disclosure may be applied to help those skilled in the art understand the technical content of the present disclosure, and does not mean that the embodiments of the present disclosure may not be applied to other devices, systems, environments or scenarios.
As shown in fig. 1, the system architecture 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired and/or wireless communication links, and so forth.
A user may use terminal devices 101, 102, 103 to interact with a server 105 over a network 104 to receive or send messages or the like. Various client applications, such as shopping-like applications, web browser applications, search-like applications, instant messaging tools, mailbox clients, and/or social platform software, etc., may be installed on the terminal devices 101, 102, 103.
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 105 may be a server that provides various services, such as a management server that responds to requests initiated by users through the terminal devices 101, 102, 103. The management server may match the request with the restriction instance to determine whether to respond to the request.
It should be noted that the request processing method provided by the embodiment of the present disclosure may be generally executed by the server 105. Accordingly, the request processing device provided by the embodiment of the present disclosure may be generally disposed in the server 105. The request processing method provided by the embodiment of the present disclosure may also be executed by a server or a server cluster different from the server 105 and capable of communicating with the terminal devices 101, 102, 103 and/or the server 105. Accordingly, the request processing apparatus provided by the embodiment of the present disclosure may also be disposed in a server or a server cluster different from the server 105 and capable of communicating with the terminal devices 101, 102, 103 and/or the server 105. Alternatively, the request processing method provided by the embodiment of the present disclosure may also be executed by the terminal device 101, 102, or 103, or may also be executed by another terminal device different from the terminal device 101, 102, or 103. Accordingly, the request processing apparatus provided in the embodiments of the present disclosure may also be disposed in the terminal device 101, 102, or 103, or in another terminal device different from the terminal device 101, 102, or 103.
For example, a target application may be run on any one of the terminal devices 101, 102, or 103 (for example, the terminal device 101, but not limited thereto), a user may initiate a request for accessing the target application through the terminal device 101, and after receiving the request, the terminal device 101 may execute the request processing method provided in the embodiments of the present disclosure to determine whether to respond to the request. Alternatively, the request may be sent to another terminal device, a server, or a server cluster through the network 104, and the other terminal device, the server, or the server cluster that receives the image to be processed executes the request processing method provided in the embodiment of the present disclosure, determines whether to respond to the request, and returns the processing result to the terminal device 101.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Fig. 2 schematically shows a flow chart of a request processing method according to an embodiment of the present disclosure.
As shown in fig. 2, the method includes operations S201 to S204.
In operation S201, a preset annotation in a target application is used as a tangent point of a current-limiting tangent plane, and a first target request is obtained through the tangent point. The first target request carries a request parameter.
In operation S202, the request parameter is matched with a plurality of current limiting instances in the instance base, so as to obtain a matching result.
In operation S203, in case that the matching result characterization request parameter hits the first target current limiting instance, a current limiting result is determined based on the request number information of the first target current limiting instance.
In operation S204, in a case that the matching result represents that the request parameter does not hit any current-limiting instance in the instance library, a first target request is collected through the monitoring section, so as to generate a new current-limiting instance based on the collected request.
According to embodiments of the present disclosure, a target application may refer to various web applications, including but not limited to a browser-based web application, an application-based web application, a microservice-based web application, and the like.
According to an embodiment of the present disclosure, the preset annotation may be @ XXMapping, including @ GetMapping (get), @ PostMapping (add), @ PutMapping (update), @ DeleteMapping (delete), etc.
According to an embodiment of the present disclosure, the preset annotation may be added in the source code of the target application. In particular, the preset annotations may be added in the source code of the external interface portion of the target application. For example, the target application providing service is mainly provided in the form of a Rest interface, and the preset annotation may be added to the relevant position in the source code calling the Rest interface.
According to embodiments of the present disclosure, the tangent point may be used to indicate where the current limiting tangent plane is woven into the execution flow of the target application.
According to an embodiment of the present disclosure, the request parameters may include a name of the first target request, a comment, an address to send the first target request, a port number, timeout time for request and response, a protocol, a method, a target URL path, an account number, and the like.
According to an embodiment of the present disclosure, any one or a combination of more than one of the request parameters may be used as a dimension of the current limit. For example, the account used in sending the first target request may be taken as a dimension of the current limit; for another example, the combination of the account used when sending the first target request and the address of sending the first target request may be used as the dimension of the current limit, which is not limited herein.
According to embodiments of the present disclosure, the current limit instances may correspond to the current limit dimensions individually. Matching with the current limiting instance using the request parameters may refer to matching a current limiting dimension obtained by combining the request parameters with a current limiting dimension corresponding to the current limiting instance.
According to an embodiment of the disclosure, the monitoring section may be configured to collect a first target request that is not subjected to current limiting, and the collected request may be processed to generate a new current limiting instance based on the collected request when a current limiting dimension corresponding to the first target request needs to be limited.
According to the embodiment of the disclosure, by adding a preset annotation in a source code of a target application, in the running process of the target application, the preset annotation can be used as a tangent point of a current limiting plane to obtain a first target request received by the target application, then, a request parameter of the first target request can be used for matching a current limiting instance, and in the case of determining that the current limiting instance is matched, a current limiting result is determined according to the request frequency information of the target current limiting instance. By the technical means, the automatic current-limiting processing of the user request and the automatic collection of the non-current-limiting request are realized by adopting the current-limiting section and the monitoring section, the technical problems that the current-limiting control method for the user request in the related technology is poor in flexibility and cannot realize the accurate processing of the user requests with different granularities are at least partially solved, the current-limiting processing precision and flexibility of the user request are effectively improved, and the stability of target application during operation is improved.
The method shown in fig. 2 is further described with reference to fig. 3-5 in conjunction with specific embodiments.
According to the embodiment of the disclosure, when acquiring the first target request, the @ xxmapping of the Controller layer (control layer) of the target application may be used as a tangent point to acquire the request parameter of the first target request through a parameter in the current limiting tangent plane.
According to the embodiment of the disclosure, when the request parameter of the first target request is obtained, the request wrapper may be loaded into the initialization container to obtain a target container; and storing the request parameters of the first target request by using the target container so as to read the request parameters of the first target request for multiple times.
According to an embodiment of the present disclosure, the request wrapper may be obtained by encapsulating classes associated with the user request. For example, the class associated with a user request may be http serverequest, and the request wrapper may be http servletquestwrapper, which may implement http servletrequest based on a decorator schema.
According to an embodiment of the present disclosure, the container of the application may be based on a sector container, a k8s container, or the like, or may be an array or a set, which is not limited herein.
According to the embodiment of the disclosure, taking the container of the application as a vector container as an example, the request wrapper may be stored in the container engine as a mirror image. An initialization container may refer to a container that has built up a runtime environment and does not load an image or application. When the request wrapper is loaded into the initialization container, an image of the request wrapper may be loaded into the initialization container.
According to the embodiment of the disclosure, the request parameters can be conveniently and repeatedly read in a mode of storing the request parameters into the target container, and the operation efficiency of the system is improved.
According to an embodiment of the present disclosure, based on a design of a request input stream object in the related art, the number of times that a first target request can be read in a target application is limited. Taking the first target requested input stream as an http servletrequest input stream as an example, reading the http servletrequest input stream may be implemented by calling a getInputStream () method to obtain an InputStream object. Because the read () method of the InputStream has a flag bit inside, the flag bit is used for representing the position where the current stream is read, and the flag bit moves along with the progress of reading the object, that is, after the object is completely read, the flag bit moves to the end, and the read () can return to-1 to represent that the reading is completed. If only the reset () method in the related art is used, the flag bit is moved to the position of the last call mask, and the input stream cannot be read again. Since InputStream by default cannot implement the relevant method of reset, nor ServeltInputStream rewrites the relevant method of reset, the HttpServletRequest input stream intelligence is read once.
According to the embodiment of the disclosure, the problem that the first target request cannot be repeatedly read can be solved by resetting the first target request. The method specifically comprises the following operations: embedding the filter into a request reading method of a target application; and resetting the first target request by using the filter in response to the target application calling the request reading method so that the target application responds to the first target request.
According to the embodiment of the disclosure, the filter can be embedded in the request reading method of the target application in a manner of rewriting the call request reading method.
According to an embodiment of the present disclosure, the filter may be a RequestFilter. Resetting the first target request with the filter may be resetting the first target request with a doFilter method in a filter RequestFilter such that the first target request may be repeatedly read.
According to an embodiment of the present disclosure, the request parameter of the first target request may include a current limiting factor.
Fig. 3 schematically shows a diagram of a current limiting factor in a request parameter according to an embodiment of the disclosure.
As shown in fig. 3, the current limiting factor in the request parameters of the first target request may include: ajaxPath (request to send), origin (client sending the request), refer (request comment), client IP (address requesting to send), erp (system used when sending the request), pin (personal identification number of the user sending the request), and the like.
Combinations of one or more of the above current limiting factors may form combinations of current limiting factors, according to embodiments of the present disclosure.
According to embodiments of the present disclosure, a current limit instance may have an instance primary key, which may be associated with a combination of current limit factors used to generate the current limit instance. For example, the example primary key may be a combination of a dynamic prefix generated using a random number algorithm and a current limiting factor.
According to an embodiment of the present disclosure, operation S202 may include the following operations:
determining a target instance primary key based on the target current limiting factor combination; and respectively matching the instance main keys of the multiple current limiting instances by using the target instance main key to obtain a matching result.
According to an embodiment of the disclosure, the target instance primary key may be generated after the current limiting factor in the request parameter is string.
According to an embodiment of the present disclosure, the target instance primary key may contain only the second half of the instance primary key of the current limiting instance, i.e., a combination of current limiting factor combinations.
According to the embodiment of the disclosure, the matching of the instance primary keys of the plurality of current limiting instances by the target instance primary key may be matching the target instance primary key with the second half of the instance primary key of each current limiting instance.
In some embodiments, the restriction instance may also be configured with a restriction period, which may refer to a period during which the restriction instance is in effect. The current limiting period may be set when configuring the current limiting instance, and a specific range of the current limiting period may be set according to a specific application scenario, which is not limited herein. In this embodiment, operation S202 may include the following operations:
acquiring the current system time; determining at least one second target current limiting instance from a plurality of current limiting instances in an instance base based on the current system time, wherein the current system time is within a current limiting period of the second target current limiting instance; and matching the request parameters with at least one second target current limiting instance to obtain a matching result.
According to the embodiment of the disclosure, the current system time may refer to a time when the current limiting matching operation is performed, a time when the first target request is acquired, a time when the current limiting processing is started for the first target request, and the like. The specific time referred to by the current system time may be determined according to a specific application scenario, which is not limited herein.
Fig. 4 schematically shows a timing diagram of a user requested current limiting process according to an embodiment of the present disclosure.
As shown in fig. 4, before the flow limiting process is performed, each flow limiting instance configured in the instance base may be imported into the flow limiting service.
According to the embodiment of the disclosure, a first target request initiated by a user through various client devices can be intercepted by a current limiting section at a control layer of a target application, and then the first target request can be sent to a current limiting service, and the current limiting service judges whether the first target request hits a current limiting instance.
According to the embodiment of the disclosure, when the judgment result of the current limiting service is that the first target request does not hit the current limiting instance, that is, when the matching result represents that the request parameter does not hit any current limiting instance in the instance base, the current limiting service may feed back information that does not need current limiting to the control layer. After receiving the feedback information, the control layer of the target application may send the first target request to the service layer of the target application, and the service layer of the target application executes the service logic of the target application to implement a response to the first target request.
According to the embodiment of the disclosure, when the judgment result of the current limiting service is that the first target request hits the first target current limiting instance, that is, the matching result represents that the request parameter hits the first target current limiting instance, the current limiting result may be determined based on the request frequency information of the first target current limiting instance.
According to an embodiment of the present disclosure, the first target current limiting instance may have a time window, and a length of a time period represented by the time window may be determined according to a specific application scenario, which is not limited herein.
According to an embodiment of the present disclosure, the request number information of the first target current limiting instance may characterize the number of times the first target current limiting instance is hit within the time window.
According to the embodiment of the disclosure, the target request number information of the first target current limiting instance may be determined from the cache.
According to an embodiment of the present disclosure, the request frequency information of the first target throttling instance recorded in the cache may be null (empty), that is, the target request frequency information of the first target throttling instance cannot be obtained from the cache. In this case, the information of the number of initialization requests of the first target current limiting instance may be written in the cache. Meanwhile, the cache may also return a flow restriction result characterizing the response to the first target request to the flow restriction service. The current limiting service may feed back information that does not need current limiting to a control layer of the target application according to the current limiting result, so that the target application responds to the first target request.
According to an embodiment of the present disclosure, the initialization request number information may include an initialized hit number value and an initialized time window. The initialized hit count value may be 1, the starting time of the initialized time window may be the time for writing the initialization request count information into the cache, and the initialized time window may represent the same time period as the time window of the first target current limiting instance.
According to the embodiment of the disclosure, in the case that the target request time information of the first target current limiting instance is successfully determined from the cache, the hit time represented by the target request time information may be compared with a second preset threshold value to determine the current limiting result.
According to an embodiment of the present disclosure, the second preset threshold may be any integer greater than the initialized hit number value, and is not limited herein.
According to the embodiment of the disclosure, under the condition that the hit times represented by the target request time information is greater than or equal to the second preset threshold, the current limiting result representing that the response of the first target request is refused can be obtained. At this point, the cache may return a current limit result to the current limit service characterizing a rejection of the response to the first target request. The current limiting service may feed back information that needs current limiting to the control layer according to the current limiting result. After receiving the feedback information, the control layer of the target application may throw the first target request without processing the first target request.
According to the embodiment of the disclosure, under the condition that the hit times represented by the target request time information are smaller than the second preset threshold, the current limiting result representing the response of the first target request can be obtained. At this time, the target request frequency information may be modified in the cache, that is, the hit frequency represented by the target request frequency information is increased by one through modification. At the same time, the cache may also return a current limit result characterizing the response to the first target request to the current limit service. The current limiting service may feed back information that does not need current limiting to a control layer of the target application according to the current limiting result, so that the target application responds to the first target request.
Fig. 5 schematically illustrates a timing diagram of a flow of generating a current limit instance according to an embodiment of the disclosure.
As shown in fig. 5, the first target request for generating a new current limiting instance may be a request that misses any one of the current limiting instances in the instance library.
According to the embodiment of the disclosure, the preset annotation in the target application can be used as a tangent point of the monitoring tangent plane, and the first target request is collected through the tangent point.
According to an embodiment of the present disclosure, the first target request may be pushed into the request processing cluster through message middleware.
According to an embodiment of the present disclosure, the request processing cluster may obtain the current limiting configuration from the current limiting service through an external interface, such as an RPC interface. The current limiting configuration may include preset current limiting conditions, current limiting periods, and the like. The information included in the flow limiting configuration may be set according to a specific application scenario, and is not limited herein.
According to the embodiment of the disclosure, after receiving a first target request, a request processing cluster may extract at least one current limiting factor from request parameters of the first target request; determining a target current limiting factor combination based on the at least one current limiting factor; and storing the first target request in a set of target requests associated with the combination of target current limiting factors.
According to the embodiment of the disclosure, the request cluster may determine whether each request set in the cluster hits in the current limiting configuration, that is, determine whether the number of requests stored in the request set satisfies the preset current limiting condition. In the event that the number of requests stored in the target request set satisfies a preset current limit condition, the request cluster may generate a new current limit instance based on the target current limit factor combination.
According to an embodiment of the present disclosure, the first target request may be configured with a time tag, where the time tag may refer to a time when the first target request is responded to or the like, or may refer to a current system time, which is not limited herein.
According to an embodiment of the present disclosure, the preset current limit condition may be expressed as that the number of requests in the request set is greater than a preset value in a period of time. Specifically, in the case that the number of requests stored in the target request set satisfies the preset current limiting condition, generating a new current limiting instance based on the target current limiting factor combination may include the following operations:
determining the number of second target requests stored in the target request set in a sliding time window based on the time tags of the requests stored in the target request set, wherein the time represented by the time tag of the second target request is located in the sliding time window; and generating a new current limiting instance based on the target current limiting factor combination in case the number of second target requests reaches a first preset threshold.
According to an embodiment of the present disclosure, the sliding time window may be configured with a window width and a window sliding duration, where the window width may refer to a length of a time period represented by the sliding time window, such as 60 minutes, 30 minutes, and the like; the window sliding duration may refer to an interval between two sliding of the sliding time window, such as one sliding of the sliding time window every 20 minutes.
According to the embodiment of the disclosure, the current limiting instance generated by the request processing cluster can be pushed to the current limiting service through message middleware, so that the current limiting service can realize the current limiting control of the user request by applying the current limiting instance.
According to the embodiment of the disclosure, the request processing cluster can also perform aggregation operation on the received requests so as to reduce the storage pressure.
According to the embodiment of the disclosure, the request processing cluster may further obtain the alarm configuration from the alarm service, and in the process of generating the current limiting instance, it may further determine whether each request set in the cluster hits the alarm configuration, and in the case of determining that the alarm configuration hits, push the alarm feedback information to the alarm service, where the feedback information may be forwarded to a manager or a research and development staff of the target application, so that the manager or the research and development staff of the target application may process the alarm feedback information in real time, and the operation risk of the target application is reduced.
Fig. 6 schematically shows a block diagram of a request processing device according to an embodiment of the present disclosure.
As shown in fig. 6, the request processing apparatus 600 includes an obtaining module 610, a matching module 620, a determining module 630, and an acquiring module 640.
The obtaining module 610 is configured to obtain a first target request through a tangent point by using a preset annotation in a target application as the tangent point of a current-limiting tangent plane, where the first target request carries a request parameter.
And the matching module 620 is configured to match the request parameter with multiple current limiting instances in the instance library to obtain a matching result.
The determining module 630 is configured to determine a current limiting result based on the request frequency information of the first target current limiting instance when the matching result represents that the request parameter hits the first target current limiting instance.
And the collecting module 640 is configured to collect the first target request through the monitoring section when the matching result represents that the request parameter does not hit any current-limiting example in the example library, so as to generate a new current-limiting example based on the collected request.
According to the embodiment of the disclosure, by adding the preset annotation in the source code of the target application, in the running process of the target application, the preset annotation can be used as a tangent point of a current limiting tangent plane to obtain a first target request received by the target application, then, a request parameter of the first target request can be used for matching a current limiting instance, and in the case of determining that the target current limiting instance is matched, a current limiting result is determined according to the request frequency information of the target current limiting instance. By the technical means, the automatic current-limiting processing and the automatic acquisition of the non-current-limiting requests of the user requests are realized by adopting the current-limiting section and the monitoring section, the technical problems that the current-limiting control method for the user requests in the related technology is poor in flexibility and cannot realize the accurate processing of the user requests with different granularities are at least partially solved, the accuracy and the flexibility of the current-limiting processing of the user requests are effectively improved, and the stability of target application during operation is improved.
According to an embodiment of the present disclosure, the acquisition module 640 includes a first acquisition unit, a second acquisition unit, a third acquisition unit, a fourth acquisition unit, and a fifth acquisition unit.
And the first acquisition unit is used for acquiring the first target request through the tangent point by using the preset annotation in the target application as the tangent point of the monitoring tangent plane.
And the second acquisition unit is used for extracting at least one current limiting factor from the request parameters of the first target request.
And the third acquisition unit is used for determining a target current limiting factor combination based on at least one current limiting factor.
And the fourth acquisition unit is used for storing the first target request into a target request set associated with the target current limiting factor combination.
And the fifth acquisition unit is used for generating a new current limiting example based on the target current limiting factor combination under the condition that the number of the requests stored in the target request set meets the preset current limiting condition.
According to an embodiment of the present disclosure, the first target request is configured with a time tag.
According to an embodiment of the present disclosure, the fifth acquisition unit includes a first acquisition subunit and a second acquisition subunit.
And the first acquisition subunit is used for determining the number of second target requests stored in the target request set in the sliding time window based on the time tags of the requests stored in the target request set, wherein the time represented by the time tag of the second target request is positioned in the sliding time window.
And the second acquisition subunit is used for generating a new current limiting example based on the target current limiting factor combination under the condition that the number of the second target requests reaches a first preset threshold value.
According to an embodiment of the present disclosure, a current limit instance has an instance primary key associated with a combination of current limit factors used to generate the current limit instance.
The matching module 620 includes a first matching unit and a second matching unit according to an embodiment of the present disclosure.
And the first matching unit is used for determining the target instance main key based on the target current limiting factor combination.
And the second matching unit is used for respectively matching the example main keys of the plurality of current limiting examples by using the target example main key to obtain a matching result.
According to an embodiment of the present disclosure, a current limit instance is configured with a current limit period.
The matching module 620 includes a third matching unit, a fourth matching unit, and a fifth matching unit according to an embodiment of the present disclosure.
And the third matching unit is used for acquiring the current system time.
And the fourth matching unit is used for determining at least one second target current limiting example from the plurality of current limiting examples in the example library based on the current system time, wherein the current system time is positioned in the current limiting period of the second target current limiting example.
And the fifth matching unit is used for matching the request parameters with at least one second target current limiting example to obtain a matching result.
According to an embodiment of the present disclosure, the request processing apparatus 600 further includes a first processing module and a storage module.
The first processing module is used for loading the request wrapper into the initialization container to obtain a target container.
And the storage module is used for storing the request parameters of the first target request by using the target container so as to read the request parameters of the first target request for multiple times.
According to an embodiment of the present disclosure, the request processing apparatus 600 further includes a second processing module and a third processing module.
And the second processing module is used for embedding the filter into a request reading method of the target application.
And the third processing module is used for responding to the target application calling request reading method, and resetting the first target request by using the filter so that the target application can respond to the first target request.
According to an embodiment of the present disclosure, the determining module 630 includes a first determining unit, a second determining unit, and a third determining unit.
And the first determining unit is used for determining target request frequency information of the first target current limiting example from the cache under the condition that the matching result represents that the request parameter hits the first target current limiting example, wherein the first target current limiting example has a time window, and the target request frequency information represents the hit frequency of the first target current limiting example in the time window.
And the second determining unit is used for obtaining a current limiting result representing that the target request is refused to respond under the condition that the hit times represented by the target request time information is greater than or equal to a second preset threshold value.
And the third determining unit is used for obtaining a current limiting result representing a response target request and modifying the target request frequency information under the condition that the hit frequency represented by the target request frequency information is smaller than a second preset threshold value.
According to an embodiment of the present disclosure, the request processing device 600 further includes a write module.
And the writing module is used for writing the initialization request frequency information of the first target current limiting example into the cache under the condition that the target request frequency information of the first target current limiting example cannot be acquired from the cache, wherein the hit frequency represented by the initialization request frequency information is smaller than a second preset threshold.
According to an embodiment of the present disclosure, the request processing apparatus 600 further includes a fourth processing module.
And the fourth processing module is used for responding to the first target request under the condition that the matching result represents that the request parameter does not hit the first target current limiting example.
Any number of modules, sub-modules, units, sub-units, or at least part of the functionality of any number thereof according to embodiments of the present disclosure may be implemented in one module. Any one or more of the modules, sub-modules, units, sub-units according to the embodiments of the present disclosure may be implemented by being split into a plurality of modules. Any one or more of the modules, sub-modules, units, sub-units according to embodiments of the present disclosure may be implemented at least in part as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented in any other reasonable manner of hardware or firmware by integrating or packaging a circuit, or in any one of or a suitable combination of software, hardware, and firmware implementations. Alternatively, one or more of the modules, sub-modules, units, sub-units according to embodiments of the disclosure may be at least partially implemented as a computer program module, which when executed may perform the corresponding functions.
For example, any plurality of the obtaining module 610, the matching module 620, the determining module 630 and the collecting module 640 may be combined and implemented in one module/unit/sub-unit, or any one of the modules/units/sub-units may be split into a plurality of modules/units/sub-units. Alternatively, at least part of the functionality of one or more of these modules/units/sub-units may be combined with at least part of the functionality of other modules/units/sub-units and implemented in one module/unit/sub-unit. According to an embodiment of the present disclosure, at least one of the obtaining module 610, the matching module 620, the determining module 630, and the acquiring module 640 may be implemented at least partially as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented by hardware or firmware in any other reasonable manner of integrating or packaging a circuit, or may be implemented by any one of three implementations of software, hardware, and firmware, or any suitable combination of any of the three. Alternatively, at least one of the obtaining module 610, the matching module 620, the determining module 630 and the acquiring module 640 may be at least partially implemented as a computer program module, which when executed may perform the corresponding functions.
It should be noted that the request processing device portion in the embodiment of the present disclosure corresponds to the request processing method portion in the embodiment of the present disclosure, and the description of the request processing device portion specifically refers to the request processing method portion, and is not repeated herein.
Fig. 7 schematically shows a block diagram of an electronic device adapted to implement a request processing method according to an embodiment of the present disclosure. The electronic device shown in fig. 7 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 7, a computer electronic device 700 according to an embodiment of the present disclosure includes a processor 701, which can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 702 or a program loaded from a storage section 708 into a Random Access Memory (RAM) 703. The processor 701 may include, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or associated chipset, and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), among others. The processor 701 may also include on-board memory for caching purposes. The processor 701 may comprise a single processing unit or a plurality of processing units for performing the different actions of the method flows according to embodiments of the present disclosure.
In the RAM703, various programs and data necessary for the operation of the electronic apparatus 700 are stored. The processor 701, the ROM 702, and the RAM703 are connected to each other by a bus 704. The processor 701 performs various operations of the method flows according to the embodiments of the present disclosure by executing programs in the ROM 702 and/or the RAM 703. It is noted that the programs may also be stored in one or more memories other than the ROM 702 and RAM 703. The processor 701 may also perform various operations of method flows according to embodiments of the present disclosure by executing programs stored in the one or more memories.
Electronic device 700 may also include input/output (I/O) interface 705, which input/output (I/O) interface 705 is also connected to bus 704, according to an embodiment of the present disclosure. The electronic device 700 may also include one or more of the following components connected to the I/O interface 705: an input portion 706 including a keyboard, a mouse, and the like; an output section 707 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 708 including a hard disk and the like; and a communication section 709 including a network interface card such as a LAN card, a modem, or the like. The communication section 709 performs communication processing via a network such as the internet. A drive 710 is also connected to the I/O interface 705 as needed. A removable medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 710 as necessary, so that a computer program read out therefrom is mounted into the storage section 708 as necessary.
According to embodiments of the present disclosure, method flows according to embodiments of the present disclosure may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable storage medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 709, and/or installed from the removable medium 711. The computer program, when executed by the processor 701, performs the above-described functions defined in the system of the embodiment of the present disclosure. The systems, devices, apparatuses, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the present disclosure.
The present disclosure also provides a computer-readable storage medium, which may be contained in the apparatus/device/system described in the above embodiments; or may exist alone without being assembled into the device/apparatus/system. The computer-readable storage medium carries one or more programs which, when executed, implement the method according to an embodiment of the disclosure.
According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium. Examples may include, but are not limited to: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
For example, according to embodiments of the present disclosure, a computer-readable storage medium may include the ROM 702 and/or the RAM703 and/or one or more memories other than the ROM 702 and the RAM703 described above.
Embodiments of the present disclosure also include a computer program product comprising a computer program containing program code for performing the method provided by embodiments of the present disclosure, which, when the computer program product is run on an electronic device, is adapted to cause the electronic device to carry out the request processing method provided by embodiments of the present disclosure.
When executed by the processor 701, performs the above-described functions defined in the system/apparatus of the embodiments of the present disclosure. The systems, apparatuses, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the present disclosure.
In one embodiment, the computer program may be hosted on a tangible storage medium such as an optical storage device, a magnetic storage device, or the like. In another embodiment, the computer program may also be transmitted in the form of a signal on a network medium, distributed, downloaded and installed via the communication section 709, and/or installed from the removable medium 711. The computer program containing program code may be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
In accordance with embodiments of the present disclosure, program code for executing computer programs provided by embodiments of the present disclosure may be written in any combination of one or more programming languages, and in particular, these computer programs may be implemented using high level procedural and/or object oriented programming languages, and/or assembly/machine languages. The programming language includes, but is not limited to, programming languages such as Java, C + +, python, the "C" language, or the like. The program code may execute entirely on the user's computing device, partly on the user's device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions. Those skilled in the art will appreciate that various combinations and/or combinations of features recited in the various embodiments and/or claims of the present disclosure can be made, even if such combinations or combinations are not expressly recited in the present disclosure. In particular, various combinations and/or combinations of the features recited in the various embodiments and/or claims of the present disclosure may be made without departing from the spirit or teaching of the present disclosure. All such combinations and/or associations are within the scope of the present disclosure.
The embodiments of the present disclosure have been described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described separately above, this does not mean that the measures in the embodiments cannot be used in advantageous combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be devised by those skilled in the art without departing from the scope of the present disclosure, and such alternatives and modifications are intended to be within the scope of the present disclosure.

Claims (14)

1. A request processing method, comprising:
the method comprises the steps that preset annotations in target application are used as tangent points of a current limiting tangent plane, and a first target request is obtained through the tangent points, wherein the first target request carries request parameters;
matching the request parameters with a plurality of current limiting examples in an example library to obtain a matching result;
under the condition that the matching result represents that the request parameter hits a first target current limiting example, determining a current limiting result based on the request frequency information of the first target current limiting example; and
and under the condition that the matching result represents that the request parameter does not hit any one current limiting example in the example library, acquiring the first target request through a monitoring section so as to generate a new current limiting example based on the acquired request.
2. The method of claim 1, wherein said collecting the first target request through a monitoring profile to generate a new instance of current limiting based on the collected request comprises:
the preset annotation in the target application is used as a tangent point of the monitoring tangent plane, and the first target request is collected through the tangent point;
extracting at least one current limiting factor from request parameters of the first target request;
determining a target combination of current limiting factors based on at least one of the current limiting factors;
storing the first target request in a target request set associated with the target current limiting factor combination; and
and generating a new current limiting instance based on the target current limiting factor combination under the condition that the number of the requests stored in the target request set meets a preset current limiting condition.
3. The method of claim 2, wherein the first target request is configured with a time tag;
wherein, in the case that the number of requests stored in the target request set satisfies a preset current limiting condition, generating a new current limiting instance based on the target current limiting factor combination comprises:
determining a number of second target requests stored in the target request set within a sliding time window based on time tags of the requests stored in the target request set, wherein a time represented by the time tag of the second target request is located within the sliding time window; and
and generating a new current limiting instance based on the target current limiting factor combination under the condition that the number of the second target requests reaches a first preset threshold value.
4. The method of claim 3, wherein the current limit instance has an instance primary key associated with a combination of current limit factors used to generate the current limit instance;
wherein, the matching with the request parameter and the plurality of current limiting examples in the example base to obtain the matching result comprises:
determining a target instance primary key based on the target current limiting factor combination; and
and respectively matching the example main keys of the plurality of current limiting examples by using the target example main key to obtain a matching result.
5. The method of claim 1, wherein the current limit instance is configured with a current limit period;
wherein, the matching with the request parameter and the plurality of current limiting examples in the example base to obtain the matching result comprises:
acquiring the current system time;
determining at least one second target current limiting instance from a plurality of current limiting instances in the instance base based on the current system time, wherein the current system time is within a current limiting period of the second target current limiting instance; and
and matching the request parameters with at least one second target current limiting instance to obtain the matching result.
6. The method of claim 1, further comprising:
loading the request wrapper into the initialization container to obtain a target container; and
storing the request parameters of the first target request with the target container for multiple reads of the request parameters of the first target request.
7. The method of claim 6, further comprising:
embedding a filter into a request reading method of the target application;
and resetting the first target request by utilizing the filter in response to the target application calling the request reading method so that the target application responds to the first target request.
8. The method according to claim 1, wherein the determining a current limiting result based on the request number information of a first target current limiting instance in case that the matching result characterizes that the request parameter hits the first target current limiting instance comprises:
determining target request times information of the first target current limiting instance from a cache under the condition that the matching result represents that the request parameters hit the first target current limiting instance, wherein the first target current limiting instance has a time window, and the target request times information represents the hit times of the first target current limiting instance in the time window;
obtaining the current limiting result representing that the target request is refused to respond under the condition that the hit times represented by the target request time information is greater than or equal to a second preset threshold; and
and under the condition that the hit times represented by the target request time information is smaller than the second preset threshold, obtaining the current limiting result representing the response of the target request, and modifying the target request time information.
9. The method of claim 8, further comprising:
and writing the initialization request frequency information of the first target current limiting example into the cache under the condition that the target request frequency information of the first target current limiting example cannot be acquired from the cache, wherein the hit frequency represented by the initialization request frequency information is smaller than the second preset threshold.
10. The method of claim 1, further comprising:
and responding to the first target request under the condition that the matching result represents that the request parameter does not hit the first target current limiting example.
11. A request processing apparatus comprising:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a first target request through a tangent point by using a preset annotation in a target application as the tangent point of a current-limiting tangent plane, and the first target request carries request parameters;
the matching module is used for matching the request parameters with a plurality of current limiting examples in an example library to obtain a matching result;
the determining module is used for determining a current limiting result based on the request frequency information of a first target current limiting example under the condition that the matching result represents that the request parameter hits the first target current limiting example; and
and the acquisition module is used for acquiring the first target request through a monitoring section under the condition that the matching result represents that the request parameter does not hit any current-limiting example in the example library so as to generate a new current-limiting example based on the acquired request.
12. An electronic device, comprising:
one or more processors;
a memory to store one or more instructions that,
wherein the one or more instructions, when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-10.
13. A computer readable storage medium having stored thereon executable instructions which, when executed by a processor, cause the processor to carry out the method of any one of claims 1 to 10.
14. A computer program product comprising computer executable instructions for implementing the method of any one of claims 1 to 10 when executed.
CN202211250399.XA 2022-10-12 2022-10-12 Request processing method and device, electronic equipment and storage medium Pending CN115567601A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211250399.XA CN115567601A (en) 2022-10-12 2022-10-12 Request processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211250399.XA CN115567601A (en) 2022-10-12 2022-10-12 Request processing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115567601A true CN115567601A (en) 2023-01-03

Family

ID=84744164

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211250399.XA Pending CN115567601A (en) 2022-10-12 2022-10-12 Request processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115567601A (en)

Similar Documents

Publication Publication Date Title
CN111522595B (en) Transient application
US10481964B2 (en) Monitoring activity of software development kits using stack trace analysis
US11503070B2 (en) Techniques for classifying a web page based upon functions used to render the web page
US10831892B2 (en) Web browser script monitoring
US10084637B2 (en) Automatic task tracking
US20150207691A1 (en) Preloading content based on network connection behavior
US20200314159A1 (en) Anomaly detection for streaming data
US10291492B2 (en) Systems and methods for discovering sources of online content
CN115357663A (en) Data synchronization method, system and device based on incremental data synchronization component
CN113191889A (en) Wind control configuration method, configuration system, electronic device and readable storage medium
CN112965916A (en) Page testing method, page testing device, electronic equipment and readable storage medium
US10831883B1 (en) Preventing application installation using system-level messages
CN115567601A (en) Request processing method and device, electronic equipment and storage medium
CN113132400B (en) Business processing method, device, computer system and storage medium
CN114780361A (en) Log generation method, device, computer system and readable storage medium
CN114925066A (en) Data processing method and device, electronic equipment and storage medium
CN112966167A (en) Data crawling method, device, computer system and computer readable storage medium
CN112083945A (en) NPM installation package update prompting method and device, electronic equipment and storage medium
CN114329612A (en) Sensitive data identification method and device, electronic equipment and storage medium
US20230142390A1 (en) Resource monitoring for web applications with video and animation content
EP4191946A1 (en) Cloud environment security tool
US20200364093A1 (en) System and methods for generating secure ephemeral cloud-based computing resources for data operations
CN115134237A (en) Data updating method, heartbeat detection method, device, equipment and medium
US9942352B2 (en) Method and system for a crowd service store
CN115293273A (en) User portrait generation method, user portrait model training method and device

Legal Events

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