Digital collection seckilling transaction method and system based on block chain

By using blockchain to record user qualifications in the digital collection flash sale event, building distributed cache and Lua script verification, combining smart contracts and message queues to process requests, the problem of insufficient system resources in the digital collection flash sale event was solved, and system performance and user experience were improved.

CN120455062APending Publication Date: 2025-08-08CHINA CITIC BANK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510554993.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-29
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

Digital collection flash sale activities can easily lead to insufficient system resources, lag, and crashes in high concurrency. Existing cache preheating, message queue peak cutting, front-end current limiting and distributed locking have problems such as data inconsistency, accumulation, and poor user experience.

Method used

The blockchain-based digital collection flash sale transaction method is adopted, and user qualification marking is recorded through blockchain, distributed cache clusters are built, and flash sale verification is used using Lua scripts. It combines smart contracts and message queues to process requests, dynamic current limiting and blockchain expansion layer improve system performance.

Benefits of technology

Improve the system performance during the flash sale of digital collections, prevent the system from being overwhelmed by too many requests, and improve the security and reliability of user experience and transactions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120455062A_ABST
    Figure CN120455062A_ABST
Patent Text Reader

Abstract

The invention relates to a block chain-based digital collection seckilling transaction method and system, and the method comprises the steps: obtaining a user qualification mark based on the completion degree of an activity task, recording the user qualification mark and initial resource information to a block chain, and enabling the user qualification mark to be used for marking whether a user has the digital collection seckilling qualification or not; constructing a distributed cache cluster, putting the digital collection information and the inventory information into a distributed cache, loading the cache, obtaining the inventory information, and initiating a seckilling execution request based on the inventory information; performing seckilling through a Lua script, and verifying the digital collection information in the cache; and putting the digital collection order into a message queue, calling a block chain to complete digital collection transaction, and storing user panic buying information and a block chain transaction ID in a warehouse. According to the method, the performance bottleneck in the digital collection seckilling process is improved based on the block chain technology, the block chain digital collection system is prevented from being crushed by excessive requests or loads, and the user experience is improved to a certain extent.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of blockchain technology, and in particular to a blockchain-based digital collection flash sale transaction method and system. Background Art

[0002] Digital collectibles are unique digital certificates generated using blockchain technology for specific works or artworks. While protecting digital copyright, they enable authentic digital distribution, purchase, collection, and use. The uniqueness of digital collectibles lies in the fact that each piece is rendered unique and immutable through blockchain technology. Ownership and transfer information for these collectibles is recorded on the blockchain, so even if two digital files are identical, each possesses unique value through the blockchain's unique identifier. Using digital collectibles as a promotional medium strengthens contextual marketing and achieves digital marketing.

[0003] Flash sales for digital collectibles are sought after due to their scarcity and unique value. They increase user engagement and interactivity, fostering a positive experience during the shopping spree. Regularly holding flash sales for digital collectibles can increase user engagement and retention. However, flash sales can generate extremely high traffic in a short period of time, which can easily lead to insufficient platform server resources, causing system lags and crashes, impacting the user experience. Furthermore, the high concurrency of flash sales can overload the database, leading to delays or even downtime.

[0004] The following solutions are available:

[0005] Solution 1: Cache preheating solution:

[0006] Before a flash sale begins, store digital collection information, including the number of units issued, in a cache like Redis or Memcached to reduce database pressure. Flash sale requests directly read data from the cache, reducing database read and write load.

[0007] Solution 2: Message queue peak shaving solution:

[0008] Flash sale requests enter the queue through a message queue (such as RabbitMQ, Kafka), and the system processes the requests sequentially, thereby spreading high-concurrency requests over a longer processing time to protect backend services.

[0009] Solution 3: Front-end current limiting and anti-duplicate solution:

[0010] Perform flow control before loading the flash sale page or before making a flash sale request. This can be done by limiting the request frequency, adding verification codes, and other methods to prevent excessive invalid requests from flooding into the backend.

[0011] Solution 4: Database distributed lock solution:

[0012] Use distributed locks such as Redis or Zookeeper to control access to database inventory, ensuring that only one request can modify inventory records at a time to avoid overselling.

[0013] The existing solution may have the following problems:

[0014] During the flash sale process, the inventory of digital collections in the cache warm-up solution is updated frequently, and data inconsistencies may occur between the cache and the database, resulting in the display of inventory when the inventory is insufficient; in the message queue peak shaving solution, under high concurrency, the message queue may be piled up, resulting in slower processing speed and users having to wait for a long time; the front-end flow control and anti-duplicate solution adding verification codes or flow control may lead to poor user experience, especially when the verification code is difficult to recognize, users may repeatedly refresh the page, resulting in an unsmooth experience; in the database distributed lock solution, under extremely high concurrency, the acquisition of the distributed lock itself will consume time, leading to performance bottlenecks. Summary of the Invention

[0015] To address the shortcomings of the existing technology, the present invention provides a blockchain-based digital collection flash sale transaction method and system. Based on blockchain technology, the performance bottleneck in the digital collection flash sale process is improved, preventing the blockchain digital collection system from being overwhelmed by excessive requests or loads, and improving the user experience to a certain extent.

[0016] To achieve the above objectives, the technical solutions adopted by the present invention include:

[0017] A blockchain-based method for flash sales of digital collectibles, comprising:

[0018] S1. Obtain a user qualification tag based on the completion of the activity task, and record the user qualification tag and initial resource information on the blockchain. The user qualification tag is used to mark whether the user is eligible for the digital collection flash sale;

[0019] S2. Build a distributed cache cluster, store digital collection information and inventory information in the distributed cache, load the cache, obtain inventory information, and initiate a flash sale execution request based on the inventory information.

[0020] S3. Use Lua scripts to run flash sales and verify the cached digital collection information;

[0021] S4. Place the digital collection order into the message queue, call the blockchain to complete the digital collection transaction, and store the user's purchase information and blockchain transaction ID.

[0022] Furthermore, the user qualification mark is obtained based on the completion of the activity task, and the user qualification mark and initial resource information are recorded on the blockchain. The user qualification mark is used to mark whether the user is eligible for the digital collection flash sale, including:

[0023] If the user's activity task completion rate does not reach the preset threshold, the user will be redirected to the activity task page, and the user's qualification will be marked as ineligible for flash sales;

[0024] If the user's activity task completion rate reaches the preset threshold, the user's qualification will be marked as eligible for the flash sale.

[0025] Furthermore, initiating a flash sale execution request based on inventory information includes:

[0026] Execute a first judgment, wherein the first judgment is to determine whether the inventory information is 0. If the inventory information is 0, the digital collection flash sale ends; if the inventory information is not 0, execute a second judgment;

[0027] The second judgment is to judge whether the user has completed the rush purchase. Each user can only rush purchase once. If the user completes the rush purchase, the digital collection flash sale ends; if the user does not complete the rush purchase, the third judgment is executed;

[0028] The third judgment is to judge whether the user initiates a repeated flash sale request, integrating a distributed lock. If the flash sale request initiated by the user is a repeated flash sale request, the flash sale request fails; if the flash sale request initiated by the user is not a repeated flash sale request, the flash sale succeeds.

[0029] Furthermore, the flash sale is performed through Lua scripts, and the digital collection information in the cache is verified, including:

[0030] Encapsulate the data reading, verification, and update logic as an atomic transaction in a Lua script;

[0031] Run the Lua script on the server side, call the Lua script to request cached data, expiration timestamp and current timestamp, and directly obtain the cached data;

[0032] If direct retrieval of cached data fails, the client queries the data from the database and calls a Lua script to import the database query results. The Lua script is used to update the cache based on the expiration timestamp and the current timestamp and return the data.

[0033] Furthermore, the method further comprises:

[0034] Pre-register digital collections for flash sale queues through blockchain smart contracts and pre-assign processing orders;

[0035] Based on blockchain-based smart contract dynamic flow control, different flow control strategies are set for different user requests.

[0036] Furthermore, the method further comprises:

[0037] Receive user requests at the blockchain extension layer and execute flash sales of digital collectibles;

[0038] The results of digital collection flash sale transactions are recorded in batches on the blockchain main chain.

[0039] The present invention also relates to a blockchain-based digital collection flash sale trading system, which is characterized by comprising:

[0040] A marking module is used to obtain a user qualification mark based on the completion of the activity task, and record the user qualification mark and initial resource information on the blockchain. The user qualification mark is used to mark whether the user is eligible for the digital collection flash sale;

[0041] The cache module is used to build a distributed cache cluster, store digital collection information and inventory information in the distributed cache, load the cache, obtain inventory information, and initiate flash sale execution requests based on the inventory information;

[0042] The flash sale module is used to conduct flash sales through Lua scripts and verify the digital collection information in the cache;

[0043] The warehousing module is used to put digital collection orders into the message queue, call the blockchain to complete the digital collection transaction, and store the user's purchase information and blockchain transaction ID.

[0044] The present invention also relates to a computer-readable storage medium, characterized in that a computer program is stored on the storage medium, and the computer program implements the above method when executed by a processor.

[0045] The present invention also relates to an electronic device, characterized in that it comprises a processor and a memory;

[0046] The memory is used to store program instructions;

[0047] The processor is used to execute the above method by calling program instructions.

[0048] The present invention also relates to a computer program product, comprising a computer program and / or instructions, characterized in that the computer program and / or instructions implement the steps of the above method when executed by a processor.

[0049] The beneficial effects of the present invention are:

[0050] The blockchain-based digital collection flash sale transaction method and system described in the present invention improves the performance bottleneck in the digital collection flash sale process based on blockchain technology, prevents the blockchain digital collection system from being overwhelmed by excessive requests or load, and improves the user experience to a certain extent. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for describing the embodiments of the present application.

[0052] Figure 1 This is a flowchart of a blockchain-based method for flash sales of digital collectibles.

[0053] Figure 2 This is a schematic diagram of the structure of a blockchain-based digital collection flash sale trading system of the present invention;

[0054] Figure 3 The figure is a schematic structural diagram of an electronic device of the present invention. DETAILED DESCRIPTION

[0055] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with the specific embodiments of this application and the corresponding drawings. It should be understood that the described embodiments are only part of the embodiments of this application, not all of the embodiments, and these embodiments are only used to illustrate this application and are not used to limit the scope of this application. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0056] Digital collectibles are typically limited in quantity, each with a unique identifier. Limited releases can increase their appeal, while flash sales further enhance their scarcity. Flash sales can increase user engagement and interactivity, and regularly holding flash sales for digital collectibles can increase user activity and stickiness. However, these sales can also rapidly increase system load and put pressure on the system.

[0057] like Figure 1 As shown, the embodiment of the present invention discloses a method for flash sale transaction of digital collections based on blockchain, the steps of which include:

[0058] Step S1. Obtain a user qualification tag based on the completion of the activity task, and record the user qualification tag and initial resource information on the blockchain. The user qualification tag is used to mark whether the user is eligible for the digital collection flash sale.

[0059] In this embodiment of the present invention, the user is first determined to have completed the activity tasks and to be eligible to participate in the flash sale. When a digital collectible is released, the user is required to complete the specified activity tasks to qualify for the flash sale. This approach can extend user stay on the platform, thereby increasing user stickiness and engagement. Activity tasks also help users become familiar with other platform features or services, helping them become familiar with the operational process.

[0060] If a user does not complete the activity tasks, they are not eligible to participate in the flash sale and must jump to the omni-channel collaborative operation platform to complete the activity tasks. The omni-channel collaborative operation platform focuses on two major functions: integrated operations and omni-channel collaboration. In the embodiment of the present invention, the platform can be used to make personalized and accurate recommendations, realize data interconnection and interoperability, and improve marketing effectiveness.

[0061] Specifically, the platform, based on Domain-Driven Design (DDD) principles, builds an enterprise-level marketing business platform. This platform abstracts and integrates the capabilities of decentralized marketing business systems, consolidating common marketing capabilities. Using a microservices architecture, it constructs six core capabilities within the marketing platform: campaign management, strategy development, recommendation engine, equity management, content operations, and monitoring and analysis. This creates a highly cohesive, loosely coupled marketing service component system, addressing the high functional coupling and poor maintainability of traditional systems. It provides flexible scalability and rapid delivery solutions for retail, corporate, and other businesses. Building on the common capabilities of the marketing platform, the platform provides atomic front-end page components, business service components, and technical components, enabling integrated marketing scenario development and configuration capabilities from front-end to back-end. This creates a visual, configurable, and low-code R&D model. Through componentization and configuration, this enables rapid reuse and expansion of capabilities, providing technical support for the externalization of the platform's capabilities and improving development efficiency and flexibility. The platform integrates multiple channels—online, offline, and remote—driven by data and quantitative strategies to enable task orchestration, user insights, engagement, cross-channel delivery, metric analysis, task management, and iterative optimization. At the same time, the front-end provides interactive orchestration, supports flexible process design and component extension, and the back-end uses Flink, Kafka, Elasticsearch, Redis, Hbase and other technologies to build a real-time computing engine with low latency, high throughput and exactly-once semantics, so as to achieve rapid deployment of marketing strategies, accurate capture of marketing opportunities and real-time feedback of marketing effects, thereby improving marketing efficiency and accuracy. Based on AI capabilities such as natural language processing (NLP), intelligent recommendation algorithms and self-developed algorithms, the platform integrates multi-dimensional data such as customer tags, customer events, marketing content, marketing rights, financial products and channel touchpoints, configures recommendation rules and algorithm components according to the business goals of marketers, realizes personalized and accurate recommendations, and improves customer experience and marketing conversion rate. In the embodiment of the present invention, independently designed and developed digital marketing applications are used, covering architecture design, development, testing, deployment and operation and maintenance, to build a flexible and open marketing application ecosystem, improve independent control capabilities, reduce dependence on external technologies, and enhance system security and stability.

[0062] If a user completes an activity task, their Flash Sale eligibility and preliminary resource information will be recorded on the blockchain. The blockchain's distributed ledger ensures the immutability and transparency of the records.

[0063] In this embodiment, qualification verification can also be performed on the blockchain, using a pre-allocation mechanism and on-chain queuing to screen out qualified users before the digital collection flash sale begins.

[0064] Step S2. Build a distributed cache cluster, put the digital collection information and inventory information into the distributed cache, load the cache, obtain the inventory information, and initiate a flash sale execution request based on the inventory information.

[0065] In an embodiment of the present invention, when digital collections are sold at a flash sale, the number of concurrent users is large. By building a distributed cache cluster and placing the digital collection information and inventory information into the distributed cache, user access speed can be improved, database pressure can be reduced, and data can be distributed to multiple nodes through the distributed cache, which can support larger-scale expansion requirements. When a node in the distributed cache cluster fails or a node is changed, it will not affect the normal operation of the system, and the distributed cache (such as Redis) can achieve microsecond-level data reading, reducing the local storage and reading pressure of the system and further improving the response speed. In this implementation, a data redundancy mechanism can also be introduced to ensure that in the event of failure of some nodes, data can still be obtained from other nodes, thereby improving system reliability.

[0066] In this embodiment, the cache is loaded and the inventory information is obtained. If the inventory information of the digital collection is 0, it means that the digital collection has been sold out and the flash sale is over.

[0067] In an embodiment of the present invention, the following further comprises:

[0068] Execute a first judgment, wherein the first judgment is to determine whether the inventory information is 0. If the inventory information is 0, the digital collection flash sale ends; if the inventory information is not 0, execute a second judgment;

[0069] The second judgment is to judge whether the user has completed the rush purchase. Each user can only rush purchase once. If the user completes the rush purchase, the digital collection flash sale ends; if the user does not complete the rush purchase, the third judgment is executed;

[0070] The third judgment is to judge whether the user initiates a repeated flash sale request, integrating a distributed lock. If the flash sale request initiated by the user is a repeated flash sale request, the flash sale request fails; if the flash sale request initiated by the user is not a repeated flash sale request, the flash sale succeeds.

[0071] In the first judgment of this embodiment, if the inventory information is 0, that is, the digital collection is out of stock, the user should be informed that the digital collection has been sold out.

[0072] In the second judgment of this embodiment, the user is limited to purchasing only once, ensuring that each user has an equal opportunity to participate in the flash sale activity, thereby improving the fairness of the activity and preventing a user from purchasing multiple times and causing other users to fail in the flash sale.

[0073] In the third judgment of this embodiment, the blockchain system determines whether the user has initiated repeated flash sale requests and uses a distributed lock to limit the number of flash sale requests. Using a Redis distributed lock, a specific key is generated. When a user initiates a flash sale request, a lock is attempted in Redis. This ensures that, in high-concurrency scenarios, only one request from the same user is successfully executed. Distributed locks can handle resource access requests in highly concurrent scenarios. When multiple users simultaneously request the same digital item, distributed locks ensure that only one request enters the business processing layer, while other requests are placed in a message queue awaiting processing, thus avoiding resource contention and system overload.

[0074] During the flash sale of digital collections, a specific distributed lock is generated for each transaction order to ensure that the same order will not be processed repeatedly; in the inventory management of digital collections, a lock is generated based on the unique identifier of each digital collection to prevent multiple users from operating the inventory of the same digital collection at the same time, resulting in inconsistent inventory data.

[0075] In this embodiment, a reasonable timeout period is set for the distributed lock to prevent users from locking a digital collection for a long time. The distributed lock service automatically releases resources after the lock times out, allowing other users to repurchase the digital collection, avoiding deadlock or waste of resources.

[0076] Step S3: Use Lua script to perform flash sales and verify the digital collection information in the cache.

[0077] In this embodiment, a Lua script is used to execute a flash sale. After a flash sale succeeds, the user will receive a response indicating that the digital collection has been purchased successfully, thus avoiding long waiting times for the user.

[0078] Generally, loading data from a database into a cache can improve the data reading and processing speed. However, this process may result in inconsistencies between the cached data and the database data. The following situations may occur: the cached data becomes invalid due to timeout; the data in the database is updated but the cache has not yet updated the data synchronously; multiple requests access the cache at the same time, resulting in concurrency problems and causing data contention or data inconsistency, etc. In general scenarios, if there is no data in the cache or the data is expired, the data is read directly from the database, or the cached data is directly updated and returned. However, multiple interactions between the cache and the database will occur in this process, increasing the delay, and in high-concurrency scenarios, multiple requests triggering database queries at the same time may cause a sudden increase in system load and cause the system to crash. Therefore, in this embodiment, the cache is optimized by combining the high performance characteristics of Redis and the flexibility of Lua scripts.

[0079] Lua scripts are executed atomically in Redis, avoiding concurrency issues and ensuring that all commands in the script will not be interrupted by other commands during execution, thus preventing overselling caused by multiple-step operations. Lua scripts run directly on the Redis server, with high execution efficiency, reducing network latency and the client's computational burden. Cache validation is implemented using Lua scripts, encapsulating the logic of data reading, validation, and updating as an atomic transaction in the Lua script. In Redis, the Lua script is called to request cached data, expiration timestamp (recording the expiration time of the data), and current timestamp. If the cached data expires or does not exist, the client can query the data from the database and call the Lua script to import the database query results. Using the expiration timestamp and current timestamp, the Lua script updates the cache and returns the data, avoiding frequent backtracking queries.

[0080] Step S4. Put the digital collection order into the message queue, call the blockchain to complete the digital collection transaction, and store the user's purchase information and blockchain transaction ID.

[0081] Orders for digital collectibles are placed in a message queue, which decouples services such as order creation, blockchain transactions, and inventory management. In this embodiment, the entire business process is split into multiple independent sub-modules, and the message queue is used to decouple business logic. Specifically, after a successful flash sale of a digital collectible, operations such as order generation, inventory management, and personal account deductions are split into multiple sub-modules. When a sub-module completes its task, it publishes a message to notify other sub-modules without directly calling them. Triggering operations through the message queue allows for asynchronous processing, ensuring the consistency of inventory, order, and other data in high-concurrency scenarios.

[0082] In this embodiment, multiple message queues can be set up based on different business scenarios and user requests. Basic operations such as user registration and login can be placed in a general message queue, while core digital collectibles transactions can be placed in a high-priority queue. A message timeout threshold can be set to retry messages that are not processed or fail to process after a timeout.

[0083] During the flash sale of digital collections, the number of requests initiated is far greater than the number of responses. If the processing is placed in the same thread and only relies on one execution flow to process in sequence, the processing efficiency is low; if the operation function is directly defined at the thread entry, the corresponding thread pool can only handle specific functions and cannot handle multiple functions. Therefore, this embodiment creates multiple threads and queues, allocates a dedicated consumer thread pool to each queue, writes the messages to be consumed and the operation processing method into the thread pool together, and the threads in the thread pool only need to call the processing function. This embodiment can have multiple execution flows processed concurrently based on the cache pool, and completes the processing operation directly by calling the processing function, avoiding the problem of frequent creation and destruction of threads occupying resources, and avoiding the problem of system crash due to resource exhaustion when a large number of requests pour in.

[0084] The blockchain is used to complete digital item transactions and confirm ownership on the blockchain. After a user successfully purchases an item, the user's uniqueness in the transaction must be confirmed by verifying ownership on the blockchain. This confirmation process ensures the validity of the flash sale and avoids ownership disputes caused by system errors or data loss. Every transaction recorded on the blockchain is public and traceable. Blockchain encryption ensures transaction security and reduces the risk of fraud and theft.

[0085] The user's purchase information and blockchain transaction ID are stored in the database, and the user completes the purchase of the digital collection.

[0086] In an embodiment of the present invention, the method further includes:

[0087] Pre-register digital collections for flash sale queues through blockchain smart contracts and pre-assign processing orders;

[0088] Based on blockchain-based smart contract dynamic flow control, different flow control strategies are set for different user requests.

[0089] In this embodiment, independent flow limiting strategies are set for different types of user requests. High-frequency requests such as registration and login can be set with higher flow limiting thresholds, while digital collection transaction requests can be set with lower flow limiting thresholds to ensure their priority.

[0090] In this embodiment, differentiated flow limiting can also be performed based on the user's reputation. For example, for users with low reputation, such as users who frequently violate regulations or attempt malicious access, their request frequency can be appropriately limited to ensure the user experience of general users.

[0091] In this embodiment, a dynamic rate limiting mechanism can also be introduced. This mechanism is dynamically implemented through smart contracts, monitoring system resource usage in real time, including CPU, memory usage, network bandwidth, and so on. When the system load is low, the rate limiting threshold is appropriately increased to fully utilize resources. When the system load approaches a critical point, the threshold is adjusted and lowered to avoid system crashes. Machine learning algorithms are used to analyze user behavior and request patterns, predict traffic peaks, and adjust rate limiting strategies in advance. If a flash sale for a digital collectible is detected, the request threshold for non-core functions is automatically lowered before the flash sale begins, reducing the priority of non-core functions to ensure the stable operation of the flash sale.

[0092] In an embodiment of the present invention, the method further includes:

[0093] Receive user requests at the blockchain extension layer and execute flash sales of digital collectibles; record the results of flash sales of digital collectibles in batches on the blockchain main chain.

[0094] Throughput bottlenecks are resolved through Layer 2 blockchain extension technology. This Layer 2 solution moves user requests and transaction processing for flash sales onto the Layer 2 network. Through rollup, users' flash sale transactions can be quickly executed on Layer 2 and submitted in batches to the main blockchain, Layer 1, for settlement. Layer 2 technology off-chains most transaction processing, reducing the burden on the main chain.

[0095] Blockchains typically struggle to achieve both decentralization, scalability, and security. Therefore, consensus mechanisms within the blockchain's primary layer, Layer 1, confirm information and introduce Layer 2, a blockchain extension layer, for transaction processing, improving transaction efficiency and scalability. Rollup technology aggregates and processes a large number of flash sale transactions for digital collectibles, then submits these results in batches to the blockchain's primary chain. This reduces the amount of data processed by the primary chain and improves transaction throughput and efficiency.

[0096] like Figure 2 As shown, the embodiment of the present invention discloses a blockchain-based digital collection flash sale trading system, the structure of which includes:

[0097] A marking module is used to obtain a user qualification mark based on the completion of the activity task, and record the user qualification mark and initial resource information on the blockchain. The user qualification mark is used to mark whether the user is eligible for the digital collection flash sale;

[0098] The cache module is used to build a distributed cache cluster, store digital collection information and inventory information in the distributed cache, load the cache, obtain inventory information, and initiate flash sale execution requests based on the inventory information;

[0099] The flash sale module is used to conduct flash sales through Lua scripts and verify the digital collection information in the cache;

[0100] The warehousing module is used to put digital collection orders into the message queue, call the blockchain to complete the digital collection transaction, and store the user's purchase information and blockchain transaction ID.

[0101] By using this system, the above-mentioned calculation and processing method can be executed and the corresponding technical effects can be achieved.

[0102] An embodiment of the present invention also provides a computer-readable storage medium capable of implementing all steps of the method in the above embodiment. The computer-readable storage medium stores a computer program that implements all steps of the method in the above embodiment when executed by a processor.

[0103] The embodiment of the present invention further provides an electronic device for executing the above method, as an implementation device of the method, whose structure is as follows: Figure 3 As shown, the electronic device 300 includes: a processor 301 and a memory 303. The processor 301 and the memory 303 are connected, such as through a bus 302. Optionally, the electronic device 300 may further include a transceiver 304. It should be noted that in actual applications, the transceiver 304 is not limited to one. It is understandable that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the specific structure of the electronic device 300. In other embodiments of the present application, the electronic device 300 may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware. Optionally, the electronic device may further include a display screen 305 for displaying images, or receiving user operation instructions when necessary.

[0104] The processor 301 is used in the embodiment of the present application to implement the method shown in the above method embodiment. The transceiver 304 may include a receiver and a transmitter. The transceiver 304 is used in the embodiment of the present application to implement the function of the electronic device of the embodiment of the present application communicating with other devices when executed.

[0105] The processor 301 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. The processor 301 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.

[0106] The processor 301 may also include one or more processing units. For example, the processor 301 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors. The controller may serve as the nerve center and command center of the electronic device 300. The controller may generate operation control signals based on instruction opcodes and timing signals to control instruction fetching and execution. The processor 301 may also include memory for storing instructions and data. In some embodiments, the memory in the processor 301 is a high-speed cache memory. This memory can store instructions or data that have just been used or are being recycled by the processor 301. If the processor 301 needs to use the instruction or data again, it can directly retrieve it from the memory. This avoids duplicate accesses, reduces the processor 301's waiting time, and thus improves system efficiency.

[0107] The processor 301 can execute the method provided in the embodiments of the present application. The processor 301 can include different devices. For example, when the processor 301 integrates a CPU and a GPU, the CPU and the GPU can cooperate to execute the method provided in the embodiments of the present application. For example, part of the algorithm in the method is executed by the CPU, and another part of the algorithm is executed by the GPU to achieve faster processing efficiency.

[0108] The bus 302 may include a path for transmitting information between the above components. The bus 302 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus 302 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 Only one thick line is used in the diagram, but this does not mean that there is only one bus or one type of bus.

[0109] The memory 303 may be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory), or may include a high-speed random access memory. It may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash storage (UFS), or other optical disk storage, optical disk storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto.

[0110] Optionally, the memory 303 is used to store application code for executing the solution of the present application, and the execution is controlled by the processor 301. The processor 301 is used to execute the application code stored in the memory 303 to implement the method provided in any embodiment of the present application.

[0111] The memory 303 can be used to store computer executable program code, which includes instructions. The processor 301 executes various functional applications and data processing of the electronic device 300 by running the instructions stored in the memory 303. The memory 303 may include a program storage area and a data storage area. Among them, the program storage area can store the code of the operating system and application programs, etc. The data storage area can store data created during the use of the electronic device 300 (such as images and videos collected by the camera application, etc.).

[0112] The memory 303 may also store one or more computer programs corresponding to the methods provided in the embodiments of the present application. The one or more computer programs are stored in the memory 303 and configured to be executed by the one or more processors 301. The one or more computer programs include instructions that can be used to perform the various steps in the above-mentioned corresponding embodiments.

[0113] Of course, the code of the method provided in the embodiment of the present application can also be stored in an external memory. In this case, the processor 301 can run the code of the method stored in the external memory through the external memory interface, and the processor 301 can control the running process.

[0114] The display screen 305 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 300 may include one or N display screens 305, where N is a positive integer greater than 1. The display screen 305 can be used to display information input by the user or information provided to the user, as well as various graphical user interfaces (GUIs). For example, the display screen 305 can display photos, videos, web pages, or files.

[0115] The electronic device provided in the embodiment of the present application is applicable to any embodiment of the above method. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects of the corresponding method provided above, and will not be repeated here.

[0116] It will be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0117] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A system that specifies the functions of a box or boxes.

[0118] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction system that is implemented in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0119] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 The present invention is described in detail below. ...

[0120] The above description is merely a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present invention are intended to be covered by the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.

Claims

1. A blockchain-based digital collection flash sale transaction method, characterized in that: include: S1. Obtain a user qualification tag based on the completion of the activity task, and record the user qualification tag and initial resource information on the blockchain. The user qualification tag is used to mark whether the user is eligible for the digital collection flash sale; S2. Build a distributed cache cluster, store digital collection information and inventory information in the distributed cache, load the cache, obtain inventory information, and initiate a flash sale execution request based on the inventory information. S3. Use Lua scripts to run flash sales and verify the cached digital collection information; S4. Place the digital collection order into the message queue, call the blockchain to complete the digital collection transaction, and store the user's purchase information and blockchain transaction ID.

2. The method according to claim 1, wherein The user qualification mark is obtained based on the completion of the activity task, and the user qualification mark and initial resource information are recorded on the blockchain. The user qualification mark is used to mark whether the user is eligible for the digital collection flash sale, including: If the user's activity task completion rate does not reach the preset threshold, the user will be redirected to the activity task page, and the user's qualification will be marked as ineligible for flash sales; If the user's activity task completion rate reaches the preset threshold, the user's qualification will be marked as eligible for the flash sale.

3. The method according to claim 1, wherein The initiating of a flash sale execution request based on inventory information includes: Execute a first judgment, wherein the first judgment is to determine whether the inventory information is 0. If the inventory information is 0, the digital collection flash sale ends; if the inventory information is not 0, execute a second judgment; The second judgment is to judge whether the user has completed the rush purchase. Each user can only rush purchase once. If the user completes the rush purchase, the digital collection flash sale ends; if the user does not complete the rush purchase, the third judgment is executed; The third judgment is to judge whether the user initiates a repeated flash sale request, and integrate a distributed lock. If the flash sale request initiated by the user is a repeated flash sale request, the flash sale request fails; if the flash sale request initiated by the user is not a repeated flash sale request, the flash sale succeeds.

4. The method according to claim 1, wherein The Lua script is used to perform flash sales and verify the digital collection information in the cache, including: Encapsulate the data reading, verification, and update logic as an atomic transaction in a Lua script; Run the Lua script on the server side, call the Lua script to request cached data, expiration timestamp and current timestamp, and directly obtain the cached data; If direct retrieval of cached data fails, the client queries the data from the database and calls a Lua script to import the database query results. The Lua script is used to update the cache based on the expiration timestamp and the current timestamp and return the data.

5. The method according to claim 1, wherein The method further comprises: Pre-register digital collections for flash sale queues through blockchain smart contracts and pre-assign processing orders; Based on blockchain-based smart contract dynamic flow control, different flow control strategies are set for different user requests.

6. The method according to claim 1, wherein The method further comprises: Receive user requests at the blockchain extension layer and execute flash sales of digital collectibles; The results of digital collection flash sale transactions are recorded in batches on the blockchain main chain.

7. A blockchain-based digital collection flash sale trading system, characterized by: include: A marking module is used to obtain a user qualification mark based on the completion of the activity task, and record the user qualification mark and initial resource information on the blockchain. The user qualification mark is used to mark whether the user is eligible for the digital collection flash sale; The cache module is used to build a distributed cache cluster, store digital collection information and inventory information in the distributed cache, load the cache, obtain inventory information, and initiate flash sale execution requests based on the inventory information; The flash sale module is used to conduct flash sales through Lua scripts and verify the digital collection information in the cache; The warehousing module is used to put digital collection orders into the message queue, call the blockchain to complete the digital collection transaction, and store the user's purchase information and blockchain transaction ID.

8. A computer-readable storage medium, characterized in that The storage medium stores a computer program, which implements the method according to any one of claims 1 to 6 when executed by a processor.

9. An electronic device, characterized in that: including processor and memory; The memory is used to store program instructions; The processor is configured to execute the method according to any one of claims 1 to 6 by calling program instructions.

10. A computer program product comprising a computer program and / or instructions, characterized in that When the computer program and / or instructions are executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.