CN111245935A - Timeout request processing method and device, computer equipment and storage medium - Google Patents
Timeout request processing method and device, computer equipment and storage medium Download PDFInfo
- Publication number
- CN111245935A CN111245935A CN202010026073.3A CN202010026073A CN111245935A CN 111245935 A CN111245935 A CN 111245935A CN 202010026073 A CN202010026073 A CN 202010026073A CN 111245935 A CN111245935 A CN 111245935A
- Authority
- CN
- China
- Prior art keywords
- array
- identification value
- request
- annular array
- 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.)
- Granted
Links
- 238000003672 processing method Methods 0.000 title description 11
- 238000000034 method Methods 0.000 claims abstract description 28
- 238000012545 processing Methods 0.000 claims abstract description 28
- 238000003491 array Methods 0.000 claims abstract description 15
- 238000004590 computer program Methods 0.000 claims description 21
- 238000010586 diagram Methods 0.000 description 9
- 230000004044 response Effects 0.000 description 7
- 238000004891 communication Methods 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 230000006870 function Effects 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/14—Session management
- H04L67/146—Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/60—Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The embodiment of the invention discloses a method and a device for processing a timeout request, computer equipment and a storage medium. The method comprises the following steps: if a request sent by a client is received, adding an identification value of the request into a feature array of a preset annular array, wherein the distance between the feature array and an array currently pointed by task pointers of the annular array is a preset number of arrays, and the task pointers of the annular array jump by one array at intervals of preset time; and acquiring an identification value in the array currently pointed by the task pointer of the annular array as a target identification value, and disconnecting the http connection of the request corresponding to the target identification value, so that the server downtime caused by excessive requests can be avoided, and the pressure of the server can be effectively relieved.
Description
Technical Field
The present invention relates to the field of internet technologies, and in particular, to a method and an apparatus for processing an timeout request, a computer device, and a storage medium.
Background
As business systems become more and more serviced, more and more users are used. As the number of users used is increasing, the situation that the connection is requested in a larger order of magnitude at the same time and concurrently appears is inevitable.
If the server does not control the number of the requests, the server is unlikely to bear the requests in a short period of time and is down, and great bad experience is generated on the use experience of the user.
Disclosure of Invention
The embodiment of the invention provides a processing method and device of timeout requests, computer equipment and a storage medium, and aims to solve the problem that a server cannot bear a large number of requests in a short period and is down in the prior art.
In a first aspect, an embodiment of the present invention provides a method for processing a timeout request, where the method includes:
if a request sent by a client is received, adding an identification value of the request into a feature array of a preset annular array, wherein the distance between the feature array and an array currently pointed by task pointers of the annular array is a preset number of arrays, and the task pointers of the annular array jump by one array at intervals of preset time;
and obtaining an identification value in the array currently pointed by the task pointer of the annular array as a target identification value, and disconnecting the http connection of the request corresponding to the target identification value.
A further technical solution is that, after the identification value of the request is added to a feature array of a preset ring array, the method further includes:
recording the identification value of the request and the position coordinates of the feature array in the annular array through a preset dictionary, wherein the identification value is used as a primary key of data of the dictionary, and the position coordinates are used as key values corresponding to the primary key.
A further technical solution is that, after the identification value in the array to which the task pointer of the annular array is currently directed is obtained as a target identification value and the http connection of the request corresponding to the target identification value is disconnected, the method further includes:
and clearing the identification value in the array currently pointed by the task pointer of the annular array.
The further technical scheme is that the acquiring of the identification value in the array currently pointed by the task pointer of the annular array as the target identification value includes:
and querying an identification value corresponding to the position coordinate of the array currently pointed by the task pointer of the annular array from the dictionary, and taking the queried identification value as the target identification value.
The further technical scheme is that the identification value of the request is a universal unique identification code of http connection of the request, the preset number is 30, and the preset time is 1 s.
In a second aspect, an embodiment of the present invention further provides a device for processing a timeout request, where the device includes:
the device comprises an adding unit, a judging unit and a judging unit, wherein the adding unit is used for adding an identification value of a request into a feature array of a preset annular array if the request sent by a client is received, the distance between the feature array and an array to which a task pointer of the annular array currently points is a preset number of arrays, and the task pointer of the annular array jumps by one array at preset time intervals;
and the disconnection unit is used for acquiring the identification value in the array currently pointed by the task pointer of the annular array as a target identification value and disconnecting the http connection of the request corresponding to the target identification value.
A further technical solution is that the processing apparatus for the timeout request further includes:
a recording unit, configured to record, through a preset dictionary, an identification value of the request and a position coordinate of the feature array in the annular array, where the identification value is used as a primary key of data of the dictionary, and the position coordinate is used as a key value corresponding to the primary key;
the disconnection unit includes:
and the query unit is used for querying the identification value corresponding to the position coordinate of the array currently pointed by the task pointer of the annular array from the dictionary, and taking the queried identification value as the target identification value.
A further technical solution is that the processing apparatus for the timeout request further includes:
and the clearing unit is used for clearing the identification value in the array currently pointed by the task pointer of the annular array.
The further technical scheme is that the identification value of the request is a universal unique identification code of http connection of the request, the preset number is 30, and the preset time is 1 s.
In a third aspect, an embodiment of the present invention further provides a computer device, which includes a memory and a processor, where the memory stores a computer program, and the processor implements the above method when executing the computer program.
In a fourth aspect, the present invention also provides a computer-readable storage medium, which stores a computer program, and the computer program can implement the above method when being executed by a processor.
By applying the technical scheme of the embodiment of the invention, if a request sent by a client is received, the identification value of the request is added into the feature array of the preset annular array, wherein the distance between the feature array and the array currently pointed by the task pointers of the annular array is the array with the preset number, and the task pointers of the annular array jump by one array at preset time intervals; and acquiring an identification value in the array currently pointed by the task pointer of the annular array as a target identification value, and disconnecting the http connection of the request corresponding to the target identification value, so that the server downtime caused by excessive requests can be avoided, and the pressure of the server can be effectively relieved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, 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 invention, 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 flowchart illustrating a timeout request processing method according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating a timeout request processing method according to another embodiment of the present invention;
fig. 3 is a schematic block diagram of a timeout request processing apparatus according to an embodiment of the present invention;
fig. 4 is a schematic block diagram of a timeout request processing apparatus according to another embodiment of the present invention
Fig. 5 is a schematic block diagram of a disconnection unit of a timeout request processing apparatus according to an embodiment of the present invention;
FIG. 6 is a schematic block diagram of a computer device provided by an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a ring array according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the specification of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to a determination" or "in response to a detection". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
Referring to fig. 1, fig. 1 is a flowchart illustrating a timeout request processing method according to an embodiment of the present invention. As shown, the method includes the following steps S1-S2.
S1, if a request sent by a client is received, adding the identification value of the request into a feature array of a preset annular array, wherein the distance between the feature array and the array to which the task pointer of the annular array currently points is a preset number of arrays, and the task pointer of the annular array jumps by one array at preset time intervals.
In specific implementation, if a request sent by a client is received, an identification value of the request is added to a feature array of a preset annular array. The characteristic array is not a fixed array, and the characteristic array is an array with a preset number of arrays at the distance from the array pointed by the task pointer of the annular array. For example, in one embodiment, the circular array is an array of 30 arrays from the array to which the task pointer is currently pointing. The identification value can uniquely identify the request, and the identification value is in one-to-one correspondence with the request.
In the embodiment of the invention, the task pointers of the annular array jump by one array at preset time intervals. The preset time can be set by a person skilled in the art according to actual conditions. For example, in one embodiment, the predetermined time is set to 1s (second). Thus, the task pointer jumps to the feature array after 30 s.
It should be noted that, referring to fig. 7, the circular array is formed by connecting a normal array via a head portion and a tail portion. The ring array includes task pointers that point to an array of the ring array, and the task pointers jump sequentially between the arrays.
In the embodiment of the present invention, the identification value of the request is a Universal Unique Identifier (UUID) of the http connection of the request.
Note that http is a simple request-response protocol that typically operates over TCP, and the TCP/IP transport protocol, i.e., the transmission control/network protocol, is also referred to as the network communication protocol. The client and the Web server communicate through an http protocol. Web servers are also sometimes called http servers or Web containers. The http protocol uses a request/response mode. Namely, the client side initiates an http request, the web server receives and analyzes the http request, and then sends an http response to the client side.
S2, obtaining the identification value in the array pointed by the task pointer of the annular array as the target identification value, and disconnecting the http connection of the request corresponding to the target identification value.
In specific implementation, the identification value in the array currently pointed by the task pointer of the annular array is obtained as a target identification value, and http connection of a request corresponding to the target identification value is disconnected.
The method comprises the steps that when a request is received, a request identification value is added into a feature array of a preset annular array, and the distance between the feature array and an array pointed by a task pointer of the annular array is a preset number of arrays; thus, when the task pointer jumps to the feature array, the time required to elapse is the product of the preset time and the preset number (1 × 30 ═ 30s in one embodiment). That is, the waiting time of the request corresponding to the identification value in the array currently pointed by the task pointer of the ring array is 30 s. In the embodiment of the invention, in order to avoid long-time waiting of the request and the crash of the server caused by excessive requests, the http connection of the request corresponding to the target identification value is disconnected, so that the pressure of the server can be effectively relieved.
By applying the technical scheme of the embodiment of the invention, if a request sent by a client is received, the identification value of the request is added into the feature array of the preset annular array, wherein the distance between the feature array and the array currently pointed by the task pointers of the annular array is the array with the preset number, and the task pointers of the annular array jump by one array at preset time intervals; and acquiring an identification value in the array currently pointed by the task pointer of the annular array as a target identification value, and disconnecting the http connection of the request corresponding to the target identification value, so that the server downtime caused by excessive requests can be avoided, and the pressure of the server can be effectively relieved.
Fig. 2 is a flowchart illustrating a timeout request processing method according to another embodiment of the present invention. As shown in fig. 2, the processing method of the timeout request of the present embodiment includes steps S21-S24. Steps S21-S22 are similar to steps S1-S2 in the above embodiments, and are not repeated herein. The steps S23-S24 added in the present embodiment are explained in detail below.
S21, if a request sent by a client is received, adding the identification value of the request into a feature array of a preset annular array, wherein the distance between the feature array and the array to which the task pointer of the annular array currently points is a preset number of arrays, and the task pointer of the annular array jumps by one array at preset time intervals.
S22, obtaining the identification value in the array pointed by the task pointer of the annular array as the target identification value, and disconnecting the http connection of the request corresponding to the target identification value.
And S23, recording the identification value of the request and the position coordinate of the feature array in the annular array through a preset dictionary, wherein the identification value is used as a primary key of the data of the dictionary, and the position coordinate is used as a key value corresponding to the primary key.
In specific implementation, the identification value of the request and the position coordinates of the feature array in the ring array are recorded through a preset dictionary (Map). The identification value is used as a key (key) of data of the dictionary, and the position coordinate is used as a key value (value) corresponding to the key. Storing the identification value of the request and the position coordinate of the feature array in the annular array in a dictionary as data of the dictionary, wherein the identification value is used as a main key (key) of the data of the dictionary, and the position coordinate is used as a key value (value) corresponding to the main key.
The position coordinates indicate the ordering of the feature array in the circular array. For example, in one embodiment, the ordering of the ring array is 14 (indicating that the feature array is the 14 th array of the ring array), then its position coordinate is 14.
In an embodiment, the obtaining, as the target identification value, the identification value in the array to which the task pointer of the ring array currently points includes: and querying an identification value corresponding to the position coordinate of the array currently pointed by the task pointer of the annular array from the dictionary, and taking the queried identification value as the target identification value. Querying through a dictionary may increase query speed.
And S24, clearing the identification value in the array currently pointed by the task pointer of the annular array.
In specific implementation, after the identification value in the array to which the task pointer of the annular array points currently is obtained as the target identification value and the http connection of the request corresponding to the target identification value is disconnected, the identification value in the array to which the task pointer of the annular array points currently is removed.
Fig. 3 is a schematic block diagram of a timeout request processing apparatus according to an embodiment of the present invention. As shown in fig. 3, the present invention also provides a timeout request processing apparatus corresponding to the above timeout request processing method. The processing apparatus of the timeout request includes a unit for executing the processing method of the timeout request, and the apparatus may be configured in a server. Specifically, referring to fig. 3, the processing apparatus of the timeout request includes an adding unit and a disconnecting unit.
The device comprises an adding unit, a judging unit and a judging unit, wherein the adding unit is used for adding an identification value of a request into a feature array of a preset annular array if the request sent by a client is received, the distance between the feature array and an array to which a task pointer of the annular array currently points is a preset number of arrays, and the task pointer of the annular array jumps by one array at preset time intervals;
and the disconnection unit is used for acquiring the identification value in the array currently pointed by the task pointer of the annular array as a target identification value and disconnecting the http connection of the request corresponding to the target identification value.
In an embodiment, the identification value of the request is a universal unique identifier of http connection of the request, the preset number is 30, and the preset time is 1 s.
Fig. 4 is a schematic block diagram of a timeout request processing apparatus according to another embodiment of the present invention. As shown in fig. 4, the processing apparatus of the timeout request of the present embodiment is added with a recording unit and a clearing unit on the basis of the above embodiment.
And the recording unit is used for recording the identification value of the request and the position coordinate of the feature array in the annular array through a preset dictionary, wherein the identification value is used as a primary key of data of the dictionary, and the position coordinate is used as a key value corresponding to the primary key.
And the clearing unit is used for clearing the identification value in the array currently pointed by the task pointer of the annular array.
In one embodiment, as shown in FIG. 5, the disconnect unit comprises a query unit.
And the query unit is used for querying the identification value corresponding to the position coordinate of the array currently pointed by the task pointer of the annular array from the dictionary, and taking the queried identification value as the target identification value.
It should be noted that, as can be clearly understood by those skilled in the art, the specific implementation process of the processing apparatus and each unit of the timeout request may refer to the corresponding description in the foregoing method embodiment, and for convenience and brevity of description, no further description is provided herein.
The processing means of the above-mentioned time-out request may be implemented in the form of a computer program which may be run on a computer device as shown in fig. 6.
Referring to fig. 6, fig. 6 is a schematic block diagram of a computer device according to an embodiment of the present application. The computer device 500 may be a terminal or a server, where the terminal may be an electronic device with a communication function, such as a smart phone, a tablet computer, a notebook computer, a desktop computer, a personal digital assistant, and a wearable device. The server may be an independent server or a server cluster composed of a plurality of servers.
Referring to fig. 6, the computer device 500 includes a processor 502, memory, and a network interface 505 connected by a system bus 501, where the memory may include a non-volatile storage medium 503 and an internal memory 504.
The non-volatile storage medium 503 may store an operating system 5031 and a computer program 5032. The computer program 5032, when executed, causes the processor 502 to perform a method of processing a timeout request.
The processor 502 is used to provide computing and control capabilities to support the operation of the overall computer device 500.
The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503, and when the computer program 5032 is executed by the processor 502, the processor 502 can execute a timeout request processing method.
The network interface 505 is used for network communication with other devices. Those skilled in the art will appreciate that the configuration shown in fig. 6 is a block diagram of only a portion of the configuration associated with the present application and does not constitute a limitation of the computer device 500 to which the present application may be applied, and that a particular computer device 500 may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
Wherein the processor 502 is configured to run the computer program 5032 stored in the memory to implement the following steps:
if a request sent by a client is received, adding an identification value of the request into a feature array of a preset annular array, wherein the distance between the feature array and an array currently pointed by task pointers of the annular array is a preset number of arrays, and the task pointers of the annular array jump by one array at intervals of preset time;
and obtaining an identification value in the array currently pointed by the task pointer of the annular array as a target identification value, and disconnecting the http connection of the request corresponding to the target identification value.
In an embodiment, after the step of adding the identification value of the request to the feature array of the preset ring array, the processor 502 further implements the following steps:
recording the identification value of the request and the position coordinates of the feature array in the annular array through a preset dictionary, wherein the identification value is used as a primary key of data of the dictionary, and the position coordinates are used as key values corresponding to the primary key.
In an embodiment, after implementing the http connection step of acquiring the identifier value in the array currently pointed by the task pointer of the annular array as the target identifier value and disconnecting the request corresponding to the target identifier value, the processor 502 further implements the following steps:
and clearing the identification value in the array currently pointed by the task pointer of the annular array.
In an embodiment, when implementing the step of acquiring the identifier value in the array currently pointed by the task pointer of the ring array as the target identifier value, the processor 502 specifically implements the following steps:
and querying an identification value corresponding to the position coordinate of the array currently pointed by the task pointer of the annular array from the dictionary, and taking the queried identification value as the target identification value.
In an embodiment, the identification value of the request is a universal unique identifier of http connection of the request, the preset number is 30, and the preset time is 1 s.
It should be understood that, in the embodiment of the present Application, the Processor 502 may be a Central Processing Unit (CPU), and the Processor 502 may also 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, and the like. Wherein a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
It will be understood by those skilled in the art that all or part of the flow of the method implementing the above embodiments may be implemented by a computer program instructing associated hardware. The computer program may be stored in a storage medium, which is a computer-readable storage medium. The computer program is executed by at least one processor in the computer system to implement the flow steps of the embodiments of the method described above.
Accordingly, the present invention also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program. The computer program, when executed by a processor, causes the processor to perform the steps of:
if a request sent by a client is received, adding an identification value of the request into a feature array of a preset annular array, wherein the distance between the feature array and an array currently pointed by task pointers of the annular array is a preset number of arrays, and the task pointers of the annular array jump by one array at intervals of preset time;
and obtaining an identification value in the array currently pointed by the task pointer of the annular array as a target identification value, and disconnecting the http connection of the request corresponding to the target identification value.
In one embodiment, after executing the computer program to implement the step of adding the identification value of the request to the feature array of the preset ring array, the processor further implements the steps of:
recording the identification value of the request and the position coordinates of the feature array in the annular array through a preset dictionary, wherein the identification value is used as a primary key of data of the dictionary, and the position coordinates are used as key values corresponding to the primary key.
In an embodiment, after the processor executes the computer program to implement the step of obtaining an identifier value in an array currently pointed by a task pointer of the ring array as a target identifier value and disconnecting a http connection of a request corresponding to the target identifier value, the following steps are further implemented:
and clearing the identification value in the array currently pointed by the task pointer of the annular array.
In an embodiment, when the processor executes the computer program to implement the step of obtaining the identifier value in the array currently pointed by the task pointer of the ring array as the target identifier value, the following steps are specifically implemented:
and querying an identification value corresponding to the position coordinate of the array currently pointed by the task pointer of the annular array from the dictionary, and taking the queried identification value as the target identification value.
In an embodiment, the identification value of the request is a universal unique identifier of http connection of the request, the preset number is 30, and the preset time is 1 s.
The storage medium may be a usb disk, a removable hard disk, a Read-Only Memory (ROM), a magnetic disk, or an optical disk, which can store various computer readable storage media.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative. For example, the division of each unit is only one logic function division, and there may be another division manner in actual implementation. For example, various elements or components may be combined or may be integrated into another system, or some features may be omitted, or not implemented.
The steps in the method of the embodiment of the invention can be sequentially adjusted, combined and deleted according to actual needs. The units in the device of the embodiment of the invention can be merged, divided and deleted according to actual needs. In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a storage medium. Based on such understanding, the technical solution of the present invention essentially or partially contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a terminal, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, while the invention has been described with respect to the above-described embodiments, it will be understood that the invention is not limited thereto but may be embodied with various modifications and changes.
While the invention has been described with reference to specific embodiments, the invention is not limited thereto, and various equivalent modifications and substitutions can be easily made by those skilled in the art within the technical scope of the invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims (10)
1. A method for processing a timeout request, comprising:
if a request sent by a client is received, adding an identification value of the request into a feature array of a preset annular array, wherein the distance between the feature array and an array currently pointed by task pointers of the annular array is a preset number of arrays, and the task pointers of the annular array jump by one array at intervals of preset time;
and obtaining an identification value in the array currently pointed by the task pointer of the annular array as a target identification value, and disconnecting the http connection of the request corresponding to the target identification value.
2. The method for processing the timeout request according to claim 1, wherein after the adding the identification value of the request to the feature array of the preset ring array, the method further comprises:
recording the identification value of the request and the position coordinates of the feature array in the annular array through a preset dictionary, wherein the identification value is used as a primary key of data of the dictionary, and the position coordinates are used as key values corresponding to the primary key.
3. The method according to claim 1, wherein after obtaining an identifier value in an array to which a task pointer of the ring array currently points as a target identifier value and disconnecting a http connection of a request corresponding to the target identifier value, the method further comprises:
and clearing the identification value in the array currently pointed by the task pointer of the annular array.
4. The method for processing the timeout request according to claim 2, wherein the obtaining, as the target identification value, the identification value in the array to which the task pointer of the ring array currently points includes:
and querying an identification value corresponding to the position coordinate of the array currently pointed by the task pointer of the annular array from the dictionary, and taking the queried identification value as the target identification value.
5. The method according to claim 1, wherein the identification value of the request is a universal unique identifier of an http connection of the request, the preset number is 30, and the preset time is 1 s.
6. An apparatus for processing a timeout request, comprising:
the device comprises an adding unit, a judging unit and a judging unit, wherein the adding unit is used for adding an identification value of a request into a feature array of a preset annular array if the request sent by a client is received, the distance between the feature array and an array to which a task pointer of the annular array currently points is a preset number of arrays, and the task pointer of the annular array jumps by one array at preset time intervals;
and the disconnection unit is used for acquiring the identification value in the array currently pointed by the task pointer of the annular array as a target identification value and disconnecting the http connection of the request corresponding to the target identification value.
7. The apparatus for processing the timeout request according to claim 6, wherein the apparatus for processing the timeout request further comprises:
a recording unit, configured to record, through a preset dictionary, an identification value of the request and a position coordinate of the feature array in the annular array, where the identification value is used as a primary key of data of the dictionary, and the position coordinate is used as a key value corresponding to the primary key;
the disconnection unit includes:
and the query unit is used for querying the identification value corresponding to the position coordinate of the array currently pointed by the task pointer of the annular array from the dictionary, and taking the queried identification value as the target identification value.
8. The apparatus for processing the timeout request according to claim 6, wherein the apparatus for processing the timeout request further comprises:
and the clearing unit is used for clearing the identification value in the array currently pointed by the task pointer of the annular array.
9. A computer arrangement, characterized in that the computer arrangement comprises a memory having stored thereon a computer program and a processor implementing the method according to any of claims 1-5 when executing the computer program.
10. A computer-readable storage medium, characterized in that the storage medium stores a computer program which, when being executed by a processor, is adapted to carry out the method according to any one of claims 1-5.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010026073.3A CN111245935B (en) | 2020-01-10 | 2020-01-10 | Timeout request processing method and device, computer equipment and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010026073.3A CN111245935B (en) | 2020-01-10 | 2020-01-10 | Timeout request processing method and device, computer equipment and storage medium |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN111245935A true CN111245935A (en) | 2020-06-05 |
| CN111245935B CN111245935B (en) | 2022-10-21 |
Family
ID=70876118
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202010026073.3A Active CN111245935B (en) | 2020-01-10 | 2020-01-10 | Timeout request processing method and device, computer equipment and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN111245935B (en) |
Citations (10)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US7633944B1 (en) * | 2006-05-12 | 2009-12-15 | Juniper Networks, Inc. | Managing timeouts for dynamic flow capture and monitoring of packet flows |
| US20110145835A1 (en) * | 2009-12-14 | 2011-06-16 | Verisign, Inc. | Lockless Queues |
| CN105808329A (en) * | 2016-02-25 | 2016-07-27 | 北京京东尚科信息技术有限公司 | Distributed overtime task scheduling method and device |
| US20170063733A1 (en) * | 2015-08-24 | 2017-03-02 | Cisco Technology, Inc. | Systems and methods for performing packet reorder processing |
| CN109104326A (en) * | 2018-06-05 | 2018-12-28 | 阿里巴巴集团控股有限公司 | Timeout treatment method and device and electronic equipment |
| CN109213102A (en) * | 2018-09-11 | 2019-01-15 | 深圳众城卓越科技有限公司 | More order monitoring methods, device, computer equipment and storage medium |
| CN109284189A (en) * | 2018-09-06 | 2019-01-29 | 福建星瑞格软件有限公司 | A kind of batch tasks overtime efficiently triggering method and system |
| CN109308217A (en) * | 2018-07-17 | 2019-02-05 | 威富通科技有限公司 | A kind of date storage method and device of timeliness task |
| CN109684056A (en) * | 2018-12-07 | 2019-04-26 | 咪咕文化科技有限公司 | Timer implementation method and device, scheduler and storage medium |
| CN109697592A (en) * | 2018-12-21 | 2019-04-30 | 江苏满运软件科技有限公司 | Source of goods undercarriage method, system, equipment and storage medium based on annular array |
-
2020
- 2020-01-10 CN CN202010026073.3A patent/CN111245935B/en active Active
Patent Citations (10)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US7633944B1 (en) * | 2006-05-12 | 2009-12-15 | Juniper Networks, Inc. | Managing timeouts for dynamic flow capture and monitoring of packet flows |
| US20110145835A1 (en) * | 2009-12-14 | 2011-06-16 | Verisign, Inc. | Lockless Queues |
| US20170063733A1 (en) * | 2015-08-24 | 2017-03-02 | Cisco Technology, Inc. | Systems and methods for performing packet reorder processing |
| CN105808329A (en) * | 2016-02-25 | 2016-07-27 | 北京京东尚科信息技术有限公司 | Distributed overtime task scheduling method and device |
| CN109104326A (en) * | 2018-06-05 | 2018-12-28 | 阿里巴巴集团控股有限公司 | Timeout treatment method and device and electronic equipment |
| CN109308217A (en) * | 2018-07-17 | 2019-02-05 | 威富通科技有限公司 | A kind of date storage method and device of timeliness task |
| CN109284189A (en) * | 2018-09-06 | 2019-01-29 | 福建星瑞格软件有限公司 | A kind of batch tasks overtime efficiently triggering method and system |
| CN109213102A (en) * | 2018-09-11 | 2019-01-15 | 深圳众城卓越科技有限公司 | More order monitoring methods, device, computer equipment and storage medium |
| CN109684056A (en) * | 2018-12-07 | 2019-04-26 | 咪咕文化科技有限公司 | Timer implementation method and device, scheduler and storage medium |
| CN109697592A (en) * | 2018-12-21 | 2019-04-30 | 江苏满运软件科技有限公司 | Source of goods undercarriage method, system, equipment and storage medium based on annular array |
Non-Patent Citations (1)
| Title |
|---|
| 周刚等: "一种新的基于连续哈希函数的合作式Web缓存系统", 《计算机应用》 * |
Also Published As
| Publication number | Publication date |
|---|---|
| CN111245935B (en) | 2022-10-21 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN111026774A (en) | Data sequence synchronization method and device, computer equipment and storage medium | |
| CN107798108A (en) | A kind of asynchronous task querying method and equipment | |
| US10489311B1 (en) | Managing webUSB support for local and redirected USB devices | |
| JP6649214B2 (en) | Log transmission device, log collection system | |
| CN112860342A (en) | Method, device, equipment, system and storage medium for microservice configuration | |
| CN110990339B (en) | File read-write method, device and platform for distributed storage and readable storage medium | |
| CN110881224B (en) | Network long connection method, device, equipment and storage medium | |
| CN112272118A (en) | Network repairing method, device, storage medium and electronic equipment | |
| CN109656592B (en) | Card management method, device, terminal and computer-readable storage medium | |
| CN112636987B (en) | Cross-chain gateway determination method and system for block chain and terminal equipment | |
| CN116361309B (en) | Data query system and method for updating cache data | |
| CN110311963B (en) | Message pushing method and device, computer equipment and computer readable storage medium | |
| CN111771191B (en) | Cross-domain inline event handlers | |
| CN111245935B (en) | Timeout request processing method and device, computer equipment and storage medium | |
| CN111615150A (en) | 5G data transmission method, device, equipment and storage medium based on PCIe interface | |
| US9003093B2 (en) | Connector apparatus and associated method for bridging data between data sources and data targets | |
| CN104679407A (en) | Interface response method and device | |
| CN113448999A (en) | Data acquisition method, device, equipment and readable storage medium | |
| CN112948551A (en) | Log obtaining method and device, computer equipment and storage medium | |
| US9063853B2 (en) | Storage device, storage system, and method for controlling storage device | |
| US11838207B2 (en) | Systems for session-based routing | |
| CN113535020B (en) | Methods, devices, equipment, media and products for generating application icons | |
| CN114627573A (en) | Remote diagnosis method and device, electronic equipment and storage medium | |
| CN111314321A (en) | Parameter encryption management method and device, computer equipment and storage medium | |
| CN105007339A (en) | Resource downloading method, device and intelligent terminal |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |