Data processing methods, electronic devices and computer program products

By employing parallel processing and a three-layer hash table for interception and identification in the flash sale service node, the shortcomings of rate limiting and delay processing in high-traffic scenarios are resolved, thereby achieving timeliness and accuracy of flash sale activities and ensuring fairness and randomness for users.

CN119583559BActive Publication Date: 2025-10-28CHINA UNITED NETWORK COMM GRP CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In scenarios with high traffic and timeliness requirements, existing technologies can reduce data flow, preventing some users from participating in flash sales. In contrast, delay-based solutions have lower timeliness, affecting the fairness and randomness of flash sales.

Method used

The system employs N parallel service nodes for flash sale processing. It calculates the hash value of the user account and uses the modulo operation to allocate request data. A three-layer hash table is used for blacklist interception and identification to ensure that request data is allocated to the appropriate service node for processing.

Benefits of technology

Without reducing data traffic, the timeliness and accuracy of real-time processing results were achieved, ensuring the fairness and randomness of the flash sale.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119583559B_ABST
    Figure CN119583559B_ABST
Patent Text Reader

Abstract

This application provides a data processing method, electronic device, and computer program product, relating to the field of communications. The method is applied to a first flash sale service node; the method includes: the first flash sale service node receiving pending flash sale request data from a load balancer; the pending flash sale request data includes the requesting user account; the first flash sale service node calculates a first hash value of the requesting user account, and takes the first hash value modulo N to obtain the target number corresponding to the pending flash sale request data; if 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. This method is applicable to the flash sale data processing process and is used to address the shortcomings of rate limiting and delay handling schemes in flash sale scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communications, and more particularly to a data processing method, electronic device, and computer program product. Background Technology

[0002] For scenarios involving high-volume business requests, relevant technologies can handle them through methods such as rate limiting and delay processing.

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

[0004] Delayed processing refers to pausing the distribution of traffic to downstream systems when the system is under excessive pressure, storing the request data separately in a storage space, and resuming distribution for processing after the downstream systems have recovered their processing capacity.

[0005] However, in scenarios with high traffic, high timeliness requirements, and accurate processing results, the relevant technologies may have shortcomings. For example, in the case of flash sales, rate limiting reduces data flow, causing some users to be unable to participate in the flash sale, while delayed processing has lower timeliness and reduces the fairness and randomness of the flash sale. Summary of the Invention

[0006] This application provides a data processing method, electronic device, and computer program product that can return the corresponding processing results in real time in one go when there are large traffic requests, without reducing the data traffic, thus ensuring the timeliness and accuracy of data processing.

[0007] Firstly, this application provides a data processing method, which is applied to any one of N flash sale service nodes; each of the N flash sale service nodes corresponds to a natural number; the N flash sale service nodes have a communication connection with a load balancer server; N is a positive integer; the method includes: the first flash sale service node receiving flash sale request data to be processed from the load balancer server; the flash sale request data to be processed includes the requesting user account of the requesting flash sale; the first flash sale service node calculates a first hash value of the requesting user account, and takes the first hash value modulo N to obtain the target number corresponding to the flash sale request data to be processed; if 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.

[0008] It should be understood that rate limiting schemes in related technologies reduce data traffic, preventing some users from participating in the flash sale, while delayed processing schemes have low timeliness, reducing the fairness and randomness of the flash sale activity. In the data processing method provided in this application, any one of the N flash sale service nodes can calculate the first hash value of the user account and take the modulo of N, thereby distributing the flash sale request data of different user accounts to different flash sale service nodes for parallel processing. This allows for the return of the corresponding processing results in real time without reducing data traffic, 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 a first-level sub-hash table; the second layer of the hash table is a 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 a second-level sub-hash table; the third layer of the hash table is a 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 in this application, the first flash sale service node can also intercept and identify flash sale requests based on blacklist data in a pre-established hash table. The hash table is divided into three layers: the first layer represents the blacklist categories, the second layer represents the partitions corresponding to each blacklist category, and the third layer stores the blacklisted user accounts and their expiration times in each partition. By storing blacklisted user accounts in partitions, the first flash sale service node can more quickly locate and intercept these requests. During flash sales, the service node needs to handle a large number of concurrent requests. If the blacklisted user accounts are not effectively partitioned, the service node may need to spend more time and resources retrieving and processing these requests. Partitioned storage significantly improves the processing efficiency of the flash sale service node, ensuring the smooth operation of the flash sale.

[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 the pre-established hash table, including: 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; the first flash sale service node obtains the second hash value of the requesting user account, and takes the second hash value modulo M to obtain the 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 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; 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 categories include all blacklist categories in the first layer of the hash table; the first-second-kill 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 category corresponding to the request data to be processed, including: the first-second-kill service node traverses all blacklist categories in the first layer of the hash table and uses all first-level sub-hash tables corresponding to each blacklist category as the reference first-level sub-hash table corresponding to the request data to be processed.

[0013] Optionally, the target blacklist categories include some blacklist categories in the first layer of the hash table indicated by the configuration information; the first second-kill 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 category corresponding to the request data to be processed, including: the first second-kill service node takes all the first-level sub-hash tables corresponding to some blacklist categories indicated by the configuration information from all blacklist categories in the first layer of the hash table as the reference first-level sub-hash table 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 based on the reference secondary sub-hash table, including: if the key of the reference secondary sub-hash table includes the requesting user account and the current time has not reached the blacklist expiration time, the first flash sale service node intercepts the flash sale request data to be processed; if the key of the reference secondary sub-hash table includes the requesting user account and the current time has exceeded the blacklist expiration time, or if the key of the reference secondary sub-hash table does not include the requesting user account, the first flash sale service node accepts the flash sale request data to be processed.

[0015] Optionally, the method further includes: the first-second-kill service node obtaining multiple blacklist data entries from the blacklist database; each blacklist data entry includes a user account and the corresponding blacklist expiration time; the first-second-kill service node storing all or part of the multiple blacklist data entries into a hash table.

[0016] Optionally, the first-second-kill service node stores all or part of the blacklist data in a hash table, including: the first-second-kill service node calculates the first hash value of each blacklist data, and takes the first hash value modulo N to obtain the target number corresponding to each blacklist data; if 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; if 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 entry also includes the blacklist category corresponding to the user account; the first-flash sale service node stores the blacklist data corresponding to the target number in a hash table, including: the first-flash sale service node determines the target first-level sub-hash table corresponding to the blacklist data based on the blacklist category 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 takes the second hash value modulo 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 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 based on the target partition number 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 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 further includes: the first-second-kill service node obtaining updated blacklist data from the real-time data processing platform; the updated blacklist data includes a user account and the blacklist expiration time corresponding to the user account; the first-second-kill service node storing all or part of the incremental update of the blacklist data into a hash table.

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

[0020] Optionally, updating the blacklist data also includes the blacklist category corresponding to the user account; the first-flash sale service node incrementally stores the updated blacklist data corresponding to the target number into a hash table, including: the first-flash sale service node determines the target first-level sub-hash table corresponding to the updated blacklist data based on the blacklist category corresponding to the user account in the updated blacklist data; the first-flash sale service node calculates the second hash value of the user account in the updated blacklist data, and takes the second hash value 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; the first-flash sale service node determines the target second-level sub-hash table corresponding to the updated blacklist data based on the target partition number 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 incrementally stores the user account in the updated blacklist data as the key in the corresponding target second-level sub-hash table, and the blacklist expiration time in the updated blacklist data as the value in the corresponding target second-level sub-hash table into the hash table.

[0021] Optionally, the method further includes: if 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 flash sale request data to be processed.

[0022] Optionally, the pending flash sale request data is the initial flash sale request data among the multiple initial flash sale request data obtained by the load balancer, whose corresponding reference number is the same as the natural number corresponding to the first flash sale service node; the reference number corresponding to the initial flash sale request data is obtained by the load balancer calculating the first hash value of the user account in each initial flash sale request data and taking the modulo of the first hash value with N.

[0023] Secondly, this application provides a data processing apparatus that includes various functional modules for the method described in the first aspect above.

[0024] Thirdly, this application provides a computer program product, comprising: computer instructions; when the computer instructions are executed on an electronic device, the electronic device causes the electronic device to perform the method described in the first aspect above.

[0025] Fourthly, this application provides an electronic device comprising: a processor and a memory; the memory storing processor-executable instructions; when the processor is configured to execute the instructions, causing the electronic device to perform the method described in the first aspect above.

[0026] Fifthly, this application provides a readable storage medium comprising: software instructions; when the software instructions are executed in an electronic device, they cause the electronic device to perform 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 repeated here. Attached Figure Description

[0028] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0029] Figure 1 This is a schematic diagram of the composition of the data processing system provided in the embodiments of this application;

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

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

[0032] Figure 4 This is a schematic diagram of the structure of a hash table provided in an embodiment of this application;

[0033] Figure 5 Another flowchart illustrating the data processing method provided in this application embodiment;

[0034] Figure 6 Another flowchart illustrating the data processing method provided in this application embodiment;

[0035] Figure 7 Another flowchart illustrating the data processing method provided in this application embodiment;

[0036] Figure 8 This is a flowchart illustrating the process of storing the full blacklist data as provided in an embodiment of this application.

[0037] Figure 9 This is a schematic diagram illustrating the process of incrementally updating blacklist data provided in an embodiment of this application;

[0038] Figure 10 This is a schematic diagram of the composition of the data processing apparatus provided in the embodiments of this application;

[0039] Figure 11 This is a schematic diagram illustrating the composition of an electronic device provided in an embodiment of this application. Detailed Implementation

[0040] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0041] It should be noted that in the embodiments of this application, the words "exemplarily" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design scheme described as "exemplarily" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of the words "exemplarily" or "for example" is intended to present the relevant concepts in a specific manner.

[0042] To facilitate a clear description of the technical solutions of the embodiments of this application, the terms "first" and "second" are used in the embodiments of this application to distinguish the same or similar items with essentially the same function and effect. Those skilled in the art can understand that the terms "first" and "second" are not intended to limit the quantity or execution order.

[0043] For scenarios involving high-volume business requests, relevant technologies can handle them through methods such as rate limiting and delay processing.

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

[0045] Delayed processing refers to pausing the distribution of traffic to downstream systems when the system is under excessive pressure, storing the request data separately in a storage space, and resuming distribution for processing after the downstream systems have recovered their processing capacity.

[0046] However, in scenarios with high traffic, high timeliness requirements, and accurate processing results, the relevant technologies may have shortcomings. For example, in the case of flash sales, rate limiting reduces data flow, causing some users to be unable to participate in the flash sale, while delayed processing has lower timeliness and reduces the fairness and randomness of the flash sale.

[0047] Based on this, embodiments of this application provide a data processing method, electronic device, and computer program product that can return the corresponding processing results in real time in one go without reducing data traffic when there are large traffic requests, thus ensuring the timeliness and accuracy of data processing.

[0048] The following description is provided in conjunction with the accompanying drawings.

[0049] Figure 1 This is a schematic diagram illustrating the composition of a data processing system provided in an embodiment of this application. Figure 1 As shown, the system includes a load balancer 100 and a flash sale service node 200. The load balancer 100 and the flash sale service node 200 are connected by communication.

[0050] The load balancer 100 can be an electronic device with computing and processing capabilities, such as a server or a computer.

[0051] The server can be a single server or a server cluster consisting of multiple servers. In some embodiments, the server cluster can also be a distributed cluster. Optionally, the server can also be implemented on a cloud platform, such as a private cloud, public cloud, hybrid cloud, community cloud, distributed cloud, inter-cloud, and multi-cloud, or any combination thereof. This application does not impose any limitations on this.

[0052] For example, load balancer 100 can be specifically implemented as an Nginx server.

[0053] Balancer server 100 can obtain flash sale request data ( Figure 1 (Taking an external request as an example), the request data is distributed to the flash sale service node 200. The specific process can be found in the data processing method described in the following implementation examples, and will not be repeated here.

[0054] The 200 flash sale service nodes can include N (N is a positive integer) flash sale service nodes. Figure 1 The example shown uses five flash sale service nodes: node 1, node 2, node 3, node 5, and node 5 (each node has a unique natural number as its identifier).

[0055] The flash sale service node 200 can also be an electronic device with computing and processing capabilities, such as a computer or server. For details, please refer to the description of the load balancer 100 above; it will not be repeated here.

[0056] For example, the 200th node of the flash sale service can be a node in a Kubernetes cluster created through the Container Kubernetes Engine (CKE). When the program starts, the node in the Kubernetes cluster can obtain the hostname and get the natural number of the current host.

[0057] The flash sale service node 200 can receive flash sale request data distributed by the load balancer 100 and process the flash sale request data. The specific process can be referred to the data processing method provided in the following method embodiment, and will not be repeated 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 be referred to in the description of the load balancer 100 above, and will not be repeated here.

[0060] The blacklist database 300 can store multiple blacklist entries. The flash sale service node 200 can load all the data from the blacklist database 300 (or retrieve all the blacklist data) and choose which entries to store.

[0061] For example, the blacklist database 300 can be 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 be referred to the description of the load balancer 100 above, and will not be repeated here.

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

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

[0066] The data processing method provided in this application embodiment is executed by a data processing device. This data processing device can be any one of the aforementioned flash sale service nodes 200. As mentioned above, a flash sale service node can be an electronic device with computing capabilities, such as a server or 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 (APP) with data processing capabilities 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 in the aforementioned electronic device used to execute the data processing method, etc. This application embodiment does not impose any limitations on these aspects.

[0067] For simplicity, the following description will use any one of the first flash sale service nodes in the flash sale service nodes 200 as an example to introduce the data processing method provided in this application embodiment.

[0068] Figure 2 This is a flowchart illustrating the data processing method provided in an embodiment of this application. Figure 2 As shown, the method includes the following steps:

[0069] S101, The first flash sale service node receives pending flash sale request data from the load balancer server.

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

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

[0072] S102. The first flash sale service node calculates the first hash value of the requesting user account and takes the modulo of the first hash value with N to obtain the target number corresponding to the flash sale request data to be processed.

[0073] For example, the first hash value can specifically be the MD5 value, SHA-256 value, or SHA-512 value of the requesting user account. This application embodiment does not limit the specific hash algorithm used for the first hash value.

[0074] S103. If 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, if 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 perform order placement or blacklist interception and identification processing on the flash sale request data to be processed. This application embodiment does not limit the specific processing types of the first flash sale service node.

[0076] In some embodiments, if 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 flash sale request data to be processed.

[0077] It should be noted that the above description uses any one of the N flash sale service nodes as an example to illustrate the data processing method provided in this application embodiment. Other flash sale service nodes among the N flash sale service nodes can also perform data processing in the same manner. This application embodiment does not impose any limitations on this.

[0078] It should be understood that rate limiting schemes in related technologies reduce data traffic, preventing some users from participating in the flash sale, while delayed processing schemes have low timeliness, reducing the fairness and randomness of the flash sale activity. In the data processing method provided in this application embodiment, any one of the N flash sale service nodes can calculate the first hash value of the user account and take the modulo of N, thereby distributing the flash sale request data of different user accounts to different flash sale service nodes for parallel processing. This allows for the return of the corresponding processing results in real time without reducing data traffic, ensuring the timeliness and accuracy of data processing.

[0079] In some possible embodiments, as described above, the first-second-kill service node can perform blacklist interception and identification processing. In this case, Figure 3 Another flowchart illustrating the data processing method provided in this application embodiment is shown below. Figure 3 As shown, the above S103 can 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 This is a schematic diagram of the hash table structure provided in an embodiment of this application. Figure 4 As shown, the hash table consists of three levels. The key of the first level of the hash table is the blacklist category (…). Figure 4 (Taking blacklist type 1 and blacklist type 2 as examples) The first level is a first-level sub-hash table; the second level of the hash table is a 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 a second-level sub-hash table; the third level of the hash table is a 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 specifically implemented as a ConcurrentHashMap. In Java, both HashMap and ConcurrentHashMap are implementations of the Map interface based on hash tables, but they behave significantly differently when handling concurrent access. In high-concurrency scenarios, choosing ConcurrentHashMap over HashMap is primarily based on the following reasons:

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

[0084] Reason 2: Performance Optimization: While HashMap performs excellently in a single-threaded environment, it requires external synchronization to ensure thread safety in a multi-threaded environment. This typically leads to a significant performance degradation because external synchronization blocks other threads. ConcurrentHashMap optimizes concurrency performance through its internal design (such as lock segmentation and lock-free algorithms), enabling it to maintain high throughput and low latency even in a multi-threaded environment.

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

[0086] Reason 4: Scalability and Adaptability: ConcurrentHashMap's design allows it to dynamically adapt to different concurrency levels, optimizing performance by dynamically adjusting its internal structure (such as resizing and rehashing). HashMap's scalability primarily relies on its initial capacity and load factor settings, but these settings are insufficient for concurrent environments.

[0087] Reason 5: API and Ease of Use: ConcurrentHashMap provides a similar API to HashMap, allowing developers to easily use it as a thread-safe Map implementation without worrying about additional synchronization code. When using HashMap, developers must handle concurrency issues themselves, which typically means more complex code and a greater chance of errors.

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

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

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

[0091] Step 1.1a: The first-level service node traverses all blacklist categories in the first layer of the hash table and uses all first-level sub-hash tables corresponding to each blacklist category as reference first-level sub-hash tables for the pending request data.

[0092] For example, the blacklist categories in the first layer of the hash table can be divided according to the types of malicious behavior. 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 partitions corresponding to each type of malicious behavior and intercept and identify the flash sale request data to be processed based on the blacklist data stored in the partitions corresponding to each type of malicious behavior.

[0093] As an example, the blacklist types in the first layer of the hash table can include: blacklists of those who have engaged in fraudulent order practices, blacklists of those who have used automated scripts to participate in flash sales, blacklists of those who have maliciously refunded customers, and blacklists of those who have shared accounts (multiple users sharing one account to participate in flash sales).

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

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

[0096] For example, the blacklist categories in the first layer of the hash table can be divided according to risk levels. Each blacklist level can correspond to multiple partitions (first-level sub-hash tables). The load balancer or other control devices can send configuration information to the first-level flash sale service node to indicate which blacklist categories corresponding to specific risk levels are enabled. When the first-level flash sale service node intercepts and identifies the flash sale request data to be processed, it can intercept and identify the data from the blacklist data stored in the partition corresponding to the blacklist category of the risk level enabled by the configuration information.

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

[0098] For example, the risk level of the blacklist can be specifically divided according to the number or frequency of malicious acts committed by the user account, or other rules. This application embodiment does not limit the specific rules for classifying risk levels.

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

[0100] The second hash value can be the same as or different from the first hash value. This 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-kill 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 based on the reference partition number.

[0102] For example, the first-second kill service node can 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 based on the reference secondary sub-hash table.

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

[0105] Step 4.1a: The first flash sale service node intercepts the pending flash sale request data based on the key of the reference secondary sub-hash table, which includes the requesting user account, and the current time has not reached the blacklist expiration time.

[0106] Step 4.2a: The first flash sale service node accepts pending flash sale request data based on whether the key of the referenced second-level sub-hash table includes the requesting user account and the current time has exceeded the blacklist expiration time, or whether the key of the referenced second-level sub-hash table does not include the requesting user account.

[0107] As an example, the first-second-kill service node can use the requesting user account as the key, traverse and search the reference second-level sub-hash table, and determine whether the reference second-level sub-hash table includes the key. If it includes the key, it can further determine whether the current time has reached the blacklist expiration time corresponding to the key.

[0108] In the data processing method provided in this application embodiment, 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 a pre-established hash table. The hash table is divided into three layers: the first layer is the blacklist category, the second layer is the partition corresponding to each blacklist category, and the third layer stores the blacklist user accounts and blacklist expiration times in each partition. By storing the blacklist user accounts in partitions, the first flash sale service node can locate and intercept the requests more quickly. During a flash sale, the flash sale service node needs to handle a large number of concurrent requests. If the blacklist user accounts are 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 operation of the flash sale.

[0109] In some possible implementations, before intercepting and identifying the data for the flash sale request, the first flash sale service node can also obtain the full blacklist data. In this case, Figure 5 This is another schematic flowchart illustrating the data processing method provided in an embodiment of this application. For example... Figure 5 As shown, prior to S101 above, the method may further include the following steps:

[0110] S201, The first-second kill service node retrieves multiple blacklist data entries from the blacklist database.

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

[0112] S202. The first-second kill service node stores all or part of the blacklist data in a hash table.

[0113] In one possible implementation, the first-flash-buying service node can calculate its own number based on the blacklist data. Only when the calculated number matches the natural number of the first-flash-buying service node will the blacklist data be stored in a hash table. In this case, S202 above can specifically include the following steps:

[0114] Step 1b: The first second-kill service node calculates the first hash value of each blacklist data and takes the modulo of N to obtain the target number corresponding to each blacklist data.

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

[0116] Optionally, as mentioned above, the hash table can be divided into different blacklist categories, with each blacklist category corresponding to multiple partitions. In this case, each blacklist entry can also include the blacklist category corresponding to the user account, and step 2b above can specifically include the following steps:

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

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

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

[0120] Step 2.3b: 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 based on the target partition number corresponding to the blacklist data.

[0121] Step 2.4b: The first-second-kill 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.

[0122] Optionally, if the key of the target first-level sub-hash table does not include the target partition number corresponding to the blacklist data, the first-second kill 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-second-kill service node can create a new key-value pair in the target first-level sub-hash table, with the target partition number as the key and the corresponding second-level sub-hash table as the value, to create a new partition. Then, the user account in the blacklist data is used as the key of the newly created second-level sub-hash table, and the blacklist expiration time corresponding to the user account is used as the value of the newly created second-level sub-hash table, thereby storing the blacklist data into the newly created partition.

[0124] Step 3b: If the target number is different from the natural number corresponding to the first kill service node, the first kill service node will discard the blacklist data corresponding to the target number.

[0125] In some possible embodiments, the first-second kill service node can also incrementally obtain updated blacklist data from the real-time data processing platform. In this case, Figure 6 This is another schematic flowchart illustrating the data processing method provided in an embodiment of this application. For example... Figure 6 As shown, before S101 (or after S202), Figure 6 (Taking the example before S101 as an example) The method may also include the following steps:

[0126] S301, the first-second kill service node obtains updated blacklist data from the real-time data processing platform.

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

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

[0129] S302. The first-second kill service node will update all or part of the blacklist data incrementally and store it in the hash table.

[0130] In one possible implementation, the first flash sale service node can calculate its own number based on the updated blacklist data. Only when the calculated number matches the natural number of the first flash sale service node will the updated blacklist data be stored in a hash table. In this case, S302 above can specifically include the following steps:

[0131] Step 1c: The first second-kill service node calculates the first hash value of the updated blacklist data, and takes the modulo of the first hash value with N to obtain the target number corresponding to the updated blacklist data.

[0132] Step 2c: If 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 updated blacklist data increment corresponding to the target number into the hash table.

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

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

[0135] Step 2.2c: The first second-kill service node calculates the second hash value of the user account in the updated blacklist data, and takes the modulo of 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-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 based on the target partition number corresponding to the updated blacklist data.

[0138] Step 2.4c: The first-second-kill service node will update the user account in the blacklist data as the key in the corresponding target secondary sub-hash table, and update the blacklist expiration time in the blacklist data as the value in the corresponding target secondary sub-hash table, and incrementally store it in the hash table.

[0139] Optionally, if 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-second kill 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-second-kill service node can create a new key-value pair in the target first-level sub-hash table, with the target partition number as the key and the corresponding second-level sub-hash table as the value, to create a new partition. Then, the user account in the updated blacklist data is used as the key of the newly created second-level sub-hash table, and the blacklist expiration time corresponding to the user account is used as the value of the newly created second-level sub-hash table, thereby storing the updated blacklist data into the newly created partition.

[0141] Step 3c: If the target number is different from the natural number corresponding to the first kill service node, the first kill service node will discard the updated blacklist data corresponding to the target number.

[0142] The above describes the data processing method provided in this application embodiment using any one of the N flash sale service nodes as an example. In the exemplary embodiment, this application embodiment also provides a data processing method that can be applied to a load balancer (such as the load balancer 100 mentioned above). Figure 7 This is another schematic flowchart illustrating the data processing method provided in an embodiment of this application. For example... Figure 7 As shown, the method may include the following steps:

[0143] S401, the load balancer server obtains the data for the flash sale request.

[0144] The data in the flash sale request may include the user account that requested the flash sale.

[0145] S402. The load balancer calculates the first hash value of the requesting user account and takes the modulo of the first hash value with N to obtain the reference number corresponding to the flash sale request data.

[0146] S403. The load balancer sends the flash sale request data to the corresponding flash sale service node that processes the flash sale request data, based on the reference number and preset correspondence of the flash sale request data.

[0147] The preset mapping relationship can be used to represent the correspondence 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 specifically be implemented as the Internet Protocol (IP) address of the flash sale service node.

[0148] Optionally, the load balancer can use the reference number corresponding to the flash sale request data as an index to traverse and search the preset correspondence, use the address information corresponding to the reference number in the preset correspondence 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] For example, the preset correspondence can be specifically shown in Table 1 below:

[0150] Table 1

[0151]

[0152]

[0153] As shown in Table 1, this table may include natural number identification fields and address information fields. The natural number identification fields include number 1, number 2, and number 3. The address information fields include address 1, address 2, and address 3. There is a correspondence between number 1 and address 1, between number 2 and address 2, and between number 3 and address 3.

[0154] For example, taking the preset correspondence shown in Table 1 above as an example, assuming that the reference number calculated by the current load balancer for the flash sale request data 1 is number 1, the load balancer 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 flash sale request data to be processed by the flash sale service node corresponding to address 1.

[0155] Based on the understanding of the above embodiments, Figure 8 This is a schematic diagram illustrating the process of storing the full blacklist data as provided in an embodiment of this 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, as well as the fields and topics to be loaded. Then, the flash sale service node can iterate through the HBase blacklist, load the HBase data, obtain the primary key (i.e., the user account in the blacklist data), calculate the MD5 value of the primary key, and take the modulo. It then checks if the modulo result matches the flash sale service node's ID. If not, the data is discarded; if so, the data is loaded into the current flash sale service node, the primary key's hash value is calculated, and the modulo is taken. Based on the modulo result, the corresponding partition is determined, and it is checked if the partition exists. If it does, the data is written; otherwise, the partition is created and the data is written.

[0156] Based on the understanding of the above embodiments, Figure 9 This is a schematic diagram illustrating the process of incrementally updating blacklist data provided in an embodiment of this application. Figure 9 As shown, the flash sale service node can read the MySQL configuration, consume the corresponding topic data (i.e., the updated blacklist data mentioned above), obtain the data primary key (i.e., the user account in the updated blacklist data), calculate the MD5 value of the primary key, and take the modulo. It then checks whether the modulo result matches the flash sale service node's ID. If not, the data is discarded; if so, the data is loaded into the current flash sale service node, the primary key's hash value is calculated, and the modulo is taken. Based on the modulo result, the corresponding partition is determined, and it is checked whether the partition exists. If it does, the data is written; otherwise, a new partition is created and the data is written.

[0157] The foregoing primarily describes the solutions provided by the embodiments of this application from a methodological perspective. To achieve the aforementioned functions, it includes corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should readily recognize that, in conjunction with the units and algorithm steps of the various examples described in the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0158] In an exemplary embodiment, this application also provides a data processing apparatus that can be applied to the aforementioned first flash sale service node. Figure 10 This is a schematic diagram illustrating the composition of a data processing apparatus provided in an embodiment of this application. Figure 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 pending flash sale request data from the load balancer server; the pending flash sale request data includes the requesting user account. 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; if 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 data of the flash sale request to be processed based on the blacklist data in the 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 a first-level sub-hash table; the second layer of the hash table is a 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 a second-level sub-hash table; the third layer of the hash table is a 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 other possible embodiments, the processing module 1002 is specifically configured to: determine 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; obtain the second hash value of the requesting user account, and take the second hash value modulo M to obtain the reference partition number; M is the upper limit of the number of partition numbers in the first-level sub-hash table; determine 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; and perform interception and identification processing on the request data to be processed based on the reference second-level sub-hash table.

[0162] In some other possible embodiments, the target blacklist includes 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 a portion of the blacklist types in the first layer of the hash table indicated by the configuration information; the processing module 1002 is specifically used to take all the first-level sub-hash tables corresponding to the portion of the blacklist types indicated by the configuration information from all the 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.

[0164] In some other possible embodiments, the processing module 1002 is specifically used to intercept pending flash sale request data 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; or to accept pending flash sale request data based on the key of the reference secondary sub-hash table including the requesting user account and the current time exceeding the blacklist expiration time, or the key of the reference secondary sub-hash table not including the requesting user account.

[0165] In some other possible embodiments, the acquisition module 1001 is further configured to acquire multiple blacklist data entries from the blacklist database; each blacklist data entry includes a user account and the corresponding blacklist expiration time; the processing module 1002 is further configured to store all or part of the multiple blacklist data entries into 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 first hash value modulo N to obtain the target number corresponding to each blacklist data; if 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; if the target number is not the same as 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 piece of blacklist data also includes the blacklist category 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 based on the blacklist category 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 second hash value modulo 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; 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 based on the target partition number 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 further configured to acquire updated blacklist data from the real-time data processing platform; the updated blacklist data includes a user account and the blacklist expiration time corresponding to the user account; the processing module 1002 is further configured to store all or part of the incremental update of the 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 first hash value modulo N to obtain the target number corresponding to the updated blacklist data; if 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 stored in the hash table; if the target number is not the same as the natural number corresponding to the first flash sale service node, the updated blacklist data corresponding to the target number is discarded.

[0170] In some other possible embodiments, updating the 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 based on the blacklist type corresponding to the user account in the updated blacklist data; calculate the second hash value of the user account in the updated blacklist data, and take the modulo of the second hash value with 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; determine 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 based on the target partition number corresponding to the updated blacklist data; use the user account in the updated blacklist data as the key in the corresponding target second-level sub-hash table, and use the blacklist expiration time in the updated blacklist data as the value in the corresponding target second-level sub-hash table, incrementally storing them 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 if 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 among the multiple initial flash sale request data obtained by the load balancer, whose corresponding reference number is the same as the natural number corresponding to the first flash sale service node; the reference number corresponding to the initial flash sale request data is obtained by the load balancer calculating the first hash value of the user account in each initial flash sale request data and taking the modulo of the first hash value with N.

[0173] It should be noted that, Figure 10 The module division shown is illustrative and represents only one logical functional division; in actual implementation, other division methods are possible. For example, two or more functions can be integrated into a single processing module. These integrated modules can be implemented either in hardware or as software functional modules.

[0174] In an exemplary embodiment, as described above, the flash sale service node can specifically be an electronic device with computing processing capabilities, such as a computer or service. In this case, this application embodiment also provides an electronic device. Figure 11 This is a schematic diagram illustrating the composition of an electronic device provided in an embodiment of this application. For example... Figure 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, memory 20, communication interface 40, and input / output interface 50 are connected via the communication line 30.

[0175] The processor 10 is used to execute instructions stored in the memory 20 to implement the data processing method provided in the above embodiments of this application. The processor 10 can be a CPU, a network processor (NP), a digital signal processor (DSP), a microprocessor, a microcontroller (MCU) / single-chip microcomputer / microcontroller, a programmable logic device (PLD), or any combination thereof. The processor 10 can also be any other device with processing capabilities, such as a circuit, device, or software module; this application embodiment does not limit this. In one example, the processor 10 may include one or more CPUs, for example... Figure 11 CPU0 and CPU1 are mentioned. As an optional implementation, the electronic device may include multiple processors; for example, in addition to processor 10, it may also include processor 60. Figure 11 (The example shown is a dashed line).

[0176] The memory 20 is used to store instructions. For example, the instructions may be computer programs. Optionally, the memory 20 may be a read-only memory (ROM) or other types of static storage devices that can store static information and / or instructions; it may also be a random access memory (RAM) or other types of dynamic storage devices that can store information and / or instructions; it may also be 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 discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media, or other magnetic storage devices, etc., and this application embodiment does not limit this. It should be noted that the memory 20 may exist independently of the processor 10 or may be integrated with the processor 10. The memory 20 may be located inside or outside the electronic device, and this application embodiment does not limit this.

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

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

[0179] Input / output interface 50 is used to enable human-computer interaction between a user and an electronic device. For example, it enables action interaction or information interaction between the user and the electronic device. Exemplarily, input / output interface 50 can be a mouse, keyboard, display screen, or touch screen, etc. Action interaction or information interaction between the user and the electronic device can be achieved through a mouse, keyboard, display screen, or touch screen, etc.

[0180] It should be noted that, Figure 11 The structures shown do not constitute a limitation on electronic devices, except... Figure 11 In addition to the components shown, electronic devices may include more or fewer components than illustrated, or combinations of certain components, or different component arrangements.

[0181] In an exemplary embodiment, this application also provides a computer program product including computer instructions that, when executed in an electronic device, cause the electronic device to implement the methods described in the foregoing method embodiments.

[0182] In an exemplary embodiment, this application also provides a readable storage medium including software instructions that, when executed in an electronic device, cause the electronic device to implement the methods described in the foregoing method embodiments. The computer-readable storage medium can be a non-transitory computer-readable storage medium, such as a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device.

[0183] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented using software programs, implementation can be, in whole or in part, in the form of a computer program product. This computer program product includes one or more computer-executable instructions. When these computer-executable instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of this application is generated. 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. For example, computer-executable instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means.

[0184] Although this application has been described herein in conjunction with various embodiments, those skilled in the art, by reviewing the accompanying drawings, disclosure, and appended claims, will understand and implement other variations of the disclosed embodiments in carrying out the claimed application. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude multiple components. A single processor or other unit can implement several functions listed in the claims. While different dependent claims may recite certain measures, this does not mean that these measures cannot be combined to produce good results.

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

[0186] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A data processing method, characterized in that, The method is applied to any one of N flash sale service nodes; each of the N flash sale service nodes corresponds to a natural number; the N flash sale service nodes have a communication connection with the load balancer server; N is a positive integer; the method includes: The first flash sale service node receives pending flash sale request data from the load balancer server; the pending flash sale request data includes the requesting user account; the pending flash sale request data is the initial flash sale request data among multiple initial flash sale request data obtained by the load balancer server, whose corresponding reference number is the same as the natural number number corresponding to the first flash sale service node; the reference number corresponding to the initial flash sale request data is obtained by the load balancer server calculating the first hash value of the user account in each initial flash sale request data and taking the modulo of the first hash value with N; The first flash sale service node calculates the first hash value of the requesting user account, and takes the modulo of the first hash value with N to obtain the target number corresponding to the flash sale request data to be processed; If the target number is the same as the natural number corresponding to the first flash sale service node, 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. The hash table comprises three layers. The key of the first layer is the blacklist category, and the value of the first layer is a 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 a 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.

2. The method according to claim 1, characterized in that, The first flash sale service node intercepts and identifies the flash sale request data based on the blacklist data in a pre-established hash table, including: The first flash sale service node determines the reference first-level sub-hash table corresponding to the pending request data from the hash table based on the target blacklist type corresponding to the pending request data; The first flash sale service node obtains the second hash value of the requesting user account, and takes the modulo of the second hash value with M to obtain the 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 the reference second-level sub-hash table corresponding to the request data to be processed from the reference first-level sub-hash table based on the reference partition number; The first flash sale service node intercepts and identifies the flash sale request data to be processed based on the reference secondary sub-hash table.

3. The method according to claim 2, characterized in that, The target blacklist categories include all blacklist categories 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 based on the target blacklist category corresponding to the request data to be processed, including: The first flash sale service node traverses all blacklist categories in the first layer of the hash table and uses all first-level sub-hash tables corresponding to each blacklist category as reference first-level sub-hash tables for the request data to be processed.

4. The method according to claim 2, characterized in that, The target blacklist categories include some of the blacklist categories in the first layer of the hash table as indicated by the configuration information; The first flash sale service node determines the reference first-level sub-hash table corresponding to the pending request data from the hash table based on the target blacklist category corresponding to the pending request data, including: The first flash sale service node selects all first-level sub-hash tables corresponding to the blacklist categories indicated by the configuration information from all blacklist categories in the first layer of the hash table as the reference first-level sub-hash table for the request data to be processed.

5. 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 reference secondary sub-hash table, including: The first flash sale service node intercepts 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 has not reached the blacklist expiration time. The first flash sale service node accepts the pending flash sale request data based on whether the key of the reference secondary sub-hash table includes the requesting user account and the current time exceeds the blacklist expiration time, or whether the key of the reference secondary sub-hash table does not include the requesting user account.

6. The method according to claim 1, characterized in that, The method further includes: The first flash sale service node retrieves multiple blacklist entries from the blacklist database; each blacklist entry includes a user account and the corresponding blacklist expiration time. The first flash sale service node stores all or part of the multiple blacklist data in the hash table.

7. The method according to claim 6, characterized in that, The first flash sale service node stores all or part of the multiple blacklist data in the hash table, including: The first flash sale service node calculates the first hash value of each blacklist data and takes the modulo N of the first hash value to obtain the target number corresponding to each blacklist data. If the target number is the same as the natural number corresponding to the first flash sale service node, the first flash sale service node will store the blacklist data corresponding to the target number in the hash table; If the target number is different from the natural number corresponding to the first flash sale service node, the first flash sale service node will discard the blacklist data corresponding to the target number.

8. The method according to claim 7, characterized in that, Each blacklist entry also includes the type of blacklist 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 the target first-level sub-hash table corresponding to the blacklist data based on 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 takes the modulo of 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-level sub-hash table; The first flash sale service node determines the target secondary sub-hash table corresponding to the blacklist data in the target first-level sub-hash table corresponding to the blacklist data based on the target partition number 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 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.

9. The method according to claim 1, characterized in that, The method further 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 the corresponding blacklist expiration time. The first flash sale service node stores all or part of the incremental update of the blacklist data into the hash table.

10. The method according to claim 9, characterized in that, The first flash sale service node stores all or part of the incremental update of the blacklist data into the hash table, including: The first flash sale service node calculates the first hash value of the updated blacklist data, and takes the modulo of the first hash value with N to obtain the target number corresponding to the updated blacklist data; If the target number is the same as the natural number corresponding to the first flash sale service node, the first flash sale service node will incrementally store the updated blacklist data corresponding to the target number into the hash table; If the target number is different from the natural number corresponding to the first flash sale service node, the first flash sale service node will discard the updated blacklist data corresponding to the target number.

11. The method according to claim 10, characterized in that, The updated blacklist data also includes the blacklist categories corresponding to user accounts; the first flash sale service node incrementally stores the updated blacklist data corresponding to the target number into the hash table, including: The first flash sale service node determines the target first-level sub-hash table corresponding to the updated blacklist data based on the blacklist type corresponding to the user account in the updated blacklist data; The first flash sale service node calculates the second hash value of the user account in the updated blacklist data, and takes the second hash value 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-level sub-hash table; 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 based on the target partition number 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, incrementally storing it in the hash table.

12. The method according to claim 1, characterized in that, The method further includes: If 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 flash sale request data to be processed.

13. An electronic device, characterized in that, include: Processor and memory; The memory stores instructions that the processor can execute; When the processor is configured to execute the instructions, it causes the electronic device to implement the method as described in any one of claims 1-12.

14. A computer program product, characterized in that, include: Computer instructions; When the computer instructions are executed in an electronic device, the electronic device causes the electronic device to perform the method as described in any one of claims 1-12.

Citation Information

Patent Citations

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

    CN115694902A

  • Resilient consistent hashing for a distributed cache

    US11652746B1