CN112202682A - Interface flow control method and device, computer equipment and storage medium - Google Patents

Interface flow control method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN112202682A
CN112202682A CN202011034772.9A CN202011034772A CN112202682A CN 112202682 A CN112202682 A CN 112202682A CN 202011034772 A CN202011034772 A CN 202011034772A CN 112202682 A CN112202682 A CN 112202682A
Authority
CN
China
Prior art keywords
flow control
client
information
request
preset
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
CN202011034772.9A
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.)
Ping An International Smart City Technology Co Ltd
Original Assignee
Ping An International Smart City 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 Ping An International Smart City Technology Co Ltd filed Critical Ping An International Smart City Technology Co Ltd
Priority to CN202011034772.9A priority Critical patent/CN112202682A/en
Publication of CN112202682A publication Critical patent/CN112202682A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/215Flow control; Congestion control using token-bucket

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention relates to the technical field of data analysis, and particularly discloses an interface flow control method, an interface flow control device, computer equipment and a computer readable storage medium, wherein the method comprises the following steps: the method comprises the steps of extracting request information carried by an interface request by intercepting the interface request sent by a client; acquiring user dimension information of the client based on the request information, wherein the request information comprises a uniform resource locator and request parameters; determining whether to control the flow of the client side according to the uniform resource locator, the request parameter and/or the user dimension information; and if the flow control is determined to be carried out on the client, the interception information is sent to the client, so that flexible configuration according to user dimensions is realized, the system is protected, and the user experience of the whole platform is improved. Meanwhile, the invention also relates to a block chain technology, and the method can be applied to the fields of intelligent government affairs, intelligent education, intelligent medical treatment and the like, so that the construction of the intelligent city can be further promoted.

Description

Interface flow control method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of data analysis technologies, and in particular, to a method and an apparatus for controlling interface traffic, a computer device, and a computer-readable storage medium.
Background
Flow control is a necessary platform basic function of medium and large-sized internet products, and for a background interface with very high frequency, relatively poor performance and relatively large expense, if certain flow control protection is not performed, it is likely that the calling of the interface exhausts background threads and CPU resources when the concurrent traffic volume of the services is very large in a peak period, thereby affecting all related services.
At present, two open source projects, namely Sentinel and hystrix, are used in the market, the flow control strategies of the two open source projects are all used for performing QPS (quick Path bridging) flow control according to interface dimensions, and the granularity of control is only up to the interface level, so that the two open source projects cannot be distinguished according to specific user dimensions, and different flow control strategies cannot be performed according to different user dimensions.
Disclosure of Invention
The present application mainly aims to provide an interface flow control method, an interface flow control device, a computer device, and a computer-readable storage medium, and aims to solve the technical problems that the existing flow control cannot be distinguished for specific user dimensions, and cannot be subjected to different flow control strategies for different user dimensions.
In a first aspect, the present application provides an interface flow control method, where the interface flow control method includes the following steps:
intercepting an interface request sent by a client, and extracting request information carried by the interface request;
acquiring user dimension information of the client based on the request information, wherein the request information comprises a uniform resource locator and request parameters;
determining whether to control the flow of the client side according to the uniform resource locator, the request parameter and/or the user dimension information;
and if the flow control is determined to be carried out on the client, sending interception information to the client.
In a second aspect, the present application also provides an interface flow control device, comprising:
the extraction module is used for intercepting an interface request sent by a client and extracting request information carried by the interface request;
the acquisition module is used for acquiring user dimension information of the client based on the request information, wherein the request information comprises a uniform resource locator and request parameters;
a determining module, configured to determine whether to perform flow control on the client according to the uniform resource locator, the request parameter, and/or the user dimension information;
and the sending module is used for sending interception information to the client if the flow control of the client is determined.
In a third aspect, the present application further provides a computer device, which includes a processor, a memory, and a computer program stored on the memory and executable by the processor, wherein the computer program, when executed by the processor, implements the steps of the interface flow control method as described above.
In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, where the computer program, when executed by a processor, implements the steps of the interface flow control method as described above.
The application provides an interface flow control method, an interface flow control device, computer equipment and a computer readable storage medium, wherein request information carried by an interface request is extracted by intercepting the interface request sent by a client; acquiring user dimension information of the client based on the request information, wherein the request information comprises a uniform resource locator and request parameters; determining whether to control the flow of the client side according to the uniform resource locator, the request parameter and/or the user dimension information; and if the flow control is determined to be carried out on the client, the interception information is sent to the client, so that flexible configuration according to user dimensions is realized, the system is protected, and the user experience of the whole platform is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic flowchart of an interface flow control method according to an embodiment of the present application;
FIG. 2 is a flow diagram illustrating sub-steps of the interface flow control method of FIG. 1;
FIG. 3 is a schematic block diagram of an interface flow control device provided by an embodiment of the present application;
fig. 4 is a block diagram illustrating a structure of a computer device according to an embodiment of the present application.
The implementation, functional features and advantages of the objectives of the present application will be further explained with reference to the accompanying drawings.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The flow diagrams depicted in the figures are merely illustrative and do not necessarily include all of the elements and operations/steps, nor do they necessarily have to be performed in the order depicted. For example, some operations/steps may be decomposed, combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
The embodiment of the application provides an interface flow control method, an interface flow control device, computer equipment and a computer readable storage medium. The interface flow control method can be applied to computer equipment, and the computer equipment can be electronic equipment such as a notebook computer, a desktop computer and the like.
Some embodiments of the present application will be described in detail below with reference to the accompanying drawings. The embodiments described below and the features of the embodiments can be combined with each other without conflict.
Referring to fig. 1, fig. 1 is a schematic flowchart illustrating an interface flow control method according to an embodiment of the present application.
As shown in fig. 1, the interface flow control method includes steps S101 to S104.
Step S101, an interface request sent by a client is intercepted, and request information carried by the interface request is extracted.
An example is that an interface request sent by a client is intercepted in real time, the request information is analyzed, and the request information carried in the interface request is extracted, wherein the client comprises an electronic device such as a mobile phone and a computer. The server comprises an application layer flow control interceptor for intercepting an interface request sent by a client, analyzing the interface request, and extracting a session ID, request parameters and/or a resource identifier (URI) and the like in the interface request. For example, a client sends an interface request to a server to connect to a server interface. When detecting an interface request sent by a client, a server intercepts the interface request through an application layer flow control interceptor, and acquires a session ID, request parameters and/or a resource identifier (URI) and the like carried in the interface request.
Step S102, acquiring user dimension information of the client based on the request information, wherein the request information comprises a uniform resource locator and a request parameter.
An example is that, when a session ID in the request information is extracted, the session ID is matched with preset session information, identification information of the preset session ID matched with the session ID in the preset session information is obtained, and the identification information is used as user dimension information corresponding to the session ID, where the user dimension information includes tenant information to which the user belongs and department information to which the tenant information belongs. For example, the session ID and the user dimension information are identified in advance to generate session information.
Step S103, determining whether to control the flow of the client according to the uniform resource locator, the request parameter and/or the user dimension information.
An example is that when the URI and/or the user dimension information in the request information is obtained, the URI is compared with a preset URI, and if the URI and the preset URI are consistent, it is determined to perform flow control on the client; or, comparing the user dimension information with preset user dimension information, and if the comparison is consistent, determining to control the flow of the client; or comparing the URI with a preset URI, if the comparison is consistent, comparing the user dimension information with preset user dimension information, and if the comparison is consistent, determining to control the flow of the client. Here, URI (Uniform Resource Identifier) is a character string for identifying a name of a certain internet Resource. This identification allows the user to interoperate with any resource (including local and internet) via a particular protocol.
For example, the URI is set in advance, and when the URI is a preset URI, it is necessary to perform flow control on the client. When the obtained URI is ftp:// a:1234/b/c/d.txt and the preset URI is ftp:// a:1234/b/c/d.txt, carrying out flow control on the client; or when the acquired tenant information to which the user belongs is the same as the tenant information to which the preset user belongs and the department information to which the user belongs is the same as the preset department information to which the user belongs, determining that the flow control needs to be performed on the client.
In an embodiment, specifically referring to fig. 2, step S103 includes: sub-step S1031 to sub-step S1032.
And a substep S1031, based on the uniform resource locator, obtaining a preset flow control rule corresponding to the uniform resource locator.
And acquiring a preset flow control rule based on a uniform resource locator (URI) in the request information. And when the uniform resource locator in the request information is acquired, acquiring the KEY value of the uniform resource locator, and acquiring the KEY value corresponding to the to-be-KEY value through the KEY value. And acquiring the flow control rule configured for the value based on the value. The flow control rule includes user dimension information and/or request parameters.
And a substep S1032 of determining whether to perform flow control on the client according to the preset flow control rule, the user dimension information and/or the request parameter.
And when the preset flow control rule is obtained, whether the flow control is carried out on the user side is determined through the preset flow control rule, the user dimension information and/or the request parameter.
Specifically, the determining whether to perform flow control on the client according to the preset flow control rule, the user dimension information, and/or the request parameter includes: comparing the user dimension information with preset user information in the preset flow control rule; and if the user dimension information is consistent with the user information, determining to control the flow of the client.
When a preset flow control rule is acquired, reading preset user information in the preset flow control rule, wherein the preset user information comprises tenant information to which a user belongs and department information to which the user belongs, comparing the user dimension information with the preset user information, and if the tenant information to which the user belongs in the user dimension information is consistent with the tenant information to which the user belongs in the preset user information, and the department information to which the user belongs in the user dimension information is consistent with the department information to which the user belongs in the preset user information, determining to perform flow control on the client. The comparison mode can adopt a twin neural network model, the preset user information and the user dimension information are predicted through the twin neural network model, and if the similarity is larger than or equal to a preset threshold value, the preset user information and the user dimension information are determined to be consistent.
Specifically, the determining whether to perform flow control on the client according to the preset flow control rule, the user dimension information, and/or the request parameter includes: comparing the request parameters with preset key parameters in the preset flow control rule; and if the request parameter is consistent with the preset key parameter, determining to perform flow control on the client.
When the preset flow control rule is obtained, reading preset key parameters in the preset flow control rule, comparing the key parameters with request parameters, and if the request parameters are consistent with the preset key parameters, determining to compare the request parameters with the request parameters. The comparison mode can adopt a twin neural network model, the preset key parameters and the request parameters are predicted through the twin neural network model, and if the similarity is greater than or equal to a preset threshold value, the preset key parameters and the request parameters are determined to be consistent.
Specifically, the determining whether to perform flow control on the client according to the preset flow control rule, the user dimension information, and/or the request parameter includes: comparing the request parameters with preset key parameters in the preset flow control rule; comparing the user dimension information with the user information in the preset flow control rule; and if the user dimension information is consistent with the user information and the request parameter is consistent with the preset key parameter, determining to perform flow control on the client.
When a preset flow control rule is acquired, reading preset user information and preset key parameters in the preset flow control rule, wherein the preset user information comprises tenant information to which a user belongs and department information to which the user belongs, comparing the user dimension information with the preset user information and comparing the key parameters with request parameters, and if the tenant information to which the user belongs in the user dimension information is consistent with the tenant information to which the user belongs in the preset user information, the department information to which the user belongs in the user dimension information is consistent with the department information to which the user belongs in the preset user information, and the request parameters are consistent with the preset key parameters, determining to perform flow control on the client. The user dimension information and the preset user information can be compared by adopting a twin neural network model, the preset user information and the user dimension information are predicted through the twin neural network model, and if the similarity is larger than or equal to a preset threshold value, the preset user information and the user dimension information are determined to be consistent. The preset key parameter and the request parameter can be compared by adopting a twin neural network model, the preset key parameter and the request parameter are predicted by the twin neural network model, and if the similarity is greater than or equal to a preset threshold value, the preset key parameter and the request parameter are determined to be consistent.
Specifically, before determining to perform flow control on the client, the method further includes: updating tokens in a preset flow control token bucket processor, and counting the current token quantity in the preset flow control token bucket processor; and if the token number is less than 1, determining to perform flow control on the client.
And if the user dimension information is consistent with the preset user information and/or the preset key parameter is consistent with the request parameter, updating the token in the preset flow control token bucket processor. The preset flow control Token bucket processor will add Token to the bucket at a constant 1/QPS interval (10 ms if QPS is 100) over time (imagine that there is a tap that is constantly adding water as opposed to a leak), if the bucket is full, it will not add any more, new requests come, one Token each will be taken away, and if no Token is available, service will be blocked or denied. And counting the current token quantity in a preset flow control token bucket processor, and if the quantity is less than 1, carrying out flow control on the client.
Specifically, the preset flow control rule includes a request parameter and a key parameter, and after determining whether to perform flow control on the client, the method further includes: if the user dimension information is inconsistent with the user information and the request parameter is inconsistent with the preset key parameter, determining not to perform flow control on the client; or, updating tokens in a preset flow control token bucket processor, and if the current token number in the preset flow control token bucket processor is counted to be greater than 1, determining not to perform flow control on the client; and if the flow control is not carried out on the client, connecting the client based on the interface information in the request information.
When a preset flow control rule is acquired, reading preset user information and preset key parameters in the preset flow control rule, wherein the preset user information comprises tenant information to which a user belongs and department information to which the user belongs, comparing the user dimension information with the preset user information and comparing the key parameters with request parameters, and if the tenant information to which the user belongs in the user dimension information is not consistent with the tenant information to which the user belongs in the preset user information, and/or the department information to which the user belongs in the user dimension information is not consistent with the department information in the preset user information, and/or the request parameters are not consistent with the preset key parameters, determining not to control the flow of the client. The user dimension information and the preset user information can be compared by adopting a twin neural network model, the preset user information and the user dimension information are predicted through the twin neural network model, and if the similarity is smaller than a preset threshold value, the preset user information and the user dimension information are determined to be consistent. The preset key parameter and the request parameter can be compared by adopting a twin neural network model, the preset key parameter and the request parameter are predicted by the twin neural network model, and if the similarity is smaller than a preset threshold value, the preset key parameter and the request parameter are determined to be consistent.
And step S104, if the flow control is determined to be carried out on the client, sending interception information to the client.
And if the flow control is determined to be carried out on the client, intercepting the interface request through an application layer flow control interceptor, and sending connection information to the client. The connection information includes characters, pictures, and the like.
In the embodiment of the invention, the user dimension information of the client is obtained by extracting the request information in the interface request sent by the client, whether the flow control is carried out on the client is determined according to the request information and/or the user dimension information, and if the flow control is carried out on the client, the interception information is sent to the client. The flexible configuration is realized according to the user dimension, the system is protected, and the user experience of the whole platform is improved.
Referring to fig. 3, fig. 3 is a schematic block diagram of an interface flow control device according to an embodiment of the present disclosure.
As shown in fig. 3, the interface flow control apparatus 400 includes: an extraction module 401, an acquisition module 402, a determination module 403, and a sending module 404.
The extracting module 401 is configured to intercept an interface request sent by a client, and extract request information carried by the interface request;
an obtaining module 402, configured to obtain user dimension information of the client based on the request information, where the request information includes a uniform resource locator and a request parameter;
a determining module 403, configured to determine whether to perform flow control on the client according to the uniform resource locator, the request parameter, and/or the user dimension information;
a sending module 404, configured to send interception information to the client if it is determined that the flow control is performed on the client.
Wherein, the determining module 403 is specifically further configured to:
acquiring a preset flow control rule corresponding to the uniform resource locator based on the uniform resource locator;
and determining whether to control the flow of the client side according to the preset flow control rule, the user dimension information and/or the request parameter.
Wherein, the determining module 403 is specifically further configured to:
comparing the user dimension information with preset user information in the preset flow control rule;
and if the user dimension information is consistent with the user information, determining to control the flow of the client.
Wherein, the determining module 403 is specifically further configured to:
comparing the request parameters with preset key parameters in the preset flow control rule;
and if the request parameter is consistent with the preset key parameter, determining to perform flow control on the client.
Wherein, the determining module 403 is specifically further configured to:
comparing the request parameters with preset key parameters in the preset flow control rule;
comparing the user dimension information with the user information in the preset flow control rule;
and if the user dimension information is consistent with the user information and the request parameter is consistent with the preset key parameter, determining to perform flow control on the client.
Wherein, interface flow control device specifically still is used for:
updating tokens in a preset flow control token bucket processor, and counting the current token quantity in the preset flow control token bucket processor;
and if the token number is less than 1, determining to perform flow control on the client.
Wherein, interface flow control device is still used for:
if the user dimension information is inconsistent with the user information and the request parameter is inconsistent with the preset key parameter, determining not to perform flow control on the client; alternatively, the first and second electrodes may be,
updating tokens in a preset flow control token bucket processor, and if the current token quantity in the preset flow control token bucket processor is counted to be more than 1, determining not to control the flow of the client;
and if the flow control is not carried out on the client, connecting the client based on the interface information in the request information.
It should be noted that, as will be clear to those skilled in the art, for convenience and brevity of description, the specific working processes of the apparatus and each module and unit described above may refer to the corresponding processes in the foregoing embodiment of the interface flow control method, and are not described herein again.
The apparatus provided by the above embodiments may be implemented in the form of a computer program, which can be run on a computer device as shown in fig. 4.
Referring to fig. 4, fig. 4 is a schematic block diagram of a computer device according to an embodiment of the present disclosure. The computer device may be a terminal.
As shown in fig. 4, the computer device includes a processor, a memory, and a network interface connected by a system bus, wherein the memory may include a nonvolatile storage medium and an internal memory.
The non-volatile storage medium may store an operating system and a computer program. The computer program includes program instructions that, when executed, cause a processor to perform any of the interface flow control methods.
The processor is used for providing calculation and control capability and supporting the operation of the whole computer equipment.
The internal memory provides an environment for the execution of a computer program on a non-volatile storage medium, which when executed by the processor, causes the processor to perform any of the interface flow control methods.
The network interface is used for network communication, such as sending assigned tasks and the like. Those skilled in the art will appreciate that the architecture shown in fig. 4 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
It should be understood that the Processor may be a Central Processing Unit (CPU), and the Processor may be other general purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, etc. Wherein a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Wherein, in one embodiment, the processor is configured to execute a computer program stored in the memory to implement the steps of:
intercepting an interface request sent by a client, and extracting request information carried by the interface request;
acquiring user dimension information of the client based on the request information, wherein the request information comprises a uniform resource locator and request parameters;
determining whether to control the flow of the client side according to the uniform resource locator, the request parameter and/or the user dimension information;
and if the flow control is determined to be carried out on the client, sending interception information to the client.
In an embodiment, when determining whether to implement flow control for the client according to the uniform resource locator, the request parameter, and/or the user dimension information, the processor is configured to implement:
acquiring a preset flow control rule corresponding to the uniform resource locator based on the uniform resource locator;
and determining whether to control the flow of the client side according to the preset flow control rule, the user dimension information and/or the request parameter.
In an embodiment, when determining whether to implement flow control on the client according to the preset flow control rule, the user dimension information, and/or the request parameter, the processor is configured to implement:
comparing the user dimension information with preset user information in the preset flow control rule;
and if the user dimension information is consistent with the user information, determining to control the flow of the client.
In an embodiment, when determining whether to implement flow control on the client according to the preset flow control rule, the user dimension information, and/or the request parameter, the processor is configured to implement:
comparing the request parameters with preset key parameters in the preset flow control rule;
and if the request parameter is consistent with the preset key parameter, determining to perform flow control on the client.
In an embodiment, when determining whether to implement flow control on the client according to the preset flow control rule, the user dimension information, and/or the request parameter, the processor is configured to implement:
comparing the request parameters with preset key parameters in the preset flow control rule;
comparing the user dimension information with the user information in the preset flow control rule;
and if the user dimension information is consistent with the user information and the request parameter is consistent with the preset key parameter, determining to perform flow control on the client.
In one embodiment, when determining to implement flow control to the client before, the processor is configured to implement:
updating tokens in a preset flow control token bucket processor, and counting the current token quantity in the preset flow control token bucket processor;
and if the token number is less than 1, determining to perform flow control on the client.
In an embodiment, the processor, where the preset flow control rule includes a request parameter and a key parameter, and when determining whether to implement flow control on the client after determining that the flow control is performed, is configured to implement:
if the user dimension information is inconsistent with the user information and the request parameter is inconsistent with the preset key parameter, determining not to perform flow control on the client; alternatively, the first and second electrodes may be,
updating tokens in a preset flow control token bucket processor, and if the current token quantity in the preset flow control token bucket processor is counted to be more than 1, determining not to control the flow of the client;
and if the flow control is not carried out on the client, connecting the client based on the interface information in the request information.
Embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, where the computer program includes program instructions, and a method implemented when the program instructions are executed may refer to the embodiments of the interface flow control method in the present application.
The computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiment, for example, a hard disk or a memory of the computer device. The computer readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like provided on the computer device.
Further, the computer-readable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created according to the use of the blockchain node, and the like.
The block chain is a novel application mode of computer technologies such as storage of preset flow control rules, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system 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 system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments. While the invention has been described with reference to specific embodiments, the scope of the invention is not limited thereto, and those skilled in the art can easily conceive various equivalent modifications or substitutions within the technical scope of the invention. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. An interface flow control method, comprising:
intercepting an interface request sent by a client, and extracting request information carried by the interface request;
acquiring user dimension information of the client based on the request information, wherein the request information comprises a uniform resource locator and request parameters;
determining whether to control the flow of the client side according to the uniform resource locator, the request parameter and/or the user dimension information;
and if the flow control is determined to be carried out on the client, sending interception information to the client.
2. The method of claim 1, wherein the determining whether to perform flow control for the client according to the uniform resource locator, the request parameter, and/or the user dimension information comprises:
acquiring a preset flow control rule corresponding to the uniform resource locator based on the uniform resource locator;
and determining whether to control the flow of the client side according to the preset flow control rule, the user dimension information and/or the request parameter.
3. The interface flow control method according to claim 2, wherein the determining whether to perform flow control on the client according to the preset flow control rule, the user dimension information, and/or the request parameter includes:
comparing the user dimension information with preset user information in the preset flow control rule;
and if the user dimension information is consistent with the user information, determining to control the flow of the client.
4. The interface flow control method according to claim 2, wherein the determining whether to perform flow control on the client according to the preset flow control rule, the user dimension information, and/or the request parameter includes:
comparing the request parameters with preset key parameters in the preset flow control rule;
and if the request parameter is consistent with the preset key parameter, determining to perform flow control on the client.
5. The interface flow control method according to claim 2, wherein the determining whether to perform flow control on the client according to the preset flow control rule, the user dimension information, and/or the request parameter includes:
comparing the request parameters with preset key parameters in the preset flow control rule;
comparing the user dimension information with the user information in the preset flow control rule;
and if the user dimension information is consistent with the user information and the request parameter is consistent with the preset key parameter, determining to perform flow control on the client.
6. The interface traffic control method according to any one of claims 3 to 5, wherein before determining to traffic control the client, further comprising:
updating tokens in a preset flow control token bucket processor, and counting the current token quantity in the preset flow control token bucket processor;
and if the token number is less than 1, determining to perform flow control on the client.
7. The interface traffic control method according to claim 2, wherein the preset traffic control rule includes a request parameter and a key parameter, and after determining whether to perform traffic control on the client, the method further includes:
if the user dimension information is inconsistent with the user information and the request parameter is inconsistent with the preset key parameter, determining not to perform flow control on the client; alternatively, the first and second electrodes may be,
updating tokens in a preset flow control token bucket processor, and if the current token quantity in the preset flow control token bucket processor is counted to be more than 1, determining not to control the flow of the client;
and if the flow control is not carried out on the client, connecting the client based on the interface information in the request information.
8. An interface flow control device, comprising:
the extraction module is used for intercepting an interface request sent by a client and extracting request information carried by the interface request;
the acquisition module is used for acquiring user dimension information of the client based on the request information, wherein the request information comprises a uniform resource locator and request parameters;
a determining module, configured to determine whether to perform flow control on the client according to the uniform resource locator, the request parameter, and/or the user dimension information;
and the sending module is used for sending interception information to the client if the flow control of the client is determined.
9. A computer arrangement comprising a processor, a memory, and a computer program stored on the memory and executable by the processor, wherein the computer program, when executed by the processor, implements the steps of the interface flow control method according to any one of claims 1 to 7.
10. A computer-readable storage medium, having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the interface flow control method according to any of claims 1 to 7.
CN202011034772.9A 2020-09-27 2020-09-27 Interface flow control method and device, computer equipment and storage medium Pending CN112202682A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011034772.9A CN112202682A (en) 2020-09-27 2020-09-27 Interface flow control method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011034772.9A CN112202682A (en) 2020-09-27 2020-09-27 Interface flow control method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112202682A true CN112202682A (en) 2021-01-08

Family

ID=74007399

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011034772.9A Pending CN112202682A (en) 2020-09-27 2020-09-27 Interface flow control method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112202682A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113220723A (en) * 2021-04-27 2021-08-06 深圳市云网万店科技有限公司 Flow control method and device, computer equipment and storage medium
CN113316125A (en) * 2021-06-28 2021-08-27 广州小鹏汽车科技有限公司 Monitoring method, distributed vehicle-mounted system, vehicle and readable storage medium
CN113489702A (en) * 2021-06-29 2021-10-08 网易(杭州)网络有限公司 Interface current limiting method and device and electronic equipment
CN113890853A (en) * 2021-09-27 2022-01-04 北京字跳网络技术有限公司 Current limiting method and device, storage medium and electronic equipment
CN113938430A (en) * 2021-09-15 2022-01-14 山东有人物联网股份有限公司 Flow control method, device, equipment and storage medium
CN114301778A (en) * 2021-12-29 2022-04-08 中国建设银行股份有限公司 Method and device for controlling access
CN114338092A (en) * 2021-12-09 2022-04-12 江苏网进科技股份有限公司 Light-weight interface current limiting method

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103701709A (en) * 2013-12-13 2014-04-02 北京京东尚科信息技术有限公司 Flow rate control method and system
CN108566304A (en) * 2018-04-26 2018-09-21 努比亚技术有限公司 Interface control method, electronic equipment and computer readable storage medium
CN109194584A (en) * 2018-08-13 2019-01-11 中国平安人寿保险股份有限公司 A kind of flux monitoring method, device, computer equipment and storage medium
CN109246026A (en) * 2018-08-13 2019-01-18 中国平安人寿保险股份有限公司 Traffic management and control method, apparatus, equipment and storage medium
CN110213173A (en) * 2019-06-06 2019-09-06 北京百度网讯科技有限公司 Flow control methods and device, system, server, computer-readable medium
CN110290070A (en) * 2019-05-15 2019-09-27 北京三快在线科技有限公司 A kind of flow control methods, device, equipment and readable storage medium storing program for executing
CN110535777A (en) * 2019-08-12 2019-12-03 新华三大数据技术有限公司 Access request control method, device, electronic equipment and readable storage medium storing program for executing
CN111447150A (en) * 2020-02-29 2020-07-24 中国平安财产保险股份有限公司 Access request current limiting method, server and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103701709A (en) * 2013-12-13 2014-04-02 北京京东尚科信息技术有限公司 Flow rate control method and system
CN108566304A (en) * 2018-04-26 2018-09-21 努比亚技术有限公司 Interface control method, electronic equipment and computer readable storage medium
CN109194584A (en) * 2018-08-13 2019-01-11 中国平安人寿保险股份有限公司 A kind of flux monitoring method, device, computer equipment and storage medium
CN109246026A (en) * 2018-08-13 2019-01-18 中国平安人寿保险股份有限公司 Traffic management and control method, apparatus, equipment and storage medium
CN110290070A (en) * 2019-05-15 2019-09-27 北京三快在线科技有限公司 A kind of flow control methods, device, equipment and readable storage medium storing program for executing
CN110213173A (en) * 2019-06-06 2019-09-06 北京百度网讯科技有限公司 Flow control methods and device, system, server, computer-readable medium
CN110535777A (en) * 2019-08-12 2019-12-03 新华三大数据技术有限公司 Access request control method, device, electronic equipment and readable storage medium storing program for executing
CN111447150A (en) * 2020-02-29 2020-07-24 中国平安财产保险股份有限公司 Access request current limiting method, server and storage medium

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113220723A (en) * 2021-04-27 2021-08-06 深圳市云网万店科技有限公司 Flow control method and device, computer equipment and storage medium
CN113316125A (en) * 2021-06-28 2021-08-27 广州小鹏汽车科技有限公司 Monitoring method, distributed vehicle-mounted system, vehicle and readable storage medium
CN113489702A (en) * 2021-06-29 2021-10-08 网易(杭州)网络有限公司 Interface current limiting method and device and electronic equipment
CN113938430A (en) * 2021-09-15 2022-01-14 山东有人物联网股份有限公司 Flow control method, device, equipment and storage medium
CN113938430B (en) * 2021-09-15 2023-06-30 山东有人物联网股份有限公司 Flow control method, device, equipment and storage medium
CN113890853A (en) * 2021-09-27 2022-01-04 北京字跳网络技术有限公司 Current limiting method and device, storage medium and electronic equipment
CN113890853B (en) * 2021-09-27 2024-04-19 北京字跳网络技术有限公司 Current limiting method and device, storage medium and electronic equipment
CN114338092A (en) * 2021-12-09 2022-04-12 江苏网进科技股份有限公司 Light-weight interface current limiting method
CN114301778A (en) * 2021-12-29 2022-04-08 中国建设银行股份有限公司 Method and device for controlling access
CN114301778B (en) * 2021-12-29 2024-05-03 中国建设银行股份有限公司 Access control method and device

