Method, device, equipment and medium for processing rush purchase requests under high concurrent traffic

By using ring queues and hash algorithms to process requests in the snap-up system, the problems of invalid requests and server stability in the snap-up scenario are solved, and effective snap-up quantity control and server stability guarantee are achieved.

CN113783917BActive Publication Date: 2024-11-26BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011289596.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-17
Publication Date
2024-11-26
Estimated Expiration
2040-11-17

AI Technical Summary

Technical Problem

In the snap-up scenario, there are a large number of invalid requests, such as malicious purchase software automatically initiates snap-up requests or malicious order swiping, which leads to overselling items and server stability problems, especially under high concurrent traffic, the system is prone to paralysis or errors.

Method used

The request information is cached using a ring queue. The maximum storage capacity is equal to the upper limit of the number of items to be purchased. The storage location is generated through a hash algorithm and the request is stored in the form of a linked list node. When the capacity exceeds the capacity, the stored request information is refused to respond to the new request and the stored request information is sent. Process the data processing module.

Benefits of technology

It effectively limits the number of rush purchases, avoids oversold problems, and ensures the stability of the server under high concurrent traffic, preventing system paralysis or errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113783917B_ABST
    Figure CN113783917B_ABST
Patent Text Reader

Abstract

A method, device, equipment and medium for processing snap-up requests under high concurrent traffic, the processing method comprising: obtaining the object information of the received request when the storage capacity of the circular queue used to cache request information is not full, the maximum storage capacity value of the circular queue is equal to the upper limit of the number of snap-up items in a predetermined scenario. Processing the object information to generate a storage location value of the request in the circular queue. The request is stored in the queue corresponding to the storage location value in the form of a linked list node, and the total number of nodes in the linked list of each queue in the circular queue is used to characterize the storage capacity value of each queue. When the total number of all nodes in the circular queue exceeds the maximum storage capacity value, refusing to respond to the newly added request, and sending the object information of the request stored in the circular queue to the data processing module for processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of Internet technology, and more specifically, to a method, device, equipment and medium for processing rush purchase requests under high concurrent traffic. Background Art

[0002] With the rise of e-commerce, various promotional activities have become a good means to stimulate consumers to consume. Online promotional activities have the following characteristics: the concurrent traffic is particularly large in a short period of time, and the number of items snapped up is limited.

[0003] In the process of realizing the concept of the present disclosure, the inventors found that there are at least the following problems in the prior art: In the rush-buying scenario, there are usually a large number of invalid requests, such as some malicious purchasing software that automatically initiates rush-buying requests, or malicious order-swiping. Therefore, how to ensure that the rush-buying items do not exceed the limit, and at the same time, how to ensure the stability of the server under high concurrent traffic and filter out invalid requests, and avoid system paralysis or errors caused by high traffic has become a technical problem that needs to be solved urgently. Summary of the invention

[0004] In view of this, the present disclosure provides a method, device, equipment and medium for processing rush purchase requests under high concurrent traffic.

[0005] The first aspect of the present disclosure provides a method for processing snap-up requests under high concurrent traffic. The above processing method includes: when the storage capacity of the circular queue used to cache request information is not full, obtaining the object information of the received request, and the maximum storage capacity value of the circular queue is equal to the upper limit of the number of snap-up items in a predetermined scenario. The above processing method also includes: processing the object information to generate a storage position value of the request in the circular queue. The above processing method also includes: storing the request in the queue corresponding to the storage position value in the form of a linked list node, and the total number of nodes in the linked list of each queue in the circular queue is used to characterize the storage capacity value of each queue. The above processing method also includes: when the total number of all nodes in the circular queue exceeds the maximum storage capacity value, refusing to respond to the newly added request, and sending the object information of the request stored in the circular queue to the data processing module for processing.

[0006] According to an embodiment of the present disclosure, the object information includes: the client's real IP address and user account information. Processing the object information to generate the storage location value of the request in the circular queue includes: generating a value based on the client's real IP address and user account information based on a hash algorithm; and performing a modulo operation on the generated value and the maximum storage capacity value of the circular queue to obtain a value as the storage location value of the request in the circular queue.

[0007] According to an embodiment of the present disclosure, the above-mentioned node contains: object information and count value information; multiple identical requests are stored in the linked list corresponding to the same node, and the count value increases accordingly with the number of storage times.

[0008] According to an embodiment of the present disclosure, the above-mentioned node contains: object information and count value information; the request is stored in the queue corresponding to the storage location value in the form of a node of a linked list, including: determining whether the storage content of the queue corresponding to the storage location value is blank. If the storage content of the queue corresponding to the storage location value is blank, the object information of the request is used as the content of the initial node of the linked list, and the count value in the initial node is recorded as 1. If the storage content of the queue corresponding to the storage location value is not blank, the existing nodes in the queue corresponding to the storage location value are traversed to determine whether there is a specific node in the queue corresponding to the storage location value that contains content consistent with the object information. If a specific node exists, the count value of the specific node is increased by 1. If there is no specific node, a new node is added after the existing node, the object information of the request is used as the content of the new node, and the count value in the new node is recorded as 1.

[0009] According to an embodiment of the present disclosure, the above processing method also includes: determining whether the count value of the specific node is greater than a preset value; if the count value of the specific node is greater than the preset value, refusing to respond to a new request consistent with the object information stored in the specific node.

[0010] According to an embodiment of the present disclosure, the processing method further includes: in the case of receiving a request for rush purchase from a user, determining whether the storage capacity of the circular queue is in a full state.

[0011] According to an embodiment of the present disclosure, the above processing method also includes: obtaining time information of the received request; determining the sequence of multiple requests according to the object information and the time information; and processing the object information of the multiple requests based on the sequence.

[0012] The second aspect of the present disclosure provides a processing device for rush purchase requests under high concurrent traffic. The above-mentioned processing device includes: an information acquisition module, a storage location generation module, a circular queue storage module, a request feedback module, a data sending module and a data processing module. The information acquisition module is used to obtain the object information of the received request when the storage capacity of the circular queue used to cache the request information is not full. The maximum storage capacity value of the circular queue is equal to the upper limit of the number of rush purchase items in a predetermined scenario. The storage location generation module is used to process the object information to generate the storage location value of the request in the circular queue. The circular queue storage module is used to store the request in the queue corresponding to the storage location value in the form of a linked list node. The total number of nodes in the linked list of each queue in the circular queue is used to characterize the storage capacity value of each queue. The request feedback module is used to refuse to respond to the newly added request when the total number of all nodes in the circular queue exceeds the maximum storage capacity value. The data sending module is used to send the object information of the request stored in the circular queue to the data processing module for processing. The data processing module is used to receive and process the object information of the request from the data sending module.

[0013] The third aspect of the present disclosure provides an electronic device. The electronic device includes: one or more processors; and a storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement any of the processing methods described above.

[0014] A fourth aspect of the present disclosure provides a computer-readable storage medium. The computer-readable storage medium stores executable instructions, which, when executed by a processor, enable the processor to implement any of the processing methods described above.

[0015] According to an embodiment of the present disclosure, data caching of request information is performed based on a circular queue, and the maximum storage capacity value of the circular queue is equal to the upper limit of the number of snap-up items in a predetermined scenario. Requests corresponding to the same storage location in the circular queue are stored in the form of nodes of a linked list, and the total number of nodes in the linked list of each queue in the circular queue can represent the storage capacity value of each queue, so that the snap-up number can be limited according to the maximum storage capacity value, avoiding the overselling problem where the number of responded requests exceeds the snap-up number. At the same time, the setting of the above-mentioned linked list can also ensure the stability of the server under high concurrent traffic, avoiding system paralysis or errors caused by high traffic. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The above and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:

[0017] Figure 1The application scenario of the method, device, equipment and medium for processing rush purchase requests under high concurrent traffic according to the embodiment of the present disclosure is schematically shown;

[0018] Figure 2 A flowchart schematically shows a method for processing a rush purchase request under high concurrent traffic according to an embodiment of the present disclosure;

[0019] Figure 3 A flowchart schematically shows a method for processing a rush purchase request under high concurrent traffic according to another embodiment of the present disclosure;

[0020] Figure 4 Schematically shows a detailed implementation flow chart of operation S14 according to an embodiment of the present disclosure;

[0021] Figure 5 Schematically shows a detailed implementation flow chart of operation S16 according to an embodiment of the present disclosure;

[0022] Figure 6 The detailed implementation process diagram of operation S16 according to an embodiment of the present disclosure is schematically shown, wherein (a) is an example of storage locations corresponding to a plurality of requests from different user terminals in a circular queue, (b) is a schematic diagram of a linked list variation when there are multiple identical requests in the same queue, and (c) is a schematic diagram of a linked list variation when there are identical requests and different requests in the same queue;

[0023] Figure 7 A flowchart schematically shows a method for processing a rush purchase request under high concurrent traffic according to another embodiment of the present disclosure;

[0024] Figure 8 A flowchart schematically shows a method for processing a rush purchase request under high concurrent traffic according to another embodiment of the present disclosure;

[0025] Fig. 9 A structural block diagram schematically shows a device for processing rush purchase requests under high concurrent traffic according to an embodiment of the present disclosure; and

[0026] Fig.10 The structure block diagram of an electronic device according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION

[0027] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.

[0028] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.

[0029] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification, and should not be interpreted in an idealized or overly rigid manner.

[0030] In the case of using expressions such as "at least one of A, B, and C, etc.", it should generally be interpreted in accordance with the meaning of the expression generally understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.). In the case of using expressions such as "at least one of A, B, or C, etc.", it should generally be interpreted in accordance with the meaning of the expression generally understood by those skilled in the art (for example, "a system having at least one of A, B, or C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).

[0031] Figure 1 The application scenario of the method, device, equipment and medium for processing rush purchase requests under high concurrent traffic according to the embodiment of the present disclosure is schematically shown. It should be noted that: Figure 1 What is shown are merely examples of application scenarios to which the embodiments of the present disclosure can be applied, in order to help those skilled in the art understand the technical content of the present disclosure, but it does not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios.

[0032] Reference Figure 1As shown, in the rush purchase scenario, for a limited number of rush purchase items, there are usually thousands or even more users who will initiate rush purchase operations within a limited time. The user initiates a rush purchase request to the server based on the terminal. The rush purchase request can be a flash sale, a limited time rush purchase, a rush purchase of train tickets, and other scenarios.

[0033] Users can use terminal devices to interact with servers through the network to receive or send messages, etc. Various communication client applications can be installed on the terminal device, such as shopping applications. Web browser applications, search applications, instant messaging tools, email clients, or social platform software can also be installed (only as examples).

[0034] The terminal device may be any electronic device having a display screen and supporting web browsing, including but not limited to a smart phone, a tablet computer, a laptop computer, a desktop computer, and the like.

[0035] The server may be a server that provides various services, such as a background management server that supports websites browsed by users using terminal devices (only as an example). The background management server may analyze and process received data such as user requests, and feed back processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.

[0036] The network is a medium used to provide a communication link between terminal devices and servers. The network can include various connection types, such as wired, wireless communication links or fiber optic cables, etc.

[0037] Reference Figure 1 As shown in Figure 1, generally speaking, for rush purchases of different scales, the number of real-time access users to the server is usually in the tens of thousands to tens of millions, or even hundreds of millions. The same user may also have multiple frequent accesses, such as Figure 1 In the example, terminal device A has initiated multiple purchase requests, namely requests A1, A2, A3 and A4, terminal device B has initiated multiple purchase requests, namely requests B1, B2, B3, B4 and B5, terminal device C has initiated multiple purchase requests, namely requests C1, C2 and C3, and terminal device X has initiated multiple purchase requests, namely requests X1, X2 and X3. In a short period of time, the concurrent traffic to the same server is very large, and the same user may have multiple purchase behaviors, especially a large number of invalid requests, such as some malicious purchase software that automatically initiates purchase requests, or malicious order brushing, which usually results in the number of goods reaching the limit, and some requests will be responded to, that is, the number of users who have completed transactions exceeds the established limit on goods, and some users cannot be cashed; or some users may obtain multiple items through malicious purchases, resulting in a lower probability of purchases for other users.

[0038] For the above-mentioned rush-buying scenario, how to ensure that the items snapped up do not exceed the limit, while also ensuring the stability of the server under high concurrent traffic and filtering out invalid requests to avoid system paralysis or errors caused by high traffic has become a technical problem that needs to be solved urgently.

[0039] In some related technologies, invalid requests are eliminated by using a distributed lock method, and the unique request is determined by using a distributed lock method based on the product + user ID as the unique identifier. This method is simple and crude. As long as there is this unique identifier in the cache, other requests will be filtered and discarded. The above-mentioned distributed lock method is prone to deadlock problems. In addition, if the distributed cache crashes on the server, the lock will never be released.

[0040] Some adopt the first-in-first-out (FIFO) queue solution, directly putting requests into the queue, based on the first-in-first-out principle, and processing requests one by one from the queue. In the scenario of high concurrent traffic, due to the large number of requests, it is very likely that the queue memory will be "burst" in an instant, and then the system will fall into an abnormal state again. Even if the queue memory is increased, the speed at which the system processes requests in a queue cannot be compared with the number of requests that are madly pouring into the queue. In this way, the requests in the queue will accumulate more and more, and the average response time of the network system will eventually drop significantly, and the system will still fall into an abnormal state.

[0041] In view of this, the embodiments of the present disclosure provide a method, device, equipment and medium for processing snap-up requests under high concurrent traffic. The above processing method includes: when the storage capacity of the circular queue used to cache request information is not full, obtaining the object information of the received request, and the maximum storage capacity value of the circular queue is equal to the upper limit of the number of snap-up items in a predetermined scenario. The above processing method also includes: processing the object information to generate a storage position value of the request in the circular queue. The above processing method also includes: storing the request in the queue corresponding to the storage position value in the form of a linked list node, and the total number of nodes in the linked list of each queue in the circular queue is used to characterize the storage capacity value of each queue. The above processing method also includes: when the total number of all nodes in the circular queue exceeds the maximum storage capacity value, refusing to respond to the newly added request, and sending the object information of the request stored in the circular queue to the data processing module for processing.

[0042] A first exemplary embodiment of the present disclosure provides a method for processing a rush purchase request under high concurrent traffic.

[0043] Figure 2 The flowchart schematically shows a method for processing a rush purchase request under high concurrent traffic according to an embodiment of the present disclosure.

[0044] Reference Figure 2 As shown, the method for processing snap-up requests under high concurrent traffic of an embodiment of the present disclosure includes the following operations: S12, S14, S16 and S18.

[0045] In operation S12, when the storage capacity of the circular queue for caching request information is not full, the object information of the received request is obtained. The maximum storage capacity value of the circular queue is equal to the upper limit of the number of snap-up items in a predetermined scenario.

[0046] In operation S14, the object information is processed to generate a storage location value of the request in the circular queue.

[0047] In operation S16, the request is stored in the queue corresponding to the storage location value in the form of a node of a linked list, and the total number of nodes in the linked list of each queue in the circular queue is used to represent the storage capacity value of each queue.

[0048] In operation S18, when the total number of all nodes in the ring queue exceeds the maximum storage capacity value, the newly added request is rejected and the object information of the request stored in the ring queue is sent to the data processing module for processing.

[0049] The above operations S12 to S18 may be performed for each of the multiple requests received.

[0050] Data caching of request information is performed based on a circular queue, and the maximum storage capacity value of the circular queue is equal to the upper limit of the number of items to be snapped up in a predetermined scenario. Requests corresponding to the same storage location in the circular queue are stored in the form of nodes in a linked list. The total number of nodes in the linked list of each queue in the circular queue can represent the storage capacity value of each queue, so that the number of snap-ups can be limited according to the maximum storage capacity value, avoiding the overselling problem when the number of responded requests exceeds the number of snap-ups. At the same time, the setting of the above-mentioned linked list can also ensure the stability of the server under high concurrent traffic, and avoid system paralysis or errors caused by high traffic.

[0051] Figure 3 A flowchart of a method for processing rush purchase requests under high concurrent traffic according to another embodiment of the present disclosure is schematically shown.

[0052] According to the embodiments of the present disclosure, referring to Figure 3 As shown, the processing method further includes operation S10, in which, when receiving a request for rush purchase from a user, it is determined whether the storage capacity of the circular queue is full. The operation S10 is performed before operation S12.

[0053] According to an embodiment of the present disclosure, the above operations S10, S12, S14, S16, and S18 may be performed by a server.

[0054] When the above operation S10 is implemented, the current storage capacity of the circular queue can be compared with the maximum storage capacity value. If the current storage capacity is equal to the maximum storage capacity value, it means that the storage capacity of the circular queue is full; if the current storage capacity is less than the maximum storage capacity value, it means that the storage capacity of the circular queue is not full.

[0055] The maximum storage capacity of the ring queue is equal to the upper limit of the number of items to be purchased in the predetermined scenario. When the storage capacity of the ring queue is full, it means that the number of valid requests stored in the ring queue has reached the upper limit of the number of items to be purchased in the predetermined scenario, and no corresponding items can be allocated for new requests. At this time, all new requests need to be rejected. Refer to Figure 3 As shown by the branch from S10 to S18.

[0056] Reference Figure 3 As shown, the processing method further includes operation S17: determining whether the total number of all nodes of the ring queue exceeds the maximum storage capacity value. When the above operation S17 is implemented, the number of nodes in the linked list of each queue can be calculated and summed during the execution of each request to obtain the total number of nodes of all queues, and the total number of all nodes of the ring queue is compared with the maximum storage capacity value.

[0057] The above operation S10 is the overall determination of the storage capacity, and operation S17 is the calculation of the real-time storage capacity. The above two operations can be implemented successively in the manner described above, or can be combined into one operation. The implementation method can be the method of the above operation S10 or the method of operation S17.

[0058] Reference Figure 3 As shown, when the storage capacity of the circular queue for caching request information is not full, operation S12 is performed to obtain the object information of the received request.

[0059] According to an embodiment of the present disclosure, the above-mentioned object information includes: the real IP address of the client and the user account information.

[0060] The real IP address is the public IP address. Since the public IP address is unique, invalid requests for automatic purchase of items from some virtual network addresses can be filtered out based on the real IP address of the client.

[0061] Figure 4 The detailed implementation flowchart of operation S14 according to the embodiment of the present disclosure is schematically shown.

[0062] According to the embodiments of the present disclosure, referring to Figure 4As shown, the operation S14 of processing the object information to generate the value requested at the storage location of the circular queue includes the following sub-operations: S141 and S142.

[0063] In sub-operation S141, a value is generated based on a hash algorithm using the client's real IP address and user account information.

[0064] The hash algorithm can be a direct addressing method, a random number method, or a division remainder method, etc.

[0065] In sub-operation S142, a value obtained by performing a modulo operation on the generated value and the storage capacity value of the circular queue is used as a value requested at a storage location in the circular queue.

[0066] The above sub-operations S141 and S142 generate a storage location value of the request in the circular queue based on the real IP address of the requesting client and the user account information. The values ​​obtained by processing the real IP address of the client and the user account information based on the hash algorithm are roughly distributed for different requests, which effectively improves the rational allocation of resources and improves processing efficiency when each request is allocated to each queue in the circular queue, avoids a large number of different requests being allocated to the storage location of the same queue, resulting in some queues being in a blank state, while some queues have more requests to be stored, which results in low efficiency of real-time processing and unreasonable resource allocation.

[0067] After a value is generated based on a hash algorithm using the client's real IP address and user account information for a request, by performing a modulo operation on the generated value and the storage capacity of the circular queue, it can be ensured that the storage location value of the request will not exceed the maximum storage capacity value.

[0068] Figure 5 The detailed implementation flowchart of operation S16 according to the embodiment of the present disclosure is schematically shown. Figure 6 The detailed implementation process diagram of operation S16 according to an embodiment of the present disclosure is schematically shown, wherein (a) is an example of storage locations corresponding to multiple requests from different user terminals in a circular queue, (b) is a schematic diagram of the variation of the linked list when there are multiple identical requests in the same queue, and (c) is a schematic diagram of the variation of the linked list when there are identical requests and different requests in the same queue.

[0069] According to the embodiments of the present disclosure, referring to Figure 5 As shown, operation S16 of storing the request in the queue corresponding to the storage location value in the form of a node of a linked list includes the following sub-operations: S161, S162a, S162b, S163a and S163b.

[0070] In sub-operation S161, it is determined whether the storage content of the queue corresponding to the storage location value is blank.

[0071] In sub-operation S162a, if the storage content of the queue corresponding to the storage location value is blank, the requested object information is used as the content of the initial node of the linked list, and the count value in the initial node is recorded as 1.

[0072] In sub-operation S162b, if the storage content of the queue corresponding to the storage location value is not blank, the existing nodes in the queue corresponding to the storage location value are traversed to determine whether there is a specific node in the queue corresponding to the storage location value that contains content consistent with the object information.

[0073] In sub-operation S163a, if the specific node exists, the count value of the specific node is increased by 1.

[0074] In sub-operation S163b, if the specific node does not exist, a new node is added after the existing node, the requested object information is used as the content of the new node, and the count value in the new node is recorded as 1.

[0075] The process of storing the request in the queue corresponding to the storage location value in the form of a node of a linked list can be referred to Figure 6 As shown in (a) to (c).

[0076] Reference Figure 6 As shown in (a), the circular queue includes k queues, k is an integer, and k satisfies the following expression: 2≤k≤the upper limit of the number of items to be snapped up in the predetermined scenario. In each queue, the stored objects are stored in the form of nodes of a linked list. The total number of nodes in the linked list of each queue in the circular queue is used to represent the storage capacity value of each queue. For each predetermined scenario, the upper limit of the number of items to be snapped up is a fixed value.

[0077] The larger the k value is, the fewer requests will be assigned to the same queue per unit time. When storing in the form of linked list nodes, the nodes corresponding to the smaller number of requests can be stored in each queue one after another, which helps improve processing efficiency. For example, if the upper limit of the number of items to be purchased in the scheduled scenario is 100, then k can be 100, 99, 98, 97, 96, 95, 94, 93, 92, 99, 90, 80, 70, 60, 50, 40, 20, etc.

[0078] Reference Figure 6As shown in (a), each queue in the circular queue is assigned a position number, which is represented as 1, 2, ..., k. After the request generated by processing the object information of the request in the above operation S14 takes the value of the storage position of the circular queue, the request is assigned to the queue with the corresponding number based on the storage position value. For example, requests A1 and A2 of terminal device A are sent to the server in sequence. After the server performs operations S10, S12 and S14 for the above two requests A1 and A2 in sequence, the storage position values ​​corresponding to requests A1 and A2 are obtained. Since the real IP address of the client of requests A1 and A2 is IP A , user account information is PIN A , the object information of the two requests A1 and A2 is the same, so the same storage location value will be generated. Figure 6 Requests A1 and A2 shown in (a) both point to the same queue, with the queue at position number 6 being used as an example.

[0079] According to an embodiment of the present disclosure, multiple identical requests are stored in the linked list corresponding to the same node, and the count value increases accordingly with the number of storage times. In the present disclosure, the meaning of the same request is: if the object information of multiple requests is the same, then these requests are the same request. Figure 5 and Figure 6 As shown in (a) and (b), the object information of the two requests A1 and A2 from the same terminal device A is the same. Therefore, when storing in operation S16, requests A1 and A2 will be judged as the same requests and assigned to the queue with the same position number for storage. The count value increases accordingly with the number of storage times.

[0080] For example, when request A1 is stored in queue 6, the storage content of queue 6 is blank, then the object information IP of request A1 is stored in queue 6. A +PIN A As the content of the initial node of the linked list of queue 6, the count value in the initial node is recorded as 1; later, when request A2 is stored in queue 6, the storage content of queue 6 is not blank, then the existing nodes in queue 6 are traversed to determine whether there is a specific node in the queue corresponding to the storage position value that contains content consistent with the object information. In this example, since there is a node in the existing nodes in queue 6 that contains the object information of IP A +PIN A , and the object information IP of request A2 to be stored this time A +PIN A are consistent, then the initial node of the above request A1 is determined to be a specific node, and when request A2 is stored in queue 6, the count value of the specific node is increased by 1, such as Figure 6 As shown in (b).

[0081] For example, the request B from the terminal device B and the requests C1 and C2 from the terminal device C have a temporal sequence. Figure 6 In (a), arrows are single arrows, double arrows, and triple-strike arrows, respectively, indicating that request B precedes request C1, and request C1 precedes request C2. After the above requests execute operations S10, S12, and S14 in sequence, the storage location values ​​corresponding to requests B, C1, and C2 are obtained. Requests B, C1, and C2 all correspond to queue 1. Figure 6 As shown in (c), when request B is stored in queue 1, the storage content of queue 1 is blank, so the object information IP of request B is B +PIN B As the content of the initial node of the linked list of queue 1, the count value in the initial node is recorded as 1. Later, when request C1 is stored in queue 1, if the storage content of queue 1 is not blank, the existing nodes in queue 1 are traversed to determine whether there is a specific node in the queue corresponding to the storage position value that contains content consistent with the object information. If it is determined that there is no specific node, a new node is added after the existing node, and the object information IP of request C1 is added. C +PIN C As the content of the newly added node, the count value in the newly added node is recorded as 1, and there is a connection relationship between the newly added node and the existing node. For example, the storage address of the next node is stored in the previous node. Figure 6 In (c), arrows are used to indicate the connection relationship between nodes. Later, when request C2 is stored in queue 1, if the storage content of queue 1 is not blank, the existing nodes in queue 1 are traversed to determine whether there is a specific node in the queue corresponding to the storage position value that contains content consistent with the object information. In this example, since there is a node in queue 1 that contains object information of IP C +PIN C , and the object information IP of the request C2 to be stored this time C +PIN C are consistent, then the node of the request C1 is determined as a specific node. When the request C2 is stored in queue 1, the count value of the specific node is increased by 1, such as Figure 6 As shown in (c).

[0082] Figure 7 A flowchart of a method for processing rush purchase requests under high concurrent traffic according to yet another embodiment of the present disclosure is schematically shown.

[0083] According to the embodiments of the present disclosure, referring to Figure 7 As shown in the dashed box, the above processing method also includes operations S17-1 and S18-1.

[0084] In operation S17 - 1 , it is determined whether a count value of a specific node is greater than a preset value.

[0085] In operation S18 - 1 , if the count value of the specific node is greater than a preset value, a response to a new addition request consistent with object information stored in the specific node is rejected.

[0086] Figure 7 In the figure, two paths are illustrated with dotted lines and dash-dotted lines respectively when the count value of a specific node is not greater than a preset value. One path is to return to operation S10 when it is determined that the count value of the specific node is not greater than the preset value, and the subsequent requests are to execute operations S10, S12, S14, S16, and S18. The other path is to execute operation S17 when it is determined that the count value of the specific node is not greater than the preset value.

[0087] Based on operation S17-1 and operation S18-1, when the same user terminal initiates particularly frequent request operations, the number of times multiple requests are initiated by the same terminal can be limited. After the number of requests exceeds the preset value, no new requests will be responded to, thereby avoiding the problem of poor server performance and slow response caused by high traffic corresponding to malicious order brushing.

[0088] Figure 8 A flowchart of a method for processing rush purchase requests under high concurrent traffic according to yet another embodiment of the present disclosure is schematically shown.

[0089] According to an embodiment of the present disclosure, when performing the above operations S12, S14, S16 and S18 for each of the received multiple requests, or performing operations S10, S12, S14, S16 and S18, the execution order is determined by operations S12-1 and S13 of this embodiment. Figure 8 As shown in the dashed box, the above processing method also includes operations S12-1 and S13.

[0090] In operation S12 - 1 , time information of the received request is acquired.

[0091] In one embodiment, multiple requests are received, and request A, request B, and request C are used as examples for explanation. The time information of request A received is: t A , the time information of request B received is: t B , the time information of the received request C is: t C .

[0092] In operation S13, the sequence of the multiple requests is determined according to the object information and the time information.

[0093] The object information of the received request A includes: IP A +PIN A , the object information of the received request B includes: IP B+PIN B , the object information of the received request C includes: IP C +PIN C , the order of different requests is determined according to the object information and time information: add time information after the object information of request A, add time information after the object information of request B, and add time information after the object information of request C. The object information of multiple requests is sorted based on the time information to obtain the order of multiple requests.

[0094] In operation S14, object information of multiple requests is processed based on the order of precedence, and the object information of the current request is processed to generate a storage position value of the current request in the circular queue.

[0095] In operation S16, the current request is stored in the queue corresponding to the storage location value in the form of a node of a linked list, and the total number of nodes in the linked list of each queue in the circular queue is used to represent the storage capacity value of each queue.

[0096] The example of processing the object information of each request based on the order of the above requests can refer to the above Figure 6 Related description.

[0097] The processing method of this embodiment is based on a circular queue for data caching of request information. The maximum storage capacity value of the circular queue is equal to the upper limit of the number of snap-up items in a predetermined scenario. Requests corresponding to the same storage location in the circular queue are stored in the form of nodes of a linked list. The total number of nodes in the linked list of each queue in the circular queue can represent the storage capacity value of each queue, so that the snap-up quantity can be limited according to the storage capacity to avoid overselling problems caused by the number of responded requests exceeding the snap-up quantity. At the same time, the setting of the above-mentioned linked list can also ensure the stability of the server under high concurrent traffic and avoid system paralysis or errors caused by high traffic.

[0098] A second exemplary embodiment of the present disclosure provides a device for processing rush purchase requests under high concurrent traffic.

[0099] Fig. 9 The structural block diagram of the device for processing rush purchase requests under high concurrent traffic according to an embodiment of the present disclosure is schematically shown.

[0100] Reference Fig. 9 As shown, the processing device 2 of the present disclosure includes: an information acquisition module 21, a storage location generation module 22, a circular queue storage module 23, a request feedback module 24, a data sending module 25 and a data processing module 26.

[0101] The information acquisition module 21 is used to acquire the object information of the received request when the storage capacity of the circular queue for caching the request information is not full.

[0102] The storage capacity of the circular queue is equal to the upper limit of the number of items that can be snapped up in a predetermined scenario.

[0103] The storage location generation module 22 is used to process the object information to generate the storage location value of the request in the circular queue. The storage location generation module 22 includes a calculation unit, which can perform operations S141 and S142 to generate the storage location value of the request in the circular queue.

[0104] The circular queue storage module 23 is used to store the request in the queue corresponding to the storage position value in the form of a node of a linked list.

[0105] The total number of nodes in the linked list of each queue in the ring queue is used to represent the storage capacity value of each queue.

[0106] The circular queue storage module 23 includes: a judgment submodule and a storage submodule. The judgment submodule can execute operations S161 and S162b, and the storage submodule can execute operations S162a, S163a and S163b.

[0107] The request feedback module 24 is used to refuse to respond to new requests when the total number of all nodes in the ring queue exceeds the storage capacity value.

[0108] According to an embodiment of the present disclosure, the request feedback module 24 is further configured to refuse to respond to a new request that is consistent with the object information stored in the specific node when the count value of the specific node is greater than a preset value.

[0109] The data sending module 25 is used to send the requested object information stored in the circular queue to the data processing module for processing.

[0110] The data processing module 26 is used to receive and process the object information requested by the data sending module.

[0111] According to the embodiments of the present disclosure, referring to Fig. 9 As shown in the dotted box, the processing device further includes: a storage capacity determination module 20, which is used to determine whether the storage capacity of the circular queue is full when receiving a request for rush purchase from a user.

[0112] The storage capacity determination module 20 is also used to determine whether the total number of all nodes in the ring queue exceeds the maximum storage capacity value.

[0113] According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits, or at least part of the functions of any one of them can be implemented in one module. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be split into multiple modules for implementation. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be at least partially implemented as hardware circuits, such as field programmable gate arrays (FPGAs), programmable logic arrays (PLAs), systems on chips, systems on substrates, systems on packages, application specific integrated circuits (ASICs), or can be implemented by hardware or firmware in any other reasonable way of integrating or packaging the circuit, or in any one of the three implementation methods of software, hardware, and firmware, or in any appropriate combination of any of them. Alternatively, according to the embodiments of the present invention, one or more of the modules, submodules, units, and subunits can be at least partially implemented as computer program modules, and when the computer program modules are run, the corresponding functions can be performed.

[0114] For example, any multiple of the storage capacity determination module 20, the information acquisition module 21, the storage location generation module 22, the circular queue storage module 23, the request feedback module 24, the data sending module 25, and the data processing module 26 can be combined in one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the storage capacity determination module 20, the information acquisition module 21, the storage location generation module 22, the circular queue storage module 23, the request feedback module 24, the data sending module 25, and the data processing module 26 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware, and firmware or in an appropriate combination of any of them. Alternatively, at least one of the storage capacity determination module 20, the information acquisition module 21, the storage location generation module 22, the circular queue storage module 23, the request feedback module 24, the data sending module 25 and the data processing module 26 can be at least partially implemented as a computer program module, which can perform corresponding functions when the computer program module is executed.

[0115] A third exemplary embodiment of the present disclosure provides an electronic device. The electronic device includes: one or more processors; and a storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement any of the processing methods described above.

[0116] Fig.10 The structure block diagram of an electronic device according to an embodiment of the present disclosure is schematically shown. Fig.10 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0117] Reference Fig.10 As shown, the electronic device 3 according to the embodiment of the present disclosure includes a processor 301, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 302 or the program loaded from the storage part 308 to the random access memory (RAM) 303. The processor 301 may include, for example, a general-purpose microprocessor (such as a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (for example, an application-specific integrated circuit (ASIC)), etc. The processor 301 may also include an onboard memory for caching purposes. The processor 301 may include a single processing unit or multiple processing units for performing different actions of the method flow according to the embodiment of the present disclosure.

[0118] In RAM 303, various programs and data required for the operation of electronic device 3 are stored. Processor 301, ROM 302 and RAM 303 are connected to each other through bus 304. Processor 301 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 302 and / or RAM 303. It should be noted that the program can also be stored in one or more memories other than ROM 302 and RAM 303. Processor 301 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.

[0119] According to an embodiment of the present disclosure, the electronic device 3 may further include an input / output (I / O) interface 305, which is also connected to the bus 304. The electronic device 3 may further include one or more of the following components connected to the I / O interface 305: an input portion 306 including a keyboard, a mouse, etc.; an output portion 307 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 308 including a hard disk, etc.; and a communication portion 309 including a network interface card such as a local area network card, a modem, etc. The communication portion 309 performs communication processing via a network such as the Internet. A drive 310 is also connected to the I / O interface 305 as needed. A removable medium 311, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 310 as needed, so that a computer program read therefrom is installed into the storage portion 308 as needed.

[0120] According to an embodiment of the present disclosure, the method flow according to an embodiment of the present disclosure can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 309, and / or installed from the removable medium 311. When the computer program is executed by the processor 301, the above-mentioned functions defined in the system of the embodiment of the present disclosure are executed. According to an embodiment of the present disclosure, the system, equipment, device, module, unit, etc. described above can be implemented by a computer program module.

[0121] A fourth exemplary embodiment of the present disclosure provides a computer-readable storage medium, wherein executable instructions are stored on the computer-readable storage medium, and when the instructions are executed by a processor, the processor implements any of the processing methods described above.

[0122] The computer-readable storage medium may be included in the device / apparatus / system described in the above embodiment; or it may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.

[0123] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus or a device. For example, according to an embodiment of the present disclosure, a computer-readable storage medium may include the ROM 302 and / or RAM 303 described above and / or one or more memories other than ROM 302 and RAM 303.

[0124] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0125] It will be appreciated by those skilled in the art that the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations and / or combinations are not explicitly described in the present disclosure. In particular, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways without departing from the spirit and teachings of the present disclosure. All of these combinations and / or combinations fall within the scope of the present disclosure.

[0126] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. The scope of the present disclosure is defined by the attached claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.

Claims

1. A method for processing rush purchase requests under high concurrent traffic, include: When the storage capacity of the circular queue for caching request information is not full, obtaining the object information of the received request, wherein the maximum storage capacity value of the circular queue is equal to the upper limit of the number of items to be snapped up in a predetermined scenario; Processing the object information to generate a value of the request at a storage location of the circular queue; The request is stored in the queue corresponding to the storage location value in the form of a node of a linked list, and the total number of nodes in the linked list of each queue in the circular queue is used to represent the storage capacity value of each queue, wherein multiple identical requests are stored in the linked list corresponding to the same node, and the count value of the node increases accordingly with the number of storage times; as well as When the total number of all nodes in the circular queue exceeds the maximum storage capacity value, the newly added request is rejected and the object information of the request stored in the circular queue is sent to the data processing module for processing.

2. The processing method according to claim 1, in, The object information includes: the client's real IP address and user account information; The processing of the object information to generate the request to obtain a value at a storage location of the ring queue includes: Generate a value based on the client's real IP address and the user account information using a hash algorithm; and A value obtained by performing a modulo operation on the generated value and the maximum storage capacity value of the circular queue is used as the value of the request at the storage position of the circular queue.

3. The processing method according to claim 1, in, The node contains: the object information and count value information; multiple identical requests are stored in the linked list corresponding to the same node, and the count value increases accordingly with the number of storage times.

4. The processing method according to claim 1, in, The node includes: the object information and the count value information; the request is stored in the queue corresponding to the storage location value in the form of a node of a linked list, including: Determine whether the storage content of the queue corresponding to the storage position value is blank; If the storage content of the queue corresponding to the storage location value is blank, the requested object information is used as the content of the initial node of the linked list, and the count value in the initial node is recorded as 1; If the storage content of the queue corresponding to the storage position value is not blank, traverse the existing nodes in the queue corresponding to the storage position value to determine whether there is a specific node in the queue corresponding to the storage position value that contains content consistent with the object information; If the specific node exists, the count value of the specific node is increased by 1; If the specific node does not exist, a new node is added after the existing node, the requested object information is used as the content of the new node, and the count value in the new node is recorded as 1.

5. The processing method according to claim 4, further comprising: include: Determine whether the count value of the specific node is greater than a preset value; If the count value of the specific node is greater than a preset value, the response to the new addition request that is consistent with the object information stored in the specific node is rejected.

6. The processing method according to claim 1, further comprising: include: When a request for rush purchase is received from a user, it is determined whether the storage capacity of the circular queue is in a full state.

7. The processing method according to claim 1, further comprising: include: Get the time information of the received request; Determine the order of the multiple requests according to the object information and the time information; Processes object information from multiple requests based on the order in which they were requested.

8. A device for processing rush purchase requests under high concurrent traffic, include: An information acquisition module, used to acquire object information of a received request when the storage capacity of a circular queue for caching request information is not full, wherein the maximum storage capacity value of the circular queue is equal to the upper limit of the number of items to be snapped up in a predetermined scenario; A storage location generating module, used for processing the object information to generate a storage location value of the request in the circular queue; A circular queue storage module, used to store the request in the queue corresponding to the storage position value in the form of a node of a linked list, wherein the total number of nodes in the linked list of each queue in the circular queue is used to represent the storage capacity value of each queue, wherein multiple identical requests are stored in the linked list corresponding to the same node, and the count value of the node increases accordingly with the number of storage times; A request feedback module, used for refusing to respond to new requests when the total number of all nodes in the ring queue exceeds the maximum storage capacity value; a data sending module, configured to send the requested object information stored in the circular queue to a data processing module for processing; and The data processing module is used to receive and process the object information requested by the data sending module.

9. An electronic device, include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the processing method described in any one of claims 1 to 7.

10. A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, enables the processor to implement the processing method according to any one of claims 1 to 7.