CN106341345B - Concurrent request processing method and device - Google Patents

Concurrent request processing method and device Download PDF

Info

Publication number
CN106341345B
CN106341345B CN201610687176.8A CN201610687176A CN106341345B CN 106341345 B CN106341345 B CN 106341345B CN 201610687176 A CN201610687176 A CN 201610687176A CN 106341345 B CN106341345 B CN 106341345B
Authority
CN
China
Prior art keywords
data
request
setting
concurrent requests
current
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610687176.8A
Other languages
Chinese (zh)
Other versions
CN106341345A (en
Inventor
曾志海
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Qihoo Technology Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Qihoo Technology Co Ltd, Qizhi Software Beijing Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201610687176.8A priority Critical patent/CN106341345B/en
Publication of CN106341345A publication Critical patent/CN106341345A/en
Application granted granted Critical
Publication of CN106341345B publication Critical patent/CN106341345B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/50Queue scheduling
    • H04L47/62Queue scheduling characterised by scheduling criteria
    • H04L47/622Queue service order
    • H04L47/6235Variable service order

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a method and a device for processing concurrent requests, wherein the method comprises the following steps: after receiving a plurality of concurrent requests, converting the concurrent requests into serial access; before a current request in a plurality of concurrent requests converted into serial access acquires request data, judging whether the request data is provided with a data identifier; and if the data identification is not set in the request data, setting the data identification for the request data according to the current request, and acquiring the request data. By adopting the processing method of the concurrent requests, provided by the invention, only one request in a plurality of concurrent requests can acquire the request data, so that less resources are occupied, the processing speed of the concurrent requests is improved, and the problem of matching errors when the concurrent requests are matched one by one is also avoided.

Description

Concurrent request processing method and device
Technical Field
The present invention relates to the field of internet technologies, and in particular, to a method and an apparatus for processing concurrent requests.
Background
In the internet era, network requests are very common, and a page may be accessed by tens of users at the same time, or by hundreds of users or even more at the same time. If there is a need to allow one of the users to obtain data only in the users concurrently requesting, for example, when a large number of concurrent requests query a specific data in a database, an avalanche effect is easily caused due to an excessively large number of concurrent requests, and therefore, only one of the large number of concurrent requests is allowed to obtain the specific data.
In the prior art, unique indexes are usually used for achieving the unique acquisition of data corresponding to concurrent requests, and specifically, information carried by each concurrent request and related to the unique indexes is matched with the set unique indexes, so that each concurrent request needs to perform an operation step of one-to-one matching when acquiring data, more resources are occupied, the speed of processing the concurrent requests is slow, meanwhile, an error condition may occur in a matching process, and a problem that one of a large number of concurrent requests cannot be acquired to the data may be caused.
Disclosure of Invention
In view of the above, the present invention has been made to provide a concurrent request processing method and apparatus that overcomes or at least partially solves the above problems.
According to an aspect of the present invention, a method for processing a concurrent request is provided, including:
after receiving a plurality of concurrent requests, converting the concurrent requests into serial access;
before a current request in a plurality of concurrent requests converted into serial access acquires request data, judging whether the request data is provided with a data identifier; and
and if the data identification is not set in the request data, setting the data identification for the request data according to the current request, and acquiring the request data.
Optionally, the step of setting the data identifier for the request data according to the current request and acquiring the request data specifically includes:
further judging whether the current request has the capacity of setting the data identification; and
and if the current request has the capability of setting the data identifier, setting the data identifier for the request data according to the current request, and acquiring the request data.
Optionally, after determining whether the request data is provided with a data identifier, the method further includes:
and if the request data is provided with the data identification, refusing the acquisition of the request data by the current request.
Optionally, after determining whether the current request has the capability of setting the data identifier, the method further includes:
and if the current request does not have the capability of setting the data identifier, refusing the current request to acquire the request data.
Optionally, the method is applicable to a redis database.
Optionally, the step of setting the data identifier for the requested data according to the current request specifically includes:
and setting the data identification for the request data by utilizing a self-increment function.
Optionally, the step of setting the data identifier for the request data by using a self-increment function specifically includes:
and setting the data identifier for the request data by utilizing an incr function in a redis database.
Optionally, the step of setting the data identifier for the requested data according to the current request specifically includes:
and setting the data identifier for the request data by utilizing a setnx function in a redis database.
Based on another aspect of the present invention, there is also provided a concurrent request processing apparatus, including:
the conversion module is suitable for converting a plurality of concurrent requests into serial access after receiving the concurrent requests;
the device comprises a judging module, a judging module and a judging module, wherein the judging module is suitable for judging whether the request data is provided with a data identifier or not before the current request in a plurality of concurrent requests converted into serial access acquires the request data;
and the acquisition module is suitable for setting the data identifier for the request data according to the current request and acquiring the request data if the data identifier is not set in the request data.
Optionally, the obtaining module is further adapted to:
further judging whether the current request has the capacity of setting the data identification; and
and if the current request has the capability of setting the data identifier, setting the data identifier for the request data according to the current request, and acquiring the request data.
Optionally, the obtaining module is further adapted to:
and if the request data is provided with the data identification, refusing the acquisition of the request data by the current request.
Optionally, the obtaining module is further adapted to:
and if the current request does not have the capability of setting the data identifier, refusing the current request to acquire the request data.
Optionally, the apparatus is adapted for use with a redis database.
Optionally, the obtaining module is further adapted to:
and setting the data identification for the request data by utilizing a self-increment function.
Optionally, the obtaining module is further adapted to:
and setting the data identifier for the request data by utilizing an incr function in a redis database.
Optionally, the obtaining module is further adapted to:
and setting the data identifier for the request data by utilizing a setnx function in a redis database.
In the embodiment of the invention, the received multiple concurrent requests are converted into serial access, and the converted multiple concurrent requests are arranged in a queue form, so that the multiple concurrent requests are sequenced according to the queue to obtain the request data corresponding to the multiple concurrent requests. Before a current request in a plurality of concurrent requests acquires request data, whether the request data is provided with a data identifier is judged, if the request data is not provided with the data identifier, the request data can be acquired after the current request sets the data identifier on the request data, and the fact that only one request in the plurality of concurrent requests can acquire the request data is achieved. In addition, compared with the prior art that each request needs to be matched one by one before the multiple concurrent requests acquire data, the multiple concurrent requests do not need to be matched one by one in the embodiment of the invention, only the request data needs to be judged and the data identifier needs to be set, less resources are occupied, the processing speed of the concurrent requests is improved, and meanwhile, the problem that matching errors are easy to occur when the concurrent requests are matched one by one is avoided as the matching operation does not need to be performed one by one.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
The above and other objects, advantages and features of the present invention will become more apparent to those skilled in the art from the following detailed description of specific embodiments thereof, taken in conjunction with the accompanying drawings.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
FIG. 1 shows a process flow diagram of a method of processing concurrent requests according to one embodiment of the invention;
FIG. 2 illustrates another process flow diagram of a method of processing concurrent requests according to one embodiment of the invention;
FIG. 3 illustrates another process flow diagram of a method of processing concurrent requests according to one embodiment of the invention;
FIG. 4 shows another process flow diagram of a method of processing concurrent requests according to one embodiment of the invention;
fig. 5 is a schematic structural diagram of a device for processing concurrent requests according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
In order to solve the above technical problem, an embodiment of the present invention provides a method for processing concurrent requests. Fig. 1 shows a process schematic flow diagram of a method of processing concurrent requests according to one embodiment of the invention. Referring to fig. 1, the method includes at least steps S102 to S108.
In the embodiment of the present invention, step S102 is executed first, and after receiving a plurality of concurrent requests, the plurality of concurrent requests are converted into serial access;
then, step S104 is executed, and before the current request in the multiple concurrent requests converted into the serial access acquires the request data, it is determined whether the request data is provided with a data identifier;
and finally, executing step S106, if the request data is not provided with the data identifier, setting the data identifier for the request data according to the current request, and acquiring the request data.
In the embodiment of the invention, the received multiple concurrent requests are converted into serial access, and the converted multiple concurrent requests are arranged in a queue form, so that the multiple concurrent requests are sequenced according to the queue to obtain the request data corresponding to the multiple concurrent requests. Before a current request in a plurality of concurrent requests acquires request data, whether the request data is provided with a data identifier is judged, if the request data is not provided with the data identifier, the request data can be acquired after the current request sets the data identifier on the request data, and the fact that only one request in the plurality of concurrent requests can acquire the request data is achieved. In addition, compared with the prior art that each request needs to be matched one by one before the multiple concurrent requests acquire data, the multiple concurrent requests do not need to be matched one by one in the embodiment of the invention, only the request data needs to be judged and the data identifier needs to be set, less resources are occupied, the processing speed of the concurrent requests is improved, and meanwhile, the problem that matching errors are easy to occur when the concurrent requests are matched one by one is avoided as the matching operation does not need to be performed one by one.
In step S104, if it is determined that the request data has the data identifier, the current request cannot acquire the request data. The above-mentioned multiple concurrent requests convert the multiple concurrent requests into serial access before acquiring the request data, the multiple converted concurrent requests are arranged in a queue form, after a data identifier is set for the request data by any request arranged before the current request, and before the current request acquires the request data, the current request determines that the request data has the data identifier, and then the current request cannot acquire the request data.
In step S106, before the current request obtains the request data, the current request needs to be further determined, that is, it is determined whether the current request has the capability of setting the data identifier, if the current request has the capability of setting the data identifier, the data identifier is set according to the current request data, and the request data is obtained, and if the current request does not have the capability of setting the data identifier, the current request cannot obtain the request data. Any request arranged before the current request cannot acquire the request data because the data identifier is not arranged on the request data, and any request arranged after the current request cannot acquire the request data because the data identifier is already arranged on the request data by the current request, so that only one request in a plurality of concurrent requests can acquire the request data. In the embodiment of the present invention, the determination of whether the current request has the capability of setting the data identifier may be determined according to related information (e.g., an originating address of the current request and connection establishment time of the current request) carried by the current request itself.
In the embodiment of the invention, when the current request judges that the request data is not provided with the data identifier and has the capability of setting the data identifier, the current request can use the self-increment function to set the data identifier for the request data.
In a preferred embodiment of the present invention, the processing method of the concurrent request provided by the present invention is applicable to a redis database, wherein the redis database is only an embodiment of the present invention, and the processing method of the concurrent request provided by the present invention is also applicable to a database such as SQL Server, MySQL, and the like, and the present invention is not limited thereto.
When the data identifier is set for the request data, the current request can utilize an incr function in a redis database to set the data identifier for the request data. Specifically, the current request calls an incr function in the redis database before acquiring the request data, and since any request arranged before the current request does not set a data identifier for the request data, the incr function is still maintained at an initial value, at this time, the current request only needs to self-increment the value of the incr function from the initial value, for example, the initial value of the incr function is 0, and the value of the incr function is changed from 0 to 1, or the initial value of the incr function is 1, and the value of the incr function is changed from 1 to 2. After the initial value of the incr function is self-increased by the current request, when any request arranged after the current request acquires the request data, whether the initial value of the incr function in the redis database is self-increased is only required to be determined, if the initial value of the incr function is determined to be self-increased, the request data is provided with the data identifier, and any request arranged after the current request cannot acquire the request data.
In the embodiment of the invention, in addition to the setting of the data identifier for the request data by using the incr function in the redis database, the data identifier for the request data can also be set by using the setnx function in the redis database. Specifically, the current request calls a setnx function in a redis database before acquiring the request data, and since any request arranged before the current request does not set a data identifier for the request data, and a key does not exist, the setnx function sets the value of the key to value. After the setnx function is set, when any request arranged after the current request is used for acquiring the request data, if the key is determined to exist, the request data is provided with the data identifier, and any request arranged after the current request cannot acquire the request data.
Example one
In the embodiment of the present invention, 100 concurrent requests are taken as an example, and a method for processing the concurrent requests provided by the present invention is specifically described. Fig. 2 is a schematic processing flow diagram of a processing method of a concurrent request according to an embodiment of the present invention. Referring to fig. 2, the method includes at least steps S202 to S210.
First, step S202 is executed, and after 100 concurrent requests are received, the 100 concurrent requests are converted into serial access. The converted 100 concurrent requests are arranged in a queue form, so that the 100 concurrent requests are sequenced according to the sequence of the queue to acquire request data.
The first 25 requests of the 100 concurrent requests do not acquire the requested data, and at this time, before the 26 th request to acquire the data, step S204 is executed to determine whether the requested data is provided with the data identifier.
If the determination result in step S204 is that the requested data has no data identifier, step S206 is executed to determine whether the 26 th request has the capability of setting the data identifier. If the determination result in step S206 is that the 26 th request has the capability of setting the data identifier, step S208 is executed to set the data identifier for the request data by using the incr function in the redis database. Specifically, since the first 25 requests do not set the data identifier to the request data, the incr function remains at the initial value, and at this time, the 26 th request only needs to increment the value of the incr function from the initial value.
Finally, step S210 is executed, and the 26 th request obtains the requested data. Since the 26 th request has been provided with the data identification for the request data, at this time, any request that is ranked after the 26 th request cannot acquire the request data.
It should be noted that, in step S208, the data identifier may also be set to the request data by using a setnx function in the redis database. Specifically, before the 26 th request obtains the request data, a setnx function in the redis database is called, and since any request arranged before the 26 th request does not set a data identifier for the request data, and a key does not exist, the setnx function sets the value of the key to value, that is, the setting of the data identifier for the request data can be realized.
Example two
Fig. 3 is a schematic processing flow diagram of a processing method of a concurrent request according to an embodiment of the present invention. Referring to fig. 3, the method includes at least steps S302 to S306.
First, step S302 is executed, and after 100 concurrent requests are received, the 100 concurrent requests are converted into serial access. The converted 100 concurrent requests are arranged in a queue form, so that the 100 concurrent requests are sequenced according to the sequence of the queue to acquire request data.
The 25 th request of the 100 concurrent requests has set the data identifier to the request data and has acquired the request data, at this time, before the 26 th request acquires the data, step S304 is performed to determine whether the request data is set with the data identifier.
If the determination result in step S304 is that the requested data has the data identifier, step S306 is executed to reject the 26 th request to obtain the requested data.
EXAMPLE III
Fig. 4 is a schematic processing flow diagram of a processing method of a concurrent request according to an embodiment of the present invention. Referring to fig. 4, the method includes at least steps S402 to S408.
First, step S402 is executed to receive 100 concurrent requests and then convert the 100 concurrent requests into serial access. The converted 100 concurrent requests are arranged in a queue form, so that the 100 concurrent requests are sequenced according to the sequence of the queue to acquire request data.
The first 25 requests of the 100 concurrent requests do not acquire the requested data, and at this time, before the 26 th request to acquire the data, step S404 is executed to determine whether the requested data is provided with the data identifier.
If the determination result in step S404 is that the requested data has no data identifier, step S406 is executed to determine whether the 26 th request has the capability of setting the data identifier. If the determination result in step S406 is that the 26 th request does not have the capability of setting the data identifier, step S408 is executed to reject the 26 th request to obtain the requested data.
It should be noted that the number of the concurrent requests listed in the first embodiment, the second embodiment and the third embodiment is only an example, and the present invention is not limited at all, and the number of the concurrent requests may be 200, 500 or 1000.
Based on the same inventive concept, the embodiment of the invention also provides a device for realizing the regulation of the system logs. Fig. 5 is a schematic structural diagram of a device for processing concurrent requests according to an embodiment of the present invention. Referring to fig. 5, the apparatus includes at least:
a conversion module 510, adapted to receive the plurality of concurrent requests and convert the plurality of concurrent requests into serial access;
a determining module 520, coupled to the converting module 510, adapted to determine whether the request data has a data identifier before converting to a current request of the multiple concurrent requests for serial access to obtain the request data;
an obtaining module 530, coupled to the determining module 520, is adapted to set a data identifier for the requested data according to the current request and obtain the requested data if the requested data is not set with the data identifier.
In a preferred embodiment of the present invention, the obtaining module 530 is further adapted to: further judging whether the current request has the capacity of setting the data identifier; and if the current request has the capability of setting the data identifier, setting the data identifier for the request data according to the current request, and acquiring the request data.
In a preferred embodiment of the present invention, the obtaining module 530 is further adapted to: and if the request data is provided with the data identification, rejecting the current request to acquire the request data.
In a preferred embodiment of the present invention, the obtaining module 530 is further adapted to: and if the current request does not have the capability of setting the data identifier, rejecting the current request to acquire the requested data.
In a preferred embodiment of the invention, the processing means of concurrent requests are adapted to a redis database.
In a preferred embodiment of the present invention, the obtaining module 530 is further adapted to: and setting data identification for the request data by utilizing a self-increment function.
In a preferred embodiment of the present invention, the obtaining module 530 is further adapted to: and setting a data identifier for the request data by using an incr function in a redis database.
In a preferred embodiment of the present invention, the obtaining module 530 is further adapted to: and setting data identification for the request data by utilizing a setnx function in a redis database.
In summary, the processing method and the processing device for concurrent requests provided by the embodiments of the present invention can achieve the following beneficial effects:
in the embodiment of the invention, the received multiple concurrent requests are converted into serial access, and the converted multiple concurrent requests are arranged in a queue form, so that the multiple concurrent requests are sequenced according to the queue to obtain the request data corresponding to the multiple concurrent requests. Before a current request in a plurality of concurrent requests acquires request data, whether the request data is provided with a data identifier is judged firstly, if the request data is not provided with the data identifier, the request data can be acquired after the current request sets the data identifier on the request data, any request before the current request is ranked, the request data cannot be acquired because the data identifier is not arranged on the request data, and the request data cannot be acquired when any request after the current request is ranked, so that the request data can be acquired by only one request in the plurality of concurrent requests. In addition, compared with the prior art that each request needs to be matched one by one before the multiple concurrent requests acquire data, the multiple concurrent requests in the embodiment of the invention do not need to be matched one by one, only the request data needs to be judged and the data identifier needs to be set, less resources are occupied, the processing speed of the concurrent requests is improved, and meanwhile, the problem of matching errors when the concurrent requests are matched one by one is avoided.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the claims, any of the claimed embodiments may be used in any combination.
The various component embodiments of the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement some or all of the functionality of some or all of the components in a concurrent request processing apparatus according to an embodiment of the present invention. The present invention may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present invention may be stored on computer-readable media or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
Thus, it should be appreciated by those skilled in the art that while a number of exemplary embodiments of the invention have been illustrated and described in detail herein, many other variations or modifications consistent with the principles of the invention may be directly determined or derived from the disclosure of the present invention without departing from the spirit and scope of the invention. Accordingly, the scope of the invention should be understood and interpreted to cover all such other variations or modifications.

Claims (14)

1. A concurrent request processing method comprises the following steps:
after receiving a plurality of concurrent requests, converting the concurrent requests into serial access;
before a current request in a plurality of concurrent requests converted into serial access acquires request data, judging whether the request data is provided with a data identifier; and
if the request data is not provided with the data identifier, setting the data identifier for the request data according to the current request, and acquiring the request data;
if the request data is provided with the data identification, the current request in the plurality of concurrent requests cannot acquire the request data; wherein the data identification is set for the request data by any request arranged before the current request in a plurality of concurrent requests;
the step of setting the data identifier for the request data according to the current request and acquiring the request data specifically includes: further judging whether the current request has the capability of setting the data identifier or not according to an initiating address carried by the current request and the connection establishing time of the current request; and if so, setting the data identifier for the request data according to the current request, and acquiring the request data.
2. The method of claim 1, wherein after determining whether the requested data is provided with a data identification, the method further comprises:
and if the request data is provided with the data identification, refusing the acquisition of the request data by the current request.
3. The method of claim 1, wherein after determining whether the current request has the capability to set the data identification, the method further comprises:
and if the current request does not have the capability of setting the data identifier, refusing the current request to acquire the request data.
4. A method according to any of claims 1-3, wherein the method is adapted for use in a redis database.
5. The method according to claim 4, wherein the step of setting the data identifier for the requested data according to the current request specifically includes:
and setting the data identification for the request data by utilizing a self-increment function.
6. The method according to claim 5, wherein the step of setting the data identifier for the requested data by using a self-increment function specifically comprises:
and setting the data identifier for the request data by utilizing an incr function in a redis database.
7. The method according to claim 4, wherein the step of setting the data identifier for the requested data according to the current request specifically includes:
and setting the data identifier for the request data by utilizing a setnx function in a redis database.
8. A concurrent request processing apparatus, comprising:
the conversion module is suitable for converting a plurality of concurrent requests into serial access after receiving the concurrent requests;
the device comprises a judging module, a judging module and a judging module, wherein the judging module is suitable for judging whether the request data is provided with a data identifier or not before the current request in a plurality of concurrent requests converted into serial access acquires the request data;
the acquisition module is suitable for setting the data identifier for the request data according to the current request and acquiring the request data if the data identifier is not set in the request data;
further comprising: if the request data is provided with the data identification, the current request in the plurality of concurrent requests cannot acquire the request data; wherein the data identification is set for the request data by any request arranged before the current request in a plurality of concurrent requests;
the acquisition module is further adapted to: further judging whether the current request has the capability of setting the data identifier or not according to an initiating address carried by the current request and the connection establishing time of the current request; and if so, setting the data identifier for the request data according to the current request, and acquiring the request data.
9. The apparatus of claim 8, wherein the acquisition module is further adapted to:
and if the request data is provided with the data identification, refusing the acquisition of the request data by the current request.
10. The apparatus of claim 8, wherein the acquisition module is further adapted to:
and if the current request does not have the capability of setting the data identifier, refusing the current request to acquire the request data.
11. The apparatus according to any of claims 8-10, wherein the apparatus is adapted for a redis database.
12. The apparatus of claim 11, wherein the acquisition module is further adapted to:
and setting the data identification for the request data by utilizing a self-increment function.
13. The apparatus of claim 12, wherein the acquisition module is further adapted to:
and setting the data identifier for the request data by utilizing an incr function in a redis database.
14. The apparatus of claim 11, wherein the acquisition module is further adapted to:
and setting the data identifier for the request data by utilizing a setnx function in a redis database.
CN201610687176.8A 2016-08-18 2016-08-18 Concurrent request processing method and device Active CN106341345B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610687176.8A CN106341345B (en) 2016-08-18 2016-08-18 Concurrent request processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610687176.8A CN106341345B (en) 2016-08-18 2016-08-18 Concurrent request processing method and device

Publications (2)

Publication Number Publication Date
CN106341345A CN106341345A (en) 2017-01-18
CN106341345B true CN106341345B (en) 2019-12-20

Family

ID=57825038

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610687176.8A Active CN106341345B (en) 2016-08-18 2016-08-18 Concurrent request processing method and device

Country Status (1)

Country Link
CN (1) CN106341345B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108733704B (en) * 2017-04-20 2020-11-20 北京京东尚科信息技术有限公司 Multi-database data processing method and device, storage medium and electronic equipment
CN109241039B (en) * 2018-09-19 2023-05-26 江苏人加信息科技有限公司 Method, system, server and storage medium for realizing global unique parameterized file

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8041341B1 (en) * 1995-06-07 2011-10-18 Single Touch Interactive, Inc. System of providing information to a telephony subscriber
CN101968815B (en) * 2010-10-29 2012-07-25 西本新干线电子商务有限公司 Processing method of concurrent requests
CN102394867A (en) * 2011-10-10 2012-03-28 深圳市金槌拍卖行有限公司 Technology for converting network concurrent communication request into tandem queue
CN102880475B (en) * 2012-10-23 2015-08-12 普元信息技术股份有限公司 Based on the real-time event disposal system of cloud computing and method in computer software
CN103150149B (en) * 2013-03-26 2015-11-25 华为技术有限公司 Process database is reformed the method and apparatus of data
CN104408068A (en) * 2014-10-29 2015-03-11 中国建设银行股份有限公司 Report form data processing method and related equipment
CN104408088B (en) * 2014-11-11 2020-06-19 奇安信科技集团股份有限公司 Concurrent request control method and device
CN105592163B (en) * 2016-01-25 2018-07-17 上海斐讯数据通信技术有限公司 A kind of communication means and system

Also Published As

Publication number Publication date
CN106341345A (en) 2017-01-18

Similar Documents

Publication Publication Date Title
CN102957712B (en) Site resource loading method and system
CN106712981B (en) Node change notification method and device
CN107357885B (en) Data writing method and device, electronic equipment and computer storage medium
CN105611607B (en) It realizes the method for merging multiple WiFi and realizes the method and system of WiFi connection
RU2016142285A (en) CUSTOMER SERVICE INTEGRATION PLATFORM
US10084777B2 (en) Secure data processing method and system
CN103136342A (en) Searching method, system and searching server of application programs (APP)
JP2014510333A5 (en)
CN106341345B (en) Concurrent request processing method and device
CN110580305A (en) Method, apparatus, system, and medium for generating identifier
CN109739700B (en) Interface testing method and device
CN105704171B (en) System and method for realizing CDN access
CN102609742A (en) System and method for processing two-dimensional code of mobile terminal
CN106790593B (en) Page processing method and device
CN106294400A (en) The introduction method of batch data and system
CN106658666B (en) Method and equipment for establishing wireless connection
WO2016058478A1 (en) Data acquisition method, device and system
CN106844479B (en) Method and device for compressing and decompressing file
US20180088999A1 (en) Method, device, and system
CN112118189B (en) Flow sampling method, computer equipment and computer readable storage medium
CN106101125B (en) Verification processing method, device and system
CN109408369B (en) System testing method and device and electronic equipment
US11146571B2 (en) Data transmission method, apparatus, terminal device, and medium
CN110704498A (en) Data extraction method, device, equipment and computer readable storage medium
CN112579956A (en) Website account management method and device and electronic equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20220706

Address after: Room 801, 8th floor, No. 104, floors 1-19, building 2, yard 6, Jiuxianqiao Road, Chaoyang District, Beijing 100015

Patentee after: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

Address before: 100088 room 112, block D, 28 new street, new street, Xicheng District, Beijing (Desheng Park)

Patentee before: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

Patentee before: Qizhi software (Beijing) Co.,Ltd.