Similar Documents

Publication Publication Date Title
CN112202682A (en) Interface flow control method and device, computer equipment and storage medium
CN109492983B (en) Electronic seal signing method, device, equipment and medium based on block chain intelligent contract
CN107657156B (en) User identity authentication method and device based on user operation habit and touch area
CN110602052A (en) Micro-service processing method and server
US20080072283A1 (en) Methods, apparatus and systems for time-based function back-off
CN107451819B (en) Identity verification method and device based on user operation behavior characteristics
CN114026823A (en) Computer system for processing anonymous data and method of operation thereof
WO2020181809A1 (en) Data processing method and system based on interface checking, and computer device
CN113472774B (en) Account login-free method, system, device and computer readable storage medium
CN106341381A (en) Method and system of key management for rack server system
CN109347620B (en) Sample alignment method, system and computer readable storage medium
CN109547426B (en) Service response method and server
CN112613917A (en) Information pushing method, device and equipment based on user portrait and storage medium
CN112818014B (en) Block chain data analysis method and device and electronic equipment
CN110347750B (en) Block chain-based data processing method and device
CN112328486A (en) Interface automation test method and device, computer equipment and storage medium
Lee et al. ATMSim: An anomaly teletraffic detection measurement analysis simulator
CN112099870B (en) Document processing method, device, electronic equipment and computer readable storage medium
CN110381114B (en) Interface request parameter processing method and device, terminal equipment and medium
CN116015840B (en) Data operation auditing method, system, equipment and storage medium
CN111817859A (en) Data sharing method, device, equipment and storage medium based on zero knowledge proof
US9904661B2 (en) Real-time agreement analysis
CN116933316A (en) Method and device for analyzing consistency of intelligent terminal application sensitive behavior and privacy policy
CN107995167B (en) Equipment identification method and server
CN111212153A (en) IP address checking method, device, terminal 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
RJ01 Rejection of invention patent application after publication

Application publication date: 20210108

RJ01 Rejection of invention patent application after publication