Data processing method, electronic device and computer program product

By calculating the hash value of the user account in the flash sale service node and assigning processing tasks, the data processing problems caused by flow limit and delay processing in large traffic scenarios are solved, and the timeliness and accuracy of data processing is achieved.

CN119583559AActive Publication Date: 2025-03-07CHINA UNITED NETWORK COMM GRP CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411698930.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-25
Publication Date
2025-03-07
Estimated Expiration
2044-11-25

AI Technical Summary

Technical Problem

In scenarios where large traffic, high timeliness requirements and accurate processing results, the current limiting and delay processing solutions in the prior art have problems of reducing data traffic and affecting the fairness and randomness of flash sales activities.

Method used

By calculating the hash value of the user account in N flash sales service nodes and assigning it to different flash sales service nodes for parallel processing, the processing results are returned in real time without reducing data traffic.

Benefits of technology

It realizes real-time return of processing results in large traffic scenarios, ensuring the timeliness and accuracy of data processing, and avoiding problems caused by current limiting and delay processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119583559A_ABST
    Figure CN119583559A_ABST
Patent Text Reader

Abstract

The invention provides a data processing method, electronic equipment and a computer program product, and relates to the field of communication. The method is applied to a first seckilling service node. The method comprises the following steps: a first seckilling service node receives to-be-processed seckilling request data from a balancing server; the seckilling request data to be processed comprises a request user account requesting seckilling; the first seckilling service node calculates a first hash value of the request user account, and performs modulo operation on the first hash value by using N to obtain a target number corresponding to the to-be-processed seckilling request data; and under the condition that the target number is the same as the natural number number corresponding to the first seckilling service node, the first seckilling service node processes the to-be-processed seckilling request data. The method is suitable for a seckilling data processing process, and is used for solving the defects of a flow limiting scheme and a delay processing scheme in a seckilling scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communications, and in particular to a data processing method, electronic equipment, and computer program product. Background Art

[0002] For scenarios with large traffic volumes of business requests, relevant technologies can be used to handle them through methods such as current limiting and delay processing.

[0003] Among them, current limiting can also be understood as a fixed upper limit for traffic distribution. For example, an application software distribution system with an activatable Remote Method Invoke (RMI) framework can be designed based on the prototype system. This system can realize active software distribution under the browser / server (Browser / Server, B / S).

[0004] Delayed processing means that when the system pressure is too high, the distribution of traffic to the downstream system is suspended, and the request data is stored separately in a storage space. After the downstream system recovers its processing capacity, distribution and processing will continue.

[0005] However, if the scenario is one with high traffic volume, high timeliness requirements, and accurate processing results, the relevant technology will be insufficient. For example, in the case of flash sales, flow control will reduce data traffic, resulting in some users being unable to participate in the flash sales, while delayed processing will reduce timeliness and reduce the fairness and randomness of the flash sales. Summary of the invention

[0006] The present application provides a data processing method, an electronic device, and a computer program product, which can return the corresponding processing results in real time at one time when there is a large flow request without reducing the data flow, thereby ensuring the timeliness and accuracy of data processing.

[0007] In a first aspect, the present application provides a data processing method, which is applied to any first flash sale service node among N flash sale service nodes; each of the N flash sale service nodes corresponds to a natural number number; the N flash sale service nodes have a communication connection with a balancing server; N is a positive integer; the method includes: the first flash sale service node receives pending flash sale request data from the balancing server; the pending flash sale request data includes a requesting user account requesting the flash sale; the first flash sale service node calculates a first hash value of the requesting user account, and modulo N on the first hash value to obtain a target number corresponding to the pending flash sale request data; when the target number is the same as the natural number number corresponding to the first flash sale service node, the first flash sale service node processes the pending flash sale request data.

[0008] It should be understood that the current limiting scheme in the related art will reduce data traffic, resulting in some users being unable to participate in the flash sale, while the delayed processing scheme has low timeliness, which will reduce the fairness and randomness of the flash sale activity. In the data processing method provided by the present application, any of the N flash sale service nodes can calculate the first hash value of the user account, and take the modulus of the first hash value by N, so as to distribute the flash sale request data of different user accounts to different flash sale service nodes for parallel processing, so that the corresponding processing results can be returned in real time at one time without reducing the data traffic, thereby ensuring the timeliness and accuracy of data processing.

[0009] Optionally, the first flash sale service node processes the flash sale request data to be processed, including: the first flash sale service node intercepts and identifies the flash sale request data to be processed based on the blacklist data in a pre-established hash table; wherein the hash table includes three layers, the key of the first layer of the hash table is the blacklist type, and the value of the first layer is the first-level sub-hash table; the second layer of the hash table is the first-level sub-hash table; the key of the first-level sub-hash table is the partition number, and the value of the first-level sub-hash table is the second-level sub-hash table; the third layer of the hash table is the second-level sub-hash table; the key of the second-level sub-hash table is the user account, and the value of the second-level sub-hash table is the blacklist expiration time.

[0010] In the data processing method provided by the present application, the first second kill service node can also intercept and identify the second kill request data to be processed based on the blacklist data in the pre-established hash table, and the hash table is divided into three layers, the first layer is the blacklist type, the second layer is the partition corresponding to each blacklist type, and the third layer is the blacklist user account and blacklist expiration time stored in each partition. The first second kill service node can locate and intercept and identify the blacklist user account more quickly by partitioning and storing the blacklist user account. In the second kill activity, the second kill service node needs to process a large number of concurrent requests. If the blacklist user account is not effectively partitioned, the second kill service node may need to spend more time and resources to retrieve and process these requests. Partition storage can significantly improve the processing efficiency of the second kill service node and ensure the smooth progress of the second kill activity.

[0011] Optionally, the first flash sale service node intercepts and identifies the flash sale request data to be processed based on the blacklist data in a pre-established hash table, including: the first flash sale service node determines, from the hash table, a reference first-level sub-hash table corresponding to the request data to be processed according to the target blacklist type corresponding to the request data to be processed; the first flash sale service node obtains a second hash value of the requesting user account, and modulo M on the second hash value to obtain a reference partition number; M is the upper limit of the number of partition numbers in the first-level sub-hash table; the first flash sale service node determines, from the reference first-level sub-hash table, a reference second-level sub-hash table corresponding to the request data to be processed according to the reference partition number; the first flash sale service node intercepts and identifies the flash sale request data to be processed according to the reference second-level sub-hash table.

[0012] Optionally, the target blacklist types include all blacklist types in the first layer of the hash table; the first flash sale service node determines the reference first-level sub-hash table corresponding to the request data to be processed from the hash table according to the target blacklist type corresponding to the request data to be processed, including: the first flash sale service node traverses all blacklist types in the first layer of the hash table, and takes all first-level sub-hash tables corresponding to each blacklist type as the reference first-level sub-hash tables corresponding to the request data to be processed.

[0013] Optionally, the target blacklist type includes some blacklist types of the first layer of the hash table indicated by the configuration information; the first flash sale service node determines the reference first-level sub-hash table corresponding to the request data to be processed from the hash table according to the target blacklist type corresponding to the request data to be processed, including: the first flash sale service node takes all first-level sub-hash tables corresponding to some blacklist types indicated by the configuration information from all blacklist types in the first layer of the hash table as the reference first-level sub-hash tables corresponding to the request data to be processed.

[0014] Optionally, the first flash sale service node intercepts and identifies the flash sale request data to be processed according to the reference secondary sub-hash table, including: the first flash sale service node intercepts the flash sale request data to be processed based on the fact that the key of the reference secondary sub-hash table includes the requesting user account and the blacklist expiration time has not been reached at the current moment; the first flash sale service node accepts the flash sale request data to be processed based on the fact that the key of the reference secondary sub-hash table includes the requesting user account and the blacklist expiration time has exceeded the current moment, or the key of the reference secondary sub-hash table does not include the requesting user account.

[0015] Optionally, the method also includes: the first flash sale service node obtains multiple blacklist data in full from the blacklist database; each blacklist data includes a user account and a blacklist expiration time corresponding to the user account; the first flash sale service node stores all or part of the multiple blacklist data in a hash table.

[0016] Optionally, the first second kill service node stores all or part of the multiple blacklist data in a hash table, including: the first second kill service node calculates the first hash value of each blacklist data, and modulo N on the first hash value to obtain the target number corresponding to each blacklist data; when the target number is the same as the natural number corresponding to the first second kill service node, the first second kill service node stores the blacklist data corresponding to the target number in the hash table; when the target number is different from the natural number corresponding to the first second kill service node, the first second kill service node discards the blacklist data corresponding to the target number.

[0017] Optionally, each blacklist data also includes a blacklist type corresponding to the user account; the first second kill service node stores the blacklist data corresponding to the target number in a hash table, including: the first second kill service node determines the target first-level sub-hash table corresponding to the blacklist data according to the blacklist type corresponding to the user account in the blacklist data; the first second kill service node calculates the second hash value of the user account in the blacklist data, and modulo M on the second hash value to obtain the target partition number corresponding to the blacklist data; M is the upper limit of the number of partition numbers in the first sub-hash table; the first second kill service node determines the target second-level sub-hash table corresponding to the blacklist data in the target first-level sub-hash table corresponding to the blacklist data according to the target partition number corresponding to the blacklist data; the first second kill service node uses the user account in the blacklist data as the key in the corresponding target second-level sub-hash table, and uses the blacklist expiration time in the blacklist data as the value in the corresponding target second-level sub-hash table, and stores them in the hash table.

[0018] Optionally, the method also includes: the first flash sale service node obtains updated blacklist data from the real-time data processing platform; the updated blacklist data includes a user account and a blacklist expiration time corresponding to the user account; the first flash sale service node stores all or part of the incremental updated blacklist data in a hash table.

[0019] Optionally, the first second kill service node stores all or part of the incremental updated blacklist data in a hash table, including: the first second kill service node calculates the first hash value of the updated blacklist data, and takes the first hash value modulo N to obtain a target number corresponding to the updated blacklist data; when the target number is the same as the natural number corresponding to the first second kill service node, the first second kill service node stores the incremental updated blacklist data corresponding to the target number in the hash table; when the target number is different from the natural number corresponding to the first second kill service node, the first second kill service node discards the updated blacklist data corresponding to the target number.

[0020] Optionally, the updated blacklist data also includes the blacklist type corresponding to the user account; the first second kill service node incrementally stores the updated blacklist data corresponding to the target number in the hash table, including: the first second kill service node determines the target first-level sub-hash table corresponding to the updated blacklist data according to the blacklist type corresponding to the user account in the updated blacklist data; the first second kill service node calculates the second hash value of the user account in the updated blacklist data, and modulo M on the second hash value to obtain the target partition number corresponding to the updated blacklist data; M is the upper limit of the number of partition numbers in the first sub-hash table; the first second kill service node determines the target second-level sub-hash table corresponding to the updated blacklist data in the target first-level sub-hash table corresponding to the updated blacklist data according to the target partition number corresponding to the updated blacklist data; the first second kill service node uses the user account in the updated blacklist data as the key in the corresponding target second-level sub-hash table, and uses the blacklist expiration time in the updated blacklist data as the value in the corresponding target second-level sub-hash table, and incrementally stores them in the hash table.

[0021] Optionally, the method further includes: when the target number is different from the natural number corresponding to the first flash sale service node, the first flash sale service node discards the to-be-processed flash sale request data.

[0022] Optionally, the flash sale request data to be processed is the initial flash sale request data whose corresponding reference number is the same as the natural number corresponding to the first flash sale service node among the multiple initial flash sale request data obtained by the balancing server; the reference number corresponding to the initial flash sale request data is obtained by calculating the first hash value of the user account in each initial flash sale request data by the balancing server, and taking the modulus of N on the first hash value.

[0023] In a second aspect, the present application provides a data processing device, which includes various functional modules used for the method described in the first aspect above.

[0024] In a third aspect, the present application provides a computer program product, including: computer instructions; when the computer instructions are executed on an electronic device, the electronic device implements the method described in the first aspect above.

[0025] In a fourth aspect, the present application provides an electronic device, comprising: a processor and a memory; the memory stores instructions executable by the processor; when the processor is configured to execute the instructions, the electronic device implements the method described in the first aspect above.

[0026] In a fifth aspect, the present application provides a readable storage medium, which includes: software instructions; when the software instructions are executed in an electronic device, the electronic device implements the method described in the first aspect above.

[0027] The beneficial effects of the second to fifth aspects mentioned above can be referred to the first aspect and will not be elaborated on again. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0029] Figure 1 A schematic diagram of the composition of a data processing system provided in an embodiment of the present application;

[0030] Figure 2 A flowchart of a data processing method provided in an embodiment of the present application;

[0031] Figure 3 Another flowchart of the data processing method provided in the embodiment of the present application;

[0032] Figure 4 A schematic diagram of the structure of a hash table provided in an embodiment of the present application;

[0033] Figure 5 A schematic diagram of another flow chart of the data processing method provided in the embodiment of the present application;

[0034] Figure 6 A schematic diagram of another flow chart of the data processing method provided in the embodiment of the present application;

[0035] Figure 7 A schematic diagram of another flow chart of the data processing method provided in the embodiment of the present application;

[0036] Figure 8 A schematic diagram of a process for storing all blacklist data provided in an embodiment of the present application;

[0037] Fig. 9 A schematic diagram of a process for incrementally updating blacklist data provided in an embodiment of the present application;

[0038] Fig.10 A schematic diagram of the composition of a data processing device provided in an embodiment of the present application;

[0039] Fig.11 A schematic diagram of the composition of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0040] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0041] It should be noted that, in the embodiments of the present application, words such as "exemplarily" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplarily" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplarily" or "for example" is intended to present related concepts in a specific way.

[0042] In order to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, the words "first", "second", etc. are used to distinguish the same items or similar items with basically the same functions and effects. Those skilled in the art can understand that the words "first", "second", etc. are not limiting the quantity and execution order.

[0043] For scenarios with large traffic volumes of business requests, relevant technologies can be used to handle them through methods such as current limiting and delay processing.

[0044] Among them, current limiting can also be understood as a fixed upper limit for traffic distribution. For example, an application software distribution system with an activatable Remote Method Invoke (RMI) framework can be designed based on the prototype system. This system can realize active software distribution under the browser / server (Browser / Server, B / S).

[0045] Delayed processing means that when the system pressure is too high, the distribution of traffic to the downstream system is suspended, and the request data is stored separately in a storage space. After the downstream system recovers its processing capacity, distribution and processing will continue.

[0046] However, if the scenario is one with high traffic volume, high timeliness requirements, and accurate processing results, the relevant technology will be insufficient. For example, in the case of flash sales, flow control will reduce data traffic, resulting in some users being unable to participate in the flash sales, while delayed processing will reduce timeliness and reduce the fairness and randomness of the flash sales.

[0047] Based on this, the embodiments of the present application provide a data processing method, an electronic device and a computer program product, which can return the corresponding processing results in real time at one time when there is a large traffic request without reducing the data traffic, thereby ensuring the timeliness and accuracy of data processing.

[0048] The following is an introduction with reference to the accompanying drawings.

[0049] Figure 1 The following is a schematic diagram of the composition of the data processing system provided in the embodiment of the present application. Figure 1 As shown, the system includes: a balancing server 100 and a flash sale service node 200. The balancing server 100 and the flash sale service node 200 are in communication connection.

[0050] The balancing server 100 may be an electronic device having a computing function, such as a server or a computer.

[0051] Among them, the server can be a single server, or it can be a server cluster composed of multiple servers. In some implementations, the server cluster can also be a distributed cluster. Optionally, the server can also be implemented on a cloud platform, for example, the cloud platform can include a private cloud, a public cloud, a hybrid cloud, a community cloud, a distributed cloud, an inter-cloud, and a multi-cloud, etc., or any combination thereof. The embodiments of the present application are not limited to this.

[0052] For example, the balancing server 100 may be specifically implemented as an Nginx server.

[0053] The balancing server 100 can obtain the flash sale request data ( Figure 1 The external request is used as an example), and the flash sale request data is distributed to the flash sale service node 200. The specific process can be referred to in the data processing method provided in the following method embodiment, which will not be repeated here.

[0054] The flash sale service node 200 may include N (N is a positive integer) flash sale service nodes ( Figure 1 In the figure, five flash sale service nodes, namely, node 1, node 2, node 3, node 5, and node 5, are used as an example. Each flash sale service node corresponds to a natural number.

[0055] The flash sale service node 200 may also be a computer or server or other electronic device with computing and processing functions. For details, please refer to the above-mentioned balancing server 100, which will not be described here.

[0056] For example, the flash sale service node 200 may specifically be a node in a Kubernetes cluster created by a container Kubernetes engine (CKE). When the program is started, the node in the Kubernetes cluster may obtain the host name and obtain the natural number of the current host.

[0057] The flash sale service node 200 can receive the flash sale request data distributed by the balancing server 100 and process the flash sale request data. The specific process can be referred to in the data processing method provided in the following method embodiment, which will not be described in detail here.

[0058] In some embodiments, the data processing system may further include a blacklist database 300 .

[0059] The specific form of the blacklist database 300 can refer to the description of the above-mentioned balancing server 100, which will not be repeated here.

[0060] The blacklist database 300 may store multiple blacklist data. The flash sale service node 200 may fully load data from the blacklist database 300 (or obtain all blacklist data) and select to store.

[0061] For example, the blacklist database 300 may be specifically implemented as an HBASE table.

[0062] In some embodiments, the data processing system may further include a real-time data processing platform 400 .

[0063] The specific form of the real-time data processing platform 400 can refer to the description of the above-mentioned balancing server 100, which will not be repeated here.

[0064] The real-time data processing platform 400 can obtain and update the blacklist data, and the flash sale service node 200 can incrementally load data from the real-time data processing platform 400 (or incrementally obtain and update the blacklist data).

[0065] For example, the real-time data processing platform 400 can be specifically implemented as KAFKA, which can obtain updated blacklist data and store the updated blacklist data in a topic. The flash sale service node 200 can monitor the topic, pull unconsumed updated blacklist data from the topic, and store it incrementally.

[0066] The execution subject of the data processing method provided in the embodiment of the present application is a data processing device. The data processing device can be any one of the above-mentioned second kill service nodes 200. As mentioned above, the second kill service node can be an electronic device with computing and processing functions such as a server or a computer. Optionally, the data processing device can also be a processor in the aforementioned electronic device; or, the data processing device can also be an application (application, APP) with data processing functions installed in the aforementioned electronic device; or, the data processing device can also be a software system or platform deployed in the aforementioned electronic device; or, the data processing device can also be a software module for executing the data processing method in the aforementioned electronic device, etc. The embodiment of the present application does not limit this.

[0067] For the sake of simplicity, the data processing method provided in the embodiment of the present application is introduced below by taking any first flash sale service node in the flash sale service node 200 as an example.

[0068] Figure 2 The following is a flow chart of a data processing method provided in an embodiment of the present application. Figure 2 As shown, the method includes the following steps:

[0069] S101. A first flash sale service node receives flash sale request data to be processed from a balancing server.

[0070] The pending flash sale request data includes the requesting user account of the flash sale. For example, the requesting user account may be a mobile phone number.

[0071] In some embodiments, the flash sale request data to be processed is the initial flash sale request data whose corresponding reference number is the same as the natural number corresponding to the first flash sale service node among the multiple initial flash sale request data obtained by the balancing server; the reference number corresponding to the initial flash sale request data is obtained by the balancing server calculating the first hash value of the user account in each initial flash sale request data and taking the first hash value modulo N. The specific distribution process of the flash sale request data to be processed can refer to the data processing method with the balancing service as the execution subject described below, and will not be repeated here.

[0072] S102: The first flash sale service node calculates a first hash value of the requesting user account, and performs a modulo operation on the first hash value using N to obtain a target number corresponding to the flash sale request data to be processed.

[0073] For example, the first hash value may be an MD5 value, a SHA-256 value, or a SHA-512 value of the requesting user account, etc. The embodiment of the present application does not limit the hash algorithm specifically used for the first hash value.

[0074] S103: When the target number is the same as the natural number corresponding to the first flash sale service node, the first flash sale service node processes the flash sale request data to be processed.

[0075] For example, when the target number is the same as the natural number corresponding to the first flash sale service node, the first flash sale service node can process the flash sale request data for order placement or blacklist interception identification, etc. The embodiment of the present application does not limit the specific processing type of the first flash sale service node.

[0076] In some embodiments, when the target number is different from the natural number corresponding to the first flash sale service node, the first flash sale service node may discard the pending flash sale request data.

[0077] It should be noted that the above data processing method provided by the embodiment of the present application is introduced by taking any first flash sale service node among the N flash sale service nodes as an example. Other flash sale service nodes among the N flash sale service nodes can also perform data processing in the above manner. The embodiment of the present application does not limit this.

[0078] It should be understood that the current limiting scheme in the related art will reduce data traffic, resulting in some users being unable to participate in the flash sale, while the delayed processing scheme has low timeliness, which will reduce the fairness and randomness of the flash sale activity. In the data processing method provided in the embodiment of the present application, any of the N flash sale service nodes can calculate the first hash value of the user account, and take the modulus of the first hash value by N, so as to distribute the flash sale request data of different user accounts to different flash sale service nodes for parallel processing, so that the corresponding processing results can be returned in real time at one time without reducing the data traffic, thereby ensuring the timeliness and accuracy of data processing.

[0079] In some possible embodiments, as described above, the first flash sale service node may perform blacklist interception identification processing. In this case, Figure 3 Another flow chart of the data processing method provided in the embodiment of the present application is as follows: Figure 3 As shown, the above S103 may specifically include the following steps:

[0080] S1031. The first flash sale service node intercepts and identifies the flash sale request data to be processed based on the blacklist data in the pre-established hash table.

[0081] For example, Figure 4 A schematic diagram of the structure of a hash table provided in an embodiment of the present application. Figure 4 As shown, the hash table includes three layers, and the key of the first layer of the hash table is the blacklist type ( Figure 4 In the figure, blacklist type 1 and blacklist type 2 are used as examples), the value of the first layer is the first-level sub-hash table; the second layer of the hash table is the first-level sub-hash table; the key of the first-level sub-hash table is the partition number, and the value of the first-level sub-hash table is the second-level sub-hash table; the third layer of the hash table is the second-level sub-hash table; the key of the second-level sub-hash table is the user account, and the value of the second-level sub-hash table is the blacklist expiration time.

[0082] As an example, a hash table can be implemented as ConcurrentHashMap. In Java, HashMap and ConcurrentHashMap are both implementations of the Map interface based on hash tables, but their behaviors when dealing with concurrent access are significantly different. In high-concurrency scenarios, choosing to use ConcurrentHashMap instead of HashMap is mainly based on the following reasons:

[0083] Reason 1: Thread safety: HashMap is not thread-safe. In a multi-threaded environment, modifying HashMap simultaneously without external synchronization may cause data inconsistency and runtime exceptions (such as ConcurrentModificationException, although this is usually related to iterators, concurrent modifications may still cause other problems). ConcurrentHashMap is designed for concurrent environments. It ensures thread safety in a multi-threaded environment through internal synchronization mechanisms (such as segment locks, CAS operations, etc., depending on the implementation version) while maintaining high concurrent performance.

[0084] Reason 2: Performance optimization: HashMap has excellent performance in a single-threaded environment, but requires external synchronization to ensure thread safety in a multi-threaded environment, which usually significantly reduces performance because external synchronization blocks other threads. ConcurrentHashMap optimizes concurrent performance through its internal design (such as lock segmentation, lock-free algorithm, etc.), so that it can still maintain high throughput and low latency in a multi-threaded environment.

[0085] Reason 3, Lock strategy: ConcurrentHashMap uses different lock strategies in different versions of Java. For example, in Java 8 and later versions, it uses segmented locks (in Java 8, it is actually a finer-grained lock strategy implemented through CAS and synchronized blocks) and data structures such as red-black trees to optimize performance. This design reduces lock competition and improves concurrency. HashMap does not have such an internal lock strategy and relies entirely on external synchronization to ensure thread safety.

[0086] Reason 4: Scalability and adaptability: ConcurrentHashMap is designed to dynamically adapt to different concurrency levels and optimize performance by dynamically adjusting its internal structure (such as capacity expansion, rehashing, etc.). The scalability of HashMap mainly depends on the settings of its initial capacity and load factor, but these settings are not sufficient for concurrent environments.

[0087] Reason 5, API and ease of use: ConcurrentHashMap provides an API similar to HashMap, making it easy for developers to use it as a thread-safe Map implementation without worrying about additional synchronization code. When using HashMap, developers must handle concurrency issues themselves, which usually means more complex code and more opportunities for errors.

[0088] In a possible implementation, the above S1031 may specifically include the following steps:

[0089] Step 1a: The first flash sale service node determines a reference first-level sub-hash table corresponding to the request data to be processed from the hash table according to the target blacklist type corresponding to the request data to be processed.

[0090] Optionally, the target blacklist types corresponding to the request data to be processed may include all blacklist types in the first layer of the hash table. In this case, the above step 1a may specifically include:

[0091] Step 1.1a: The first flash sale service node traverses all blacklist types in the first layer of the hash table, and uses all first-level sub-hash tables corresponding to each blacklist type as reference first-level sub-hash tables corresponding to the request data to be processed.

[0092] For example, the blacklist types in the first layer of the hash table can be divided according to the types of malicious behaviors. Each type of malicious behavior can correspond to multiple partitions (first-level sub-hash tables). When the first flash sale service node intercepts and identifies the flash sale request data to be processed, it can traverse the partition corresponding to each malicious behavior and intercept and identify the flash sale request data to be processed according to the blacklist data stored in the partition corresponding to each malicious behavior.

[0093] As an example, the blacklist types in the first layer of the hash table may include: a blacklist of those who have conducted fake order behavior, a blacklist of those who used automated scripts for flash sales, a blacklist of malicious refunds, and a blacklist of account sharing behavior (multiple users share one account for flash sales).

[0094] Optionally, the target blacklist type corresponding to the request data to be processed may also include some blacklist types of the first layer of the hash table indicated by the configuration information. In this case, the above step 1a may specifically include:

[0095] Step 1.2a: The first flash sale service node selects all first-level sub-hash tables corresponding to some blacklist types indicated by the configuration information from all blacklist types in the first layer of the hash table as reference first-level sub-hash tables corresponding to the request data to be processed.

[0096] For example, the blacklist types at the first layer of the hash table can be divided according to the risk level, and each blacklist level can correspond to multiple partitions (first-level sub-hash tables). The balancing server or other control device can send configuration information to the first flash sale service node to indicate the blacklist types corresponding to the specific enabled risk levels. When the first flash sale service node intercepts and identifies the flash sale request data to be processed, it can intercept and identify the flash sale request data to be processed from the blacklist data stored in the partition corresponding to the blacklist type corresponding to the risk level enabled indicated by the configuration information.

[0097] As an example, the blacklist types at the first level of the hash table may include: a high-risk blacklist, a medium-risk blacklist, and a low-risk blacklist.

[0098] For example, the risk level of the blacklist can be specifically divided according to the number or frequency of malicious behaviors performed by the user account, or other rules. The embodiment of the present application does not limit the specific classification rules of the risk level.

[0099] Step 2a: The first flash sale service node obtains the second hash value of the requesting user account, and performs modulo M on the second hash value to obtain a reference partition number.

[0100] The second hash value may be the same as or different from the first hash value. The embodiment of the present application does not limit the specific hash algorithm used for the second hash value. M is the upper limit of the number of partition numbers in the first-level sub-hash table. For example, M can be 10.

[0101] Step 3a: The first flash sale service node determines the reference second-level sub-hash table corresponding to the request data to be processed from the reference first-level sub-hash table according to the reference partition number.

[0102] For example, the first flash sale service node may use the reference partition number as the key of the first-level sub-hash table, and determine the value corresponding to the key from the first-level sub-hash table as the reference second-level sub-hash table.

[0103] Step 4a: The first flash sale service node intercepts and identifies the flash sale request data to be processed according to the reference secondary sub-hash table.

[0104] In a possible implementation, the above step 4a may specifically include the following steps:

[0105] Step 4.1a: The first flash sale service node intercepts the flash sale request data to be processed based on the key of the reference secondary sub-hash table including the requesting user account and the current time not reaching the blacklist expiration time.

[0106] Step 4.2a: The first flash sale service node accepts the pending flash sale request data based on the fact that the key of the reference secondary sub-hash table includes the requesting user account and the current time exceeds the blacklist expiration time, or the key of the reference secondary sub-hash table does not include the requesting user account.

[0107] As an example, the first flash sale service node can use the requesting user account as the key, traverse and search the reference secondary sub-hash table, and determine whether the key is included in the reference secondary sub-hash table. If the key is included, it can further determine whether the blacklist expiration time in the value corresponding to the key is reached at the current moment.

[0108] In the data processing method provided in the embodiment of the present application, the first flash sale service node can also intercept and identify the flash sale request data to be processed based on the blacklist data in the pre-established hash table, and the hash table is divided into three layers, the first layer is the blacklist type, the second layer is the partition corresponding to each blacklist type, and the third layer is the blacklist user account and blacklist expiration time stored in each partition. The first flash sale service node can locate and intercept and identify the blacklist user account more quickly by partitioning and storing the blacklist user account. In the flash sale activity, the flash sale service node needs to process a large number of concurrent requests. If the blacklist user account is not effectively partitioned, the flash sale service node may need to spend more time and resources to retrieve and process these requests. Partitioned storage can significantly improve the processing efficiency of the flash sale service node and ensure the smooth progress of the flash sale activity.

[0109] In some possible embodiments, before intercepting and identifying the flash sale request data to be processed, the first flash sale service node may also obtain all the blacklist data. Figure 5 Another flow chart of the data processing method provided in the embodiment of the present application. Figure 5 As shown, before the above S101, the method may further include the following steps:

[0110] S201. The first flash sale service node obtains all blacklist data from the blacklist database.

[0111] Each blacklist data includes a user account and the blacklist expiration time corresponding to the user account.

[0112] S202: The first flash sale service node stores all or part of the plurality of blacklist data in a hash table.

[0113] In a possible implementation, the first flash sale service node can calculate the number of the flash sale service node according to the blacklist data, and only store the blacklist data in the hash table when the calculated number is consistent with the natural number of the first flash sale service node. In this case, the above S202 can specifically include the following steps:

[0114] Step 1b: The first flash sale service node calculates the first hash value of each blacklist data, and modulosizes the first hash value with N to obtain the target number corresponding to each blacklist data.

[0115] Step 2b: When the target number is the same as the natural number corresponding to the first flash sale service node, the first flash sale service node stores the blacklist data corresponding to the target number in a hash table.

[0116] Optionally, as described above, the hash table may be divided into different blacklist types, each blacklist type corresponding to multiple partitions. In this case, each blacklist data may also include the blacklist type corresponding to the user account, and the above step 2b may specifically include the following steps:

[0117] Step 2.1b: The first flash sale service node determines the target first-level sub-hash table corresponding to the blacklist data according to the blacklist type corresponding to the user account in the blacklist data.

[0118] Step 2.2b: The first flash sale service node calculates the second hash value of the user account in the blacklist data, and modulosizes the second hash value with M to obtain the target partition number corresponding to the blacklist data.

[0119] Wherein, M is the upper limit of the number of partition numbers in the first sub-hash table.

[0120] Step 2.3b: The first flash sale service node determines the target second-level sub-hash table corresponding to the blacklist data in the target first-level sub-hash table corresponding to the blacklist data according to the target partition number corresponding to the blacklist data.

[0121] Step 2.4b: The first flash sale service node uses the user account in the blacklist data as the key in the corresponding target secondary sub-hash table, and uses the blacklist expiration time in the blacklist data as the value in the corresponding target secondary sub-hash table, and stores them in the hash table.

[0122] Optionally, when the key of the target first-level sub-hash table does not include the target partition number corresponding to the blacklist data, the first flash sale service node can create a new partition corresponding to the target partition number in the target first-level sub-hash table, and then store the blacklist data in the newly created partition.

[0123] For example, the first flash sale service node can create a key-value pair in the target first-level sub-hash table with the target partition number as the key and the second-level sub-hash table corresponding to the key as the value, establish a new partition, and then use the user account in the blacklist data as the key of the newly created second-level sub-hash table, and the blacklist expiration time corresponding to the user account as the value of the newly created second-level sub-hash table, so as to store the blacklist data in the newly created partition.

[0124] Step 3b: When the target number is different from the natural number corresponding to the first flash sale service node, the first flash sale service node discards the blacklist data corresponding to the target number.

[0125] In some possible embodiments, the first flash sale service node may also incrementally obtain updated blacklist data from the real-time data processing platform. In this case, Figure 6 Another flow chart of the data processing method provided in the embodiment of the present application. Figure 6 As shown, before S101 (or after S202, Figure 6 (The method is shown in the example before S101) and may further include the following steps:

[0126] S301. The first flash sale service node obtains updated blacklist data from the real-time data processing platform.

[0127] The updated blacklist data includes a user account and a blacklist expiration time corresponding to the user account.

[0128] For example, as described above, the real-time data processing platform (real-time data processing platform 400) can be specifically implemented as KAFKA, and KAFKA can obtain updated blacklist data and store the updated blacklist data in a topic. In this case, the first flash sale service node can monitor the topic and pull the unconsumed updated blacklist data from the topic.

[0129] S302: The first flash sale service node stores all or part of the incremental updated blacklist data in a hash table.

[0130] In a possible implementation, the first flash sale service node can calculate the serial number of the flash sale service node according to the updated blacklist data, and only when the calculated serial number is consistent with the natural number of the first flash sale service node, the updated blacklist data can be stored in the hash table. In this case, the above S302 can specifically include the following steps:

[0131] Step 1c: The first flash sale service node calculates the first hash value of the updated blacklist data, and modulosizes the first hash value with N to obtain the target number corresponding to the updated blacklist data.

[0132] Step 2c: When the target number is the same as the natural number corresponding to the first flash sale service node, the first flash sale service node stores the updated blacklist data corresponding to the target number in the hash table.

[0133] Optionally, as described above, the hash table may be divided into different blacklist types, each blacklist type corresponding to multiple partitions. In this case, updating the blacklist data may also include the blacklist type corresponding to the user account, and the above step 2c may specifically include the following steps:

[0134] Step 2.1c: The first flash sale service node determines the target first-level sub-hash table corresponding to the updated blacklist data according to the blacklist type corresponding to the user account in the updated blacklist data.

[0135] Step 2.2c: The first flash sale service node calculates the second hash value of the user account in the updated blacklist data, and modulosizes the second hash value with M to obtain the target partition number corresponding to the updated blacklist data.

[0136] Where M is the upper limit of the number of partition numbers in the first sub-hash table;

[0137] Step 2.3c: The first flash sale service node determines the target second-level sub-hash table corresponding to the updated blacklist data in the target first-level sub-hash table corresponding to the updated blacklist data according to the target partition number corresponding to the updated blacklist data.

[0138] Step 2.4c, the first flash sale service node uses the user account in the updated blacklist data as the key in the corresponding target secondary sub-hash table, uses the blacklist expiration time in the updated blacklist data as the value in the corresponding target secondary sub-hash table, and stores the increments in the hash table.

[0139] Optionally, when the key of the target first-level sub-hash table does not include the target partition number corresponding to the updated blacklist data, the first flash sale service node can create a new partition corresponding to the target partition number in the target first-level sub-hash table, and then store the updated blacklist data in the newly created partition.

[0140] For example, the first flash sale service node can create a key-value pair in the target first-level sub-hash table with the target partition number as the key and the second-level sub-hash table corresponding to the key as the value to establish a new partition, and then use the user account in the updated blacklist data as the key of the newly created second-level sub-hash table, and the blacklist expiration time corresponding to the user account as the value of the newly created second-level sub-hash table, thereby storing the updated blacklist data in the newly created partition.

[0141] Step 3c: When the target number is different from the natural number corresponding to the first flash sale service node, the first flash sale service node discards the updated blacklist data corresponding to the target number.

[0142] The above introduces the data processing method provided in the embodiment of the present application by taking any first flash sale service node among N flash sale service nodes as an example. In an exemplary embodiment, the embodiment of the present application also provides a data processing method, which can be applied to a balancing server (such as the above-mentioned balancing server 100). Figure 7 Another flow chart of the data processing method provided in the embodiment of the present application. Figure 7 As shown, the method may include the following steps:

[0143] S401. The balancing server obtains flash sale request data.

[0144] The flash sale request data may include a requesting user account for the flash sale.

[0145] S402. The balancing server calculates a first hash value of the requesting user account, and modulosizes the first hash value with N to obtain a reference number corresponding to the flash sale request data.

[0146] S403: The balancing server sends the flash sale request data to a flash sale service node that processes the flash sale request data according to the reference number corresponding to the flash sale request data and a preset corresponding relationship.

[0147] The preset corresponding relationship can be used to represent the corresponding relationship between the natural number of the flash sale service node and the address information of the flash sale service node. For example, the address information can be specifically implemented as the Internet protocol (IP) address of the flash sale service node.

[0148] Optionally, the balancing server can use the reference number corresponding to the flash sale request data as an index, traverse and search the preset corresponding relationship, use the address information corresponding to the reference number in the preset corresponding relationship as the address information of the flash sale service node that processes the flash sale request data, and send the flash sale request data to the address information.

[0149] Exemplarily, the preset corresponding relationship may be specifically shown in the following Table 1:

[0150] Table 1

[0151]

[0152]

[0153] As shown in Table 1, the table may include natural number items and address information items. The natural number items include number 1, number 2, and number 3. The address information items include address 1, address 2, and address 3. There is a corresponding relationship between number 1 and address 1, there is a corresponding relationship between number 2 and address 2, and there is a corresponding relationship between number 3 and address 3.

[0154] Exemplarily, taking the preset correspondence shown in the above Table 1 as an example, assuming that the reference number calculated by the current balancing server for the flash sale request data 1 is number 1, then the balancing server can send the flash sale request data 1 to the corresponding address 1. In this case, the flash sale request data 1 can also be understood as the pending flash sale request data of the flash sale service node corresponding to address 1.

[0155] Based on the understanding of the above embodiments, Figure 8 A schematic diagram of the process of storing all blacklist data provided in the embodiment of the present application. Figure 8As shown, the flash sale service node can read the MySQL configuration. The configuration file describes which HBASE tables the program should load data from, as well as the fields and topics that need to be loaded. Then the flash sale service node can traverse the hbase blacklist, load the hbase data, obtain the data primary key (that is, the user account in the blacklist data), calculate the MD5 value of the primary key, and take the modulus to determine whether the modulus result is consistent with the number of the flash sale service node. If not, the data is discarded; if so, the data is loaded to the current flash sale service node, the hash value of the primary key is calculated, and the modulus is taken. According to the modulus result, the corresponding partition is determined to determine whether the partition exists. If so, the data is written; if not, a new partition is created and the data is written.

[0156] Based on the understanding of the above embodiments, Fig. 9 A schematic diagram of the process of incrementally updating blacklist data provided in an embodiment of the present application. Fig. 9 As shown, the flash sale service node can read the MySQL configuration, consume the corresponding topic data (that is, update the blacklist data mentioned above), obtain the data primary key (that is, update the user account in the blacklist data), calculate the MD5 value of the primary key, and take the modulus to determine whether the modulus result is consistent with the number of the flash sale service node. If not, discard the data; if so, load the data to the current flash sale service node, calculate the hash value of the primary key, and take the modulus, determine the corresponding partition according to the modulus result, and determine whether the partition exists. If so, write the data; if not, create a new partition and write the data.

[0157] The above mainly introduces the solution provided by the embodiment of the present application from the perspective of the method. In order to achieve the above functions, it includes hardware structures and / or software modules corresponding to the execution of each function. It should be easy to realize that the technical goals in this field are combined with the units and algorithm steps of each example described in the embodiments disclosed in this article, and the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical goals can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0158] In an exemplary embodiment, the present application also provides a data processing device, which can be applied to the above-mentioned first flash sale service node. Fig.10 The following is a schematic diagram of the composition of the data processing device provided in the embodiment of the present application. Fig.10 As shown, the data processing device may include: an acquisition module 1001 and a processing module 1002 .

[0159] The acquisition module 1001 is used to receive the pending flash sale request data from the balancing server; the pending flash sale request data includes the requesting user account of the flash sale. The processing module 1002 is used to calculate the first hash value of the requesting user account, and take the first hash value modulo N to obtain the target number corresponding to the pending flash sale request data; when the target number is the same as the natural number corresponding to the first flash sale service node, the first flash sale service node processes the pending flash sale request data.

[0160] In some possible embodiments, the processing module 1002 is specifically used to intercept and identify the flash sale request data to be processed based on the blacklist data in a pre-established hash table; wherein the hash table includes three layers, the key of the first layer of the hash table is the blacklist type, and the value of the first layer is the first-level sub-hash table; the second layer of the hash table is the first-level sub-hash table; the key of the first-level sub-hash table is the partition number, and the value of the first-level sub-hash table is the second-level sub-hash table; the third layer of the hash table is the second-level sub-hash table; the key of the second-level sub-hash table is the user account, and the value of the second-level sub-hash table is the blacklist expiration time.

[0161] In some other possible embodiments, the processing module 1002 is specifically used to determine, from the hash table, a reference first-level sub-hash table corresponding to the request data to be processed, according to the target blacklist type corresponding to the request data to be processed; obtain a second hash value of the requesting user account, and modulo M on the second hash value to obtain a reference partition number; M is the upper limit of the number of partition numbers in the first-level sub-hash table; determine, from the reference first-level sub-hash table, a reference second-level sub-hash table corresponding to the request data to be processed, according to the reference partition number; and intercept and identify the flash sale request data to be processed according to the reference second-level sub-hash table.

[0162] In some other possible embodiments, the target blacklist types include all blacklist types in the first layer of the hash table; the processing module 1002 is specifically used to traverse all blacklist types in the first layer of the hash table, and use all first-level sub-hash tables corresponding to each blacklist type as reference first-level sub-hash tables corresponding to the request data to be processed.

[0163] In some other possible embodiments, the target blacklist types include some blacklist types of the first layer of the hash table indicated by the configuration information; the processing module 1002 is specifically used to use all the first-level sub-hash tables corresponding to some of the blacklist types indicated by the configuration information from all the blacklist types of the first layer of the hash table as reference first-level sub-hash tables corresponding to the request data to be processed.

[0164] In some other possible embodiments, the processing module 1002 is specifically used to intercept the pending flash sale request data based on the fact that the key of the reference secondary sub-hash table includes the requesting user account and the blacklist expiration time has not been reached at the current moment; and accept the pending flash sale request data based on the fact that the key of the reference secondary sub-hash table includes the requesting user account and the blacklist expiration time has exceeded the current moment, or the key of the reference secondary sub-hash table does not include the requesting user account.

[0165] In some other possible embodiments, the acquisition module 1001 is also used to obtain multiple blacklist data in full from the blacklist database; each blacklist data includes a user account and a blacklist expiration time corresponding to the user account; the processing module 1002 is also used to store all or part of the multiple blacklist data in a hash table.

[0166] In some other possible embodiments, the processing module 1002 is specifically used to calculate the first hash value of each blacklist data, and take the modulus of N on the first hash value to obtain the target number corresponding to each blacklist data; when the target number is the same as the natural number corresponding to the first flash sale service node, the blacklist data corresponding to the target number is stored in the hash table; when the target number is different from the natural number corresponding to the first flash sale service node, the blacklist data corresponding to the target number is discarded.

[0167] In some other possible embodiments, each blacklist data also includes a blacklist type corresponding to the user account; the processing module 1002 is specifically used to determine the target first-level sub-hash table corresponding to the blacklist data according to the blacklist type corresponding to the user account in the blacklist data; calculate the second hash value of the user account in the blacklist data, and take the modulus of M on the second hash value to obtain the target partition number corresponding to the blacklist data; M is the upper limit of the number of partition numbers in the first sub-hash table; according to the target partition number corresponding to the blacklist data, determine the target second-level sub-hash table corresponding to the blacklist data in the target first-level sub-hash table corresponding to the blacklist data; use the user account in the blacklist data as the key in the corresponding target second-level sub-hash table, and use the blacklist expiration time in the blacklist data as the value in the corresponding target second-level sub-hash table, and store them in the hash table.

[0168] In some other possible embodiments, the acquisition module 1001 is also used to obtain updated blacklist data from the real-time data processing platform; the updated blacklist data includes a user account and a blacklist expiration time corresponding to the user account; the processing module 1002 is also used to store all or part of the incremental updated blacklist data into a hash table.

[0169] In some other possible embodiments, the processing module 1002 is specifically used to calculate the first hash value of the updated blacklist data, and take the modulus of N on the first hash value to obtain a target number corresponding to the updated blacklist data; when the target number is the same as the natural number corresponding to the first flash sale service node, the updated blacklist data corresponding to the target number is incrementally stored in the hash table; when the target number is different from the natural number corresponding to the first flash sale service node, the updated blacklist data corresponding to the target number is stored and discarded.

[0170] In some other possible embodiments, the updated blacklist data also includes the blacklist type corresponding to the user account; the processing module 1002 is specifically used to determine the target first-level sub-hash table corresponding to the updated blacklist data according to the blacklist type corresponding to the user account in the updated blacklist data; the second hash value of the user account in the updated blacklist data is calculated, and the second hash value is modulo M to obtain the target partition number corresponding to the updated blacklist data; M is the upper limit of the number of partition numbers in the first sub-hash table; according to the target partition number corresponding to the updated blacklist data, the target second-level sub-hash table corresponding to the updated blacklist data is determined in the target first-level sub-hash table corresponding to the updated blacklist data; the user account in the updated blacklist data is used as the key in the corresponding target second-level sub-hash table, and the blacklist expiration time in the updated blacklist data is used as the value in the corresponding target second-level sub-hash table, and is incrementally stored in the hash table.

[0171] In some other possible embodiments, the processing module 1002 is further configured to discard the pending flash sale request data when the target number is different from the natural number corresponding to the first flash sale service node.

[0172] In some other possible embodiments, the flash sale request data to be processed is the initial flash sale request data whose corresponding reference number is the same as the natural number corresponding to the first flash sale service node among the multiple initial flash sale request data obtained by the balancing server; the reference number corresponding to the initial flash sale request data is obtained by calculating the first hash value of the user account in each initial flash sale request data by the balancing server, and taking the modulus of N on the first hash value.

[0173] It should be noted that Fig.10 The division of modules in the example is schematic and is only a logical function division. There may be other division methods in actual implementation. For example, two or more functions may be integrated into one processing module. The above integrated modules may be implemented in the form of hardware or software function modules.

[0174] In an exemplary embodiment, as described above, the flash sale service node may be a computer or other electronic device with computing and processing functions. In this case, the embodiment of the present application further provides an electronic device, Fig.11 The following is a schematic diagram of the composition of the electronic device provided in the embodiment of the present application. Fig.11 As shown, the electronic device includes: a processor 10, a memory 20, a communication line 30, a communication interface 40, and an input-output interface 50. The processor 10, the memory 20, the communication interface 40, and the input-output interface 50 can be connected through the communication line 30.

[0175] The processor 10 is used to execute the instructions stored in the memory 20 to implement the data processing method provided in the above embodiments of the present application. The processor 10 can be a CPU, a general-purpose processor network processor (network processor, NP), a digital signal processor (digital signal processing, DSP), a microprocessor, a microcontroller (micro control unit, MCU) / single-chip microcomputer / single-chip microcomputer, a programmable logic device (programmable logic device, PLD) or any combination thereof. The processor 10 can also be any other device with processing functions, such as a circuit, a device or a software module, which is not limited in the embodiments of the present application. In one example, the processor 10 may include one or more CPUs, such as Fig.11 As an optional implementation, the electronic device may include multiple processors, for example, in addition to the processor 10, it may also include a processor 60 ( Fig.11 The dashed line is used as an example.

[0176] Memory 20 is used to store instructions. For example, the instruction can be a computer program. Optionally, the memory 20 can be a read-only memory (ROM) or other types of static storage devices that can store static information and / or instructions, or a random access memory (RAM) or other types of dynamic storage devices that can store information and / or instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a disk storage medium or other magnetic storage devices, etc., and the embodiments of the present application are not limited to this. It should be noted that the memory 20 can exist independently of the processor 10, or it can be integrated with the processor 10. The memory 20 can be located inside or outside the electronic device, and the embodiments of the present application are not limited to this.

[0177] The communication line 30 is used to transmit information between various components included in the electronic device.

[0178] The communication interface 40 is used to communicate with other devices or other communication networks. The other communication networks may be Ethernet, radio access network (RAN), wireless local area network (WLAN), etc. The communication interface 40 may be a module, a circuit, a transceiver or any device capable of achieving communication.

[0179] The input / output interface 50 is used to implement human-computer interaction between a user and an electronic device. For example, it implements action interaction or information interaction between a user and an electronic device. Exemplarily, the input / output interface 50 may be a mouse, a keyboard, a display screen, or a touch display screen. Action interaction or information interaction between a user and an electronic device may be implemented through a mouse, a keyboard, a display screen, or a touch display screen.

[0180] It should be noted that Fig.11 The structure shown in the figure does not constitute a limitation on the electronic device, except Fig.11 In addition to the components shown, the electronic device may include more or fewer components than shown, or a combination of certain components, or a different arrangement of components.

[0181] In an exemplary embodiment, the embodiment of the present application further provides a computer program product, which includes computer instructions. When the computer instructions are executed in an electronic device, the electronic device implements the method in the aforementioned method embodiment.

[0182] In an exemplary embodiment, the present application also provides a readable storage medium, which includes software instructions. When the software instructions are executed in an electronic device, the electronic device implements the method in the aforementioned method embodiment. The computer-readable storage medium can be a non-temporary computer-readable storage medium, for example, the non-temporary computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device.

[0183] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using a software program, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer-executable instructions. When loading and executing computer-executable instructions on a computer, a process or function according to an embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer-executable instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer-executable instructions can be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center.

[0184] Although the present application is described herein in conjunction with various embodiments, in the process of implementing the claimed application, those skilled in the art may understand and implement other changes to the disclosed embodiments by viewing the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other components or steps, and "one" or "an" does not exclude multiple situations. A single processor or other unit can implement several functions listed in the claims. Certain measures are recorded in different dependent claims, but this does not mean that these measures cannot be combined to produce good results.

[0185] Although the present application has been described in conjunction with specific features and embodiments thereof, it is obvious that various modifications and combinations may be made thereto without departing from the spirit and scope of the present application. Accordingly, this specification and the drawings are merely exemplary illustrations of the present application as defined by the appended claims, and are deemed to have covered any and all modifications, variations, combinations or equivalents within the scope of the present application. Obviously, those skilled in the art may make various modifications and variations to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

[0186] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A data processing method, characterized in that: The method is applied to any first flash sale service node among N flash sale service nodes; each of the N flash sale service nodes corresponds to a natural number; the N flash sale service nodes are in communication connection with a balancing server; N is a positive integer; the method comprises: The first flash sale service node receives the flash sale request data to be processed from the balancing server; the flash sale request data to be processed includes a requesting user account for requesting the flash sale; The first flash sale service node calculates a first hash value of the requesting user account, and performs a modulo operation on the first hash value using N to obtain a target number corresponding to the flash sale request data to be processed; When the target number is the same as the natural number corresponding to the first flash sale service node, the first flash sale service node processes the to-be-processed flash sale request data.

2. The method according to claim 1, characterized in that The first flash sale service node processes the flash sale request data to be processed, including: The first flash sale service node intercepts and identifies the flash sale request data to be processed based on the blacklist data in the pre-established hash table; Among them, the hash table includes three layers, the key of the first layer of the hash table is the blacklist type, and the value of the first layer is the first-level sub-hash table; the second layer of the hash table is the first-level sub-hash table; the key of the first-level sub-hash table is the partition number, and the value of the first-level sub-hash table is the second-level sub-hash table; the third layer of the hash table is the second-level sub-hash table; the key of the second-level sub-hash table is the user account, and the value of the second-level sub-hash table is the blacklist expiration time.

3. The method according to claim 2, characterized in that The first flash sale service node intercepts and identifies the flash sale request data to be processed based on the blacklist data in the pre-established hash table, including: The first flash sale service node determines, from the hash table, a reference first-level sub-hash table corresponding to the request data to be processed according to the target blacklist type corresponding to the request data to be processed; The first flash sale service node obtains the second hash value of the requesting user account, and performs a modulus operation on the second hash value by M to obtain a reference partition number; M is an upper limit on the number of partition numbers in the first-level sub-hash table; The first flash sale service node determines, according to the reference partition number, a reference second-level sub-hash table corresponding to the request data to be processed from the reference first-level sub-hash table; The first flash sale service node intercepts and identifies the to-be-processed flash sale request data according to the reference secondary sub-hash table.

4. The method according to claim 3, characterized in that: The target blacklist type includes all blacklist types in the first layer of the hash table; the first flash sale service node determines, from the hash table according to the target blacklist type corresponding to the request data to be processed, a reference first-level sub-hash table corresponding to the request data to be processed, including: The first flash sale service node traverses all blacklist types in the first layer of the hash table, and uses all first-level sub-hash tables corresponding to each blacklist type as reference first-level sub-hash tables corresponding to the request data to be processed.

5. The method according to claim 3, characterized in that: The target blacklist types include some blacklist types of the first layer of the hash table indicated by the configuration information; The first flash sale service node determines, from the hash table, a reference first-level sub-hash table corresponding to the request data to be processed according to the target blacklist type corresponding to the request data to be processed, including: The first flash sale service node uses all first-level sub-hash tables corresponding to some blacklist types indicated by the configuration information from all blacklist types in the first layer of the hash table as reference first-level sub-hash tables corresponding to the request data to be processed.

6. The method according to claim 3, characterized in that The first flash sale service node intercepts and identifies the flash sale request data to be processed according to the reference secondary sub-hash table, including: The first flash sale service node intercepts the to-be-processed flash sale request data based on the key of the reference secondary sub-hash table including the requesting user account and the current moment not reaching the blacklist expiration time; The first flash sale service node accepts the pending flash sale request data based on the fact that the key of the reference secondary sub-hash table includes the requesting user account and the current time exceeds the blacklist expiration time, or the key of the reference secondary sub-hash table does not include the requesting user account.

7. The method according to claim 2, characterized in that: The method further comprises: The first flash sale service node obtains a plurality of blacklist data in full from the blacklist database; each blacklist data includes a user account and a blacklist expiration time corresponding to the user account; The first flash sale service node stores all or part of the plurality of blacklist data in the hash table.

8. The method according to claim 7, characterized in that The first flash sale service node stores all or part of the plurality of blacklist data in the hash table, including: The first flash sale service node calculates a first hash value of each piece of blacklist data, and modulosizes the first hash value with N to obtain a target number corresponding to each piece of blacklist data; When the target number is the same as the natural number corresponding to the first flash sale service node, the first flash sale service node stores the blacklist data corresponding to the target number in the hash table; When the target number is different from the natural number corresponding to the first flash sale service node, the first flash sale service node discards the blacklist data corresponding to the target number.

9. The method according to claim 8, characterized in that Each blacklist data also includes the blacklist type corresponding to the user account; The first flash sale service node stores the blacklist data corresponding to the target number in the hash table, including: The first flash sale service node determines a target first-level sub-hash table corresponding to the blacklist data according to the blacklist type corresponding to the user account in the blacklist data; The first flash sale service node calculates the second hash value of the user account in the blacklist data, and modulosizes the second hash value with M to obtain the target partition number corresponding to the blacklist data; M is the upper limit of the number of partition numbers in the first sub-hash table; The first flash sale service node determines, according to the target partition number corresponding to the blacklist data, a target second-level sub-hash table corresponding to the blacklist data in the target first-level sub-hash table corresponding to the blacklist data; The first flash sale service node uses the user account in the blacklist data as the key in the corresponding target secondary sub-hash table, and uses the blacklist expiration time in the blacklist data as the value in the corresponding target secondary sub-hash table, and stores it in the hash table.

10. The method according to claim 2, characterized in that The method further comprises: The first flash sale service node obtains updated blacklist data from the real-time data processing platform; the updated blacklist data includes a user account and a blacklist expiration time corresponding to the user account; The first flash sale service node stores all or part of the incremental updated blacklist data in the hash table.

11. The method according to claim 10, characterized in that The first flash sale service node stores all or part of the incremental updated blacklist data in the hash table, including: The first flash sale service node calculates a first hash value of the updated blacklist data, and performs a modulus operation on the first hash value by N to obtain a target number corresponding to the updated blacklist data; When the target number is the same as the natural number corresponding to the first flash sale service node, the first flash sale service node stores the updated blacklist data corresponding to the target number incrementally in the hash table; When the target number is different from the natural number corresponding to the first flash sale service node, the first flash sale service node discards the updated blacklist data corresponding to the target number.

12. The method according to claim 11, characterized in that The updated blacklist data also includes the blacklist type corresponding to the user account; the first flash sale service node stores the updated blacklist data corresponding to the target number incrementally in the hash table, including: The first flash sale service node determines a target first-level sub-hash table corresponding to the updated blacklist data according to the blacklist type corresponding to the user account in the updated blacklist data; The first flash sale service node calculates a second hash value of the user account in the updated blacklist data, and modulosizes the second hash value with M to obtain a target partition number corresponding to the updated blacklist data; M is an upper limit on the number of partition numbers in the first sub-hash table; The first flash sale service node determines, according to the target partition number corresponding to the updated blacklist data, a target second-level sub-hash table corresponding to the updated blacklist data in the target first-level sub-hash table corresponding to the updated blacklist data; The first flash sale service node uses the user account in the updated blacklist data as the key in the corresponding target secondary sub-hash table, and uses the blacklist expiration time in the updated blacklist data as the value in the corresponding target secondary sub-hash table, and incrementally stores it in the hash table.

13. The method according to claim 1, characterized in that The method further comprises: When the target number is different from the natural number corresponding to the first flash sale service node, the first flash sale service node discards the to-be-processed flash sale request data.

14. The method according to claim 1, characterized in that The to-be-processed flash sale request data is the initial flash sale request data whose corresponding reference number is the same as the natural number corresponding to the first flash sale service node among the multiple initial flash sale request data acquired by the balancing server; the reference number corresponding to the initial flash sale request data is obtained by calculating the first hash value of the user account in each initial flash sale request data by the balancing server and taking the modulus of N on the first hash value.

15. An electronic device, characterized in that: include: Processor and memory; The memory stores instructions executable by the processor; When the processor is configured to execute the instructions, the electronic device implements the method according to any one of claims 1 to 14.

16. A computer program product, characterized in that include: Computer instructions; When the computer instructions are executed in an electronic device, the electronic device is enabled to implement the method according to any one of claims 1 to 14.

Citation Information

Patent Citations

  • Second killing request method, second killing verification method, device, system and medium

    CN115694902A

  • Data processing method and device, electronic equipment and storage medium

    CN116090004A

  • Resilient consistent hashing for a distributed cache

    US11652746B1

  • Message flooding prevention in messaging networks

    WO2013124291A1