A random fair routing lottery system and method based on business circle granularity qualification pool grouping and group order queue

CN122989196APending Publication Date: 2026-10-27NANTONG XUESHI ENGINE TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611185276.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-06
Publication Date
2026-10-27

AI Technical Summary

Benefits of technology

[0050]1. 通过商圈级资格池隔离与独立锁组机制,确保各商圈资格独立成组、独立开奖、奖品仅在该商圈内路由,有效降低奖品无效派发比例,提升系统奖品资源利用率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122989196A_ABST
    Figure CN122989196A_ABST
Patent Text Reader

Abstract

The application discloses a random fair routing and lottery method and system based on a business circle granularity qualification pool grouping and group order queue. The lottery qualifications are isolated and dynamically grouped according to business circles, and each business circle independently maintains a qualification pool, locks a group when the qualification pool is full, and queues in order; the inventory is pre-inspected before the draw, and the whole qualification winning guarantee is verified; when the inventory is insufficient, the current group is blocked, the subsequent group is suspended, and a double-channel replenishment notification is triggered in parallel; the award pool is directly sponsored by a merchant, the existing review is reused, the local merchant is locked in the business circle, and the travel and tourism merchant covers multiple business circles; a prize is allocated by using a pure random number, the prize is routed with equal probability, and no user weight factor is introduced; the prize ID and the verification two-dimensional code are generated after the allocation is completed; the award pool is publicly announced in advance, the result is publicly announced afterwards, and the result is publicly searchable. The application solves the problems of low prize verification rate in cross-business circle, inventory scheduling confusion, static closed award pool, and non-transparent allocation, and is suitable for multi-business circle travel and tourism operation scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of data processing and distributed systems technology, specifically to a method and system for allocating lottery prizes that dynamically groups real-time lottery eligibility by business district granularity, performs inventory pre-checking and lottery opening in the order of groups after locking group boundaries, fairly allocates prizes in a purely random manner, blocks subsequent group lottery openings when inventory is insufficient and simultaneously pushes replenishment notifications to the platform and merchants, supports merchants to independently sponsor dynamic prize pools, and achieves full eligibility guarantee of winning prizes and full disclosure of the lottery opening process. Background Technology

[0002] The existing lottery and prize distribution system has the following technical defects: 1. The triggering mechanism is rigid and cannot adaptively adjust the granularity of the lottery draw. The existing system adopts two modes: fixed-time lottery draw or instant lottery draw. The former requires users to wait until the preset time before the lottery draw can be held and cannot draw the lottery draw in advance according to changes in participation popularity. The latter cannot accumulate participation popularity when the prize pool is small, and the triggering condition is single, so it cannot dynamically adjust the granularity of the lottery draw according to real-time changes in participation popularity.

[0003] 2. The mixed use of prize pools across different business districts leads to low redemption rates. Existing systems typically do not differentiate between the business districts where users are located, and all prizes are included in a unified prize pool for allocation. This results in users abandoning their redemption after winning prizes outside their own business district, and the prizes fail to effectively reach the target consumer group. Furthermore, there is a lack of a mechanism to isolate the prize pool and the drawing group at the business district level, making it impossible to achieve independent allocation and fair distribution of prize resources in each business district.

[0004] 3. The lack of a grouping waiting mechanism prevents dynamic window aggregation of qualifications. The existing system lacks the ability to dynamically divide continuously flowing qualifications into independent lottery groups according to a fixed window size, failing to achieve a balance between high throughput and low latency.

[0005] 4. When inventory is insufficient, only the current group is processed, leading to disordered influx of subsequent groups and causing system chaos. The existing system typically only rejects the current lottery request when inventory is insufficient, while subsequent lottery groups continue to be generated and flood in. This results in the continuous entry of subsequent groups when the preceding group is blocked, the continuous increase in inventory pressure, disordered lottery order of each group, and the inability to guarantee fairness for users.

[0006] 5. Lack of two-level management between prize level inventory and specific prize inventory. Existing systems typically only manage specific prize inventory, lacking a two-level management architecture of "prize level inventory → specific prize inventory," resulting in low inventory query efficiency and a high probability of concurrency conflicts.

[0007] 6. Algorithmic interference in the allocation process makes fairness unverifiable. Existing systems commonly employ weighted algorithms in prize allocation, resulting in unequal probabilities of winning for different users. Users cannot verify the fairness of the allocation process, and system operators bear the burden of proof regarding algorithmic bias and face compliance risks.

[0008] 7. Inventory over-issuance and data inconsistency in concurrent scenarios. When multiple people participate in the lottery simultaneously, there is a risk of data inconsistency in inventory deduction, and the same prize may be distributed multiple times.

[0009] 8. The prize pool is closed and static, unable to respond to merchants' independent marketing needs. The existing system's prize pool is configured by the platform before the start of the event and cannot be changed during the event. Merchants cannot add prizes in real time according to their own marketing needs, and the platform cannot use merchants' independent sponsorship to replenish inventory and remove the blockage.

[0010] 9. Lack of a transparent mechanism for the entire lottery process. The existing system does not provide disclosure of the prize pool, probability, and lottery results. Users cannot know the prize composition and winning probability before the lottery, nor can they verify whether their winning results are consistent with the disclosed rules after the lottery.

[0011] 10. The existing system has empty prizes, which results in the effective prize distribution rate being lower than the qualification conversion rate, causing redundancy in prize resource allocation and invalid use of the qualification pool.

[0012] In summary, existing technologies lack an isolated scheduling architecture that uses the business district ID to connect the entire chain of verification triggering, qualification grouping, locking grouping, queue scheduling, inventory management, and prize routing. Furthermore, they cannot achieve real-time dynamic replenishment of merchant sponsorships, automatic recovery from blockages, or full-process public disclosure of the lottery. Existing technologies do not provide any technical insights into a complete set of combined solutions. Summary of the Invention

[0013] The technical means of this invention, through the business district ID, permeate the entire chain of redemption triggering, qualification grouping, locking groups, queue scheduling, inventory management, and prize routing, forming an organic synergy rather than a simple assembly of existing distributed technologies: First, the combination of business district-level qualification pool isolation and full / timeout dual-threshold locking groups allows the prize-drawing granularity to adaptively adjust according to the real-time participation heat of each business district. Simultaneously, different business districts are independently grouped and queued, fundamentally avoiding low redemption rates caused by cross-business district prize mismatches; Second, the "pre-order blocking, subsequent waiting" principle of the grouped sequential queue, along with business district-level secondary inventory management and pre-prize inventory... Pre-checking, in conjunction with other features, only blocks the current business district and group when inventory is insufficient, without releasing or reordering, ensuring the determinism and consistency of the lottery results and eliminating the overhead of rollback in allocation failures. Secondly, pure random prize allocation and equal-probability SKU routing are executed within independent prize pools in each business district, supplemented by pre-event prize pool disclosure, post-event result disclosure, and hash-based notarization, making the allocation process completely transparent and verifiable, effectively mitigating compliance risks associated with algorithmic bias. Finally, merchant-sponsored dynamic prize pools, dual-channel replenishment notifications, and periodic re-checking of blockages form a self-healing closed loop, using real-time merchant replenishment to unblock without requiring secondary platform review. These features interact to address shortcomings such as low cross-business district redemption rates, chaotic inventory scheduling, statically closed prize pools, and opaque allocation, producing a chain-like technical effect of "isolated scheduling—deterministic lottery—verifiable fairness—self-healing replenishment."

[0014] The lottery method, lottery system, and computer-readable storage medium of this invention belong to the same general inventive concept and share common specific technical features: lottery eligibility is isolated and grouped at the business district level, an independent group sequence queue is constructed for each business district, and a group blocking waiting mechanism is adopted to complete inventory pre-inspection and lottery scheduling.

[0015] The various technical means in this invention are coupled and synergistic, and are not simply a combination of existing distributed lottery technologies: Using only a business district-isolated qualification pool cannot achieve adaptive traffic grouping and self-healing of congestion; setting only a sequential blocking queue cannot solve the problem of low redemption rates for cross-business district prize mismatches; configuring only a static prize pool cannot automatically unblock congestion based on real-time merchant sponsorship; and using only random allocation without full-link transparency still carries the risk of algorithmic bias and compliance. This invention integrates business district IDs throughout the entire chain, coupling an independent qualification pool, dual-threshold locking groups, a serial blocking queue, a two-level cascaded inventory, tiered dynamic merchant sponsorship, purely random verifiable allocation, and a three-level distributed lock to form a complete closed loop, resulting in comprehensive benefits that existing technologies could not anticipate.

[0016] Technical problems to be solved This invention provides a method and system for allocating prizes in a lottery, which includes isolating the prize pool by business district, grouping lottery eligibility by business district, strictly sorting between groups, blocking the current group when inventory is insufficient, pausing subsequent groups, supporting the allocation of prizes to all eligible participants within a group when inventory is sufficient, and making the entire lottery draw process public. Technical solution

[0017] (a) Eligibility triggered by write-off In response to a user completing a purchase verification at a partner merchant offline, the system automatically generates a prize draw eligibility for that user. The specific process for generating and verifying the verification code is as follows: 1. Verification Code Generation. After a user completes order payment, the system generates a unique verification code for that order. The verification code includes an order identifier, a merchant identifier, a generation timestamp, and a verification digit, presented in the form of a QR code, and is valid for a preset period of time.

[0018] 2. Verification Request. After the user arrives at the store, the merchant scans the verification code using a terminal device. Upon receiving the verification request, the system executes the following in sequence: (a) Validity verification: Verify whether the verification code exists and is within its validity period; (b) Signature verification: Verify whether the check digit is correct; (c) Status verification: Verify whether the current status of the order is pending verification; (d) Merchant matching verification: Verify whether the merchant ID that initiated the verification request is consistent with the merchant ID bound to the verification code.

[0019] 3. Geographic Location-Assisted Verification. The system obtains the geographic location of the merchant's terminal device and compares it with the merchant's registered address bound to the verification code. If the deviation exceeds a preset threshold, a risk control review is triggered.

[0020] 4. Atomic Change of Order Status. After all verifications are successful, the system atomically changes the order status from pending verification to verified, recording the verification timestamp and verification terminal ID.

[0021] 5. Automatic generation of lottery eligibility. After the order status is successfully changed, the system automatically generates lottery eligibility, assigns a unique eligibility ID, and records the generation timestamp.

[0022] 6. Audit documentation. The system will record the complete write-off event in the read-only audit log.

[0023] (ii) Business District Identification and Qualification Marking The system identifies the business district to which the consumption behavior belongs and writes the business district ID into the lottery eligibility record. The business district refers to a commercial cluster area centered on a commercial complex, commercial street, or core commercial facility, radiating to a certain geographical area. Merchants select their business district upon joining the platform, and after platform approval, this is bound to their merchant ID, and the mapping relationship between merchant IDs and business district IDs is maintained in the database. When a redemption event triggers the generation of lottery eligibility, the system performs the following operations: (a) queries the business district ID corresponding to the merchant ID that initiated the redemption; (b) writes the business district ID as an eligibility attribute into the lottery eligibility record; (c) the eligibility record includes eligibility ID, user ID, business district ID, generation timestamp, and eligibility status; (d) the business district ID is fixed at the time of eligibility generation and does not change under any conditions in subsequent processes.

[0024] (III) Grouping of Business District-Level Qualification Pool The system maintains an independent lottery qualification pool for each business district. Qualifications from the same business district are only entered into that business district's qualification pool, and qualification pools from different business districts are isolated from each other and do not interfere with each other. Each business district qualification pool independently performs the following operations: (a) Qualification entry and counting: Whenever a new qualification is generated, the system adds it to the corresponding qualification pool according to its business district ID, increments the counter by 1, and records the entry timestamp; (b) Continuous accumulation: Each business district qualification pool independently receives newly entered qualifications until each meets the group locking conditions; (c) First-in, first-out principle: Qualifications in each qualification pool are sorted by entry timestamp, and subsequent group locking operations prioritize retrieving the earliest entered qualification.

[0025] (iv) Business district-level full-amount lock group Each business district's qualification pool independently and continuously monitors the number of qualifications. When the cumulative number of qualifications in a certain business district's qualification pool reaches the preset group size, the system immediately performs a group locking operation on that business district's qualification pool: (a) the earliest N qualifications that entered the qualification pool of that business district are retrieved in ascending order of timestamps; (b) the retrieved N qualifications are grouped into an independent lottery group, and a unique group ID and an incremental group number within that business district are assigned; (c) the lottery group records its business district ID, which is consistent with the business district to which its qualifications belong; (d) once the lottery group is formed, the number of qualifications, the composition of qualifications, and the business district to which it belongs are locked and cannot be changed; (e) the counter of the qualification pool of that business district is decremented by N, and the remaining qualifications continue to remain in the pool waiting; (f) the above operations are independently and continuously executed in a loop in each business district, forming a rolling group locking mechanism for each business district. (g) Lock group concurrency control: When multiple nodes enter the pool concurrently, a four-layer mutual exclusion mechanism of atomic threshold judgment, atomic transaction qualification, group number idempotency verification, and business district distributed lock is used to ensure that only one request executes the lock group in the same business district and the same qualification pool. Other concurrent requests spin and wait or are transferred to the subsequent accumulation area of ​​the qualification pool of the same business district and are serialized by the business district distributed lock to avoid duplicate lock groups and data inconsistency.

[0026] (v) Business district-level timeout forced locking group The system monitors the earliest entry timestamp of each business district's qualification pool. When the difference between this timestamp and the current time exceeds a preset time threshold, the system performs a forced group locking operation on the business district's qualification pool: (a) all M qualifications in the business district's qualification pool are retrieved, grouped into a lottery group, and assigned an incremental group number within the business district; (b) the lottery group executes the subsequent process according to the actual number of participants M; (c) the business district's qualification pool is cleared, and the counter is reset to zero; (d) the full quota condition and the timeout condition are judged independently according to their respective monitoring cycles, and the group locking is executed when either condition reaches the trigger threshold.

[0027] (vi) Business district-level group sequential queue and blocking lottery mechanism The system maintains an independent group order queue for each business district. Locked winning groups from each business district only enter the group order queue of their respective business district. The group order queues of different business districts are independent of each other, and their blocking and winning processes do not affect each other. Each business district's group order queue independently executes the following winning order: 1. Sequential entry. The winning groups are entered into the group queue of the business district in ascending order of their group numbers. The order in which they enter the queue is the same as the order in which the winning numbers are drawn.

[0028] 2. Sequential Consumption. The system always retrieves the lottery group with the smallest group number from the head of the queue for inventory pre-checking and lottery drawing. While the current group has not yet completed its lottery drawing, subsequent groups within the same business district must not skip over the preceding group to perform any lottery drawing operation.

[0029] 3. Blocked Priorities, Waiting Subsequents. If the current lottery group cannot be drawn due to insufficient prize inventory in that business district, the system marks the group as blocked. All subsequent lottery groups in that business district will wait in the queue and cannot execute a draw. During the blocking period, subsequent groups in that business district will not perform inventory pre-checks, prize allocations, or any inventory operations. The system will continuously attempt to perform inventory pre-checks for the blocked group until sufficient inventory is available. The blocking status of different business districts does not affect each other.

[0030] 4. Blocking Relief and Sequential Resumption. Once the required inventory for each prize level in a blocked group is replenished, the system executes the lottery for that group. After completion, the group is removed from the queue, and then the next group in the same business district is processed sequentially.

[0031] 5. No Release, No Rearranging Principle. Once a lottery group is formed and assigned a group number, its membership composition, group number, lottery draw order, and associated business district are fixed. The system will not release, break up, or rearrange any locked lottery groups due to insufficient inventory.

[0032] (vii) Dual-channel replenishment notification from platform and merchant When any lottery group is marked as blocked due to insufficient prize inventory, the system triggers a dual-channel replenishment notification: (a) Platform-level notification: The system pushes a first replenishment notification to the management terminal, which includes the blocked business district identifier, the blocked group number, the name and specific quantity of the prize to be replenished; (b) Merchant-level notification: When the system detects that the inventory of a specific prize SKU has reached zero during the lottery or inventory deduction process, it automatically identifies the merchant associated with that SKU and pushes a second replenishment notification to the management terminal of the corresponding merchant, which includes the merchant identifier, the name of the exhausted SKU, the business district it belongs to, and the suggested replenishment quantity. The two types of notifications are pushed in parallel and do not overlap with each other.

[0033] (viii) Business district-level secondary inventory management The system adopts a two-tier inventory management architecture of "business district-level prize level inventory → business district-level SKU inventory", with inventory data of each business district isolated from each other: (a) Business district-level prize level inventory: The system maintains an independent prize level inventory counter for each prize level in each business district. The prize level inventory of the business district is equal to the sum of the inventory quantities of all SKUs in the prize pool of that prize level in the business district; (b) Business district-level SKU inventory: The system maintains an independent inventory counter for each specific prize SKU in each business district. The same prize SKU can be set with different inventory quantities in different business districts; (c) Cascading update of inventory changes: When the SKU inventory of a certain business district changes, the system automatically recalculates and updates the inventory counter of the corresponding prize level in that business district.

[0034] (ix) Merchant self-sponsorship and dynamic prize pool management The system allows partner merchants to select listed products from the product library and sponsor prizes for designated business district prize pools, enabling dynamic expansion and real-time updates of the prize pool. Products undergo category and compliance reviews upon listing, and the sponsorship process reuses existing review results, eliminating the need for secondary platform review.

[0035] 1. Merchant Onboarding and Business Category Identification. The system selects the business category when a merchant onboards, and the platform reviews the application. It then determines the scope of prize distribution: (a) Local Consumption Category: including catering, retail, and lifestyle services, with operating locations fixed within a specific business district. Merchants select their business district upon onboarding, and sponsored prizes are automatically allocated to that business district's prize pool; (b) Surrounding Tourism Category: including scenic spot tickets, hotels and guesthouses, local entertainment, and rural tourism, with operating locations not limited to a single business district. Merchants select their service coverage area by administrative region (district / county or prefecture-level city) upon onboarding, and the system automatically matches all business districts within that administrative region. Sponsored prizes can simultaneously cover all business districts within that administrative region, with each business district having its own independently configured inventory.

[0036] 2. Initiating and Submitting Merchant Sponsorship Requests. Merchants submit prize sponsorship requests through the management terminal. Request details include: the sponsoring merchant ID and name; the prize SKU selected from the product database; the target distribution area; and the configured sponsorship quantity for each target business district. The system automatically matches the prize level range (determined by a platform-preset price range) based on the price of the selected prize SKU, eliminating the need for manual selection by the merchant.

[0037] 3. Dynamic Prize Pool Inbound. After a sponsorship request is submitted, the system automatically performs a dynamic prize pool inbound operation: (a) Local consumer merchants: Sponsored prizes are directly added to the corresponding prize level SKU inventory of the merchant's business district at the time of the merchant's entry; (b) Surrounding tourism and cultural tourism merchants: The prizes are split and added to the corresponding prize level SKU inventory of each target business district according to the quantity allocation plan specified by the merchant; (c) A cascading update is triggered, automatically recalculating and updating the inventory counters of the corresponding prize levels for each target business district; (d) A unique inbound batch number is generated, and the inbound batch information is recorded; (e) The system automatically generates a sponsorship record and writes it to the audit log.

[0038] 4. Dynamic prize pool is updated in real time. After the prize pool changes dynamically, the system updates the prize pool information of each affected business district in real time: (a) adding new prize items; (b) marking the redemption coverage of prizes for local tourism and cultural tourism categories in the announcements of each business district; (c) updating the total inventory and remaining inventory of the prize level.

[0039] 5. Dynamic replenishment recovery in a blocked state. When a business district is blocked due to insufficient inventory, merchant sponsorship can be used as a replenishment source to trigger the blockage to be lifted: (a) After the sponsored prizes are put into storage, the system automatically rechecks the prize level inventory of the business district to which the blocked group belongs; (b) If all the prize levels required by the blocked group are sufficient, the system automatically lifts the blockage and executes the group's lottery; (c) The system pushes a replenishment success and blockage lifting notification to the sponsoring merchant.

[0040] 6. Redemption Data Feedback and Merchant Performance Feedback. After a merchant-sponsored prize is redeemed by a user, the system sends redemption data back to the sponsoring merchant: (a) redemption time and geographical location; (b) the cumulative redemption quantity and redemption rate of the prize SKU; and (c) the redemption distribution across different business districts (applicable to multi-business district coverage scenarios for tourism and cultural tourism merchants). This redemption data does not change the prize allocation weights and is only used for evaluating merchant marketing performance.

[0041] (x) Pre-draw inventory check and full eligibility prize allocation: that is, if there is sufficient prize inventory, all eligibility within the group will be allocated to the corresponding prize level, and there will be no unwinning interval. After retrieving the current lottery group from the head of the sequential queue of a certain business district, the system performs an inventory pre-check on the business district: (a) Calculation of prize level requirements: Based on the number of lottery group qualifications P (P equals the total number of qualifications actually locked in the lottery group) and the preset probability threshold R_i of each prize level (ΣR_i=100%), the maximum remainder method is used to calculate the integer quota Q_i of each prize level: First, take the basic quota floor(P×R_i), then add 1 to the remaining difference in descending order of the decimal part. If the decimal parts are the same, allocate them in descending order of prize level priority so that ΣQ_i = P always holds true; The system verifies that the sum of the probability thresholds of each prize level is 100%, and verifies that ΣQ_i allocated by the maximum remainder method is equal to P. If any verification fails, a configuration anomaly alarm is triggered and the lottery is suspended. (b) Business District Level Prize Inventory Query: Query the current inventory counter Stock_i for each prize level in the business district; (c) Inventory Adequacy Judgment: Verify whether Q_i ≤ Stock_i holds true for all prize levels in the business district; (d) Conditional Branch: If all prize levels satisfy Q_i ≤ Stock_i, then execute the lottery; otherwise, the group is marked as blocked and a replenishment notification is pushed; (e) Periodic Recheck: The system rechecks the prize inventory status of the business district to which the blocked group belongs at a preset time period until all are sufficient; (f) Independence between Business Districts: The pre-check, blocking, and lottery processes of each business district do not affect each other.

[0042] (xi) Allocation of purely random prizes After the lottery group passes the inventory pre-check, the system performs a purely random prize allocation: (a) Probability threshold setting: The platform presets a fixed probability threshold for each prize level, ΣR_i = 100%, and there is no unwinning interval; (b) Pure random number generation: The system generates a random number independently for each qualification, which comes from a true random number generator or a cryptographically secure pseudo random number generator; (c) Prize level determination: The random number is mapped and matched with the probability threshold interval to determine the prize level; (d) Business district-level prize level inventory deduction: After the determination is completed, the corresponding prize level inventory counter of the business district to which the qualification belongs is atomically decremented by 1; (e) Prize level locking: The prize level is locked after the allocation is completed and is not affected by subsequent SKU inventory changes; (f) Random allocation principle: The prize level allocation is determined only based on the mapping relationship between the random number itself and the preset probability threshold interval, and does not introduce any of the user profile, consumption amount, or historical winning number as a weighting factor.

[0043] (xii) Specific prize allocation for equally probable random routing Based on the locked prize level, the system randomly allocates specific prize SKUs from the prize pool of the corresponding prize level in the business district to which the qualification belongs in an equal probability manner: (a) Business district prize pool index construction; (b) equal probability random selection; (c) Business district-level SKU inventory deduction; (d) Instant generation of prize vouchers: After each qualification completes SKU routing, the system immediately generates a unique prize ID and corresponding redemption QR code; (e) Inventory zeroing processing: When the SKU inventory is zero, it is removed from the prize pool and triggers cascading updates and a second replenishment notification; (f) Equal probability routing principle: SKU routing adopts an equal probability random method, without introducing any of the following as weighting factors: inventory quantity, addition time, or supplier geographical location.

[0044] (xiii) Cross-scenario prize routing Prizes are sourced from offline physical spaces, including merchants within the business district and surrounding cultural and tourism consumption scenarios where prizes can be redeemed. Each prize category has its own inventory allocated according to its respective business district, and distribution is limited to that district. Winning users redeem their prizes at the corresponding offline physical space using a unique redemption QR code generated by the system. The system records the redemption location and redemption rate for each prize; this redemption rate data does not negatively affect the prize allocation weight.

[0045] (xiv) Full-process public disclosure mechanism for the lottery The system provides a complete disclosure mechanism for all stages of the lottery: before, during, and after the draw. 1. Prize Pool Pre-Announcement. The system discloses real-time prize pool information for each business district to users through a public interface, including the name of each prize level and its fixed probability threshold, details of specific prize SKUs, and inventory status. The announced information includes a timestamp.

[0046] 2. Post-draw results announcement. The system generates an announcement report for each completed draw group, including the group ID, business district, draw time, anonymized list of eligibility, random number for each eligibility and prize level determination, specific prize SKU and prize ID, and also links the redemption QR code for each winning user to the announcement report.

[0047] 3. Public Announcement Report Inquiry. The lottery announcement report fully lists the random numbers, prize level determinations, and SKU routing results for all eligible entries in that group, and links them to the redemption QR code for each winning user. Users can check their winning information through the public announcement page and redeem their prizes at the corresponding offline physical location using the QR code.

[0048] 4. Data storage and tamper prevention. All publicly disclosed data is stored using hash digests and written to a read-only audit log.

[0049] (xv) Concurrent Inventory Control Methods The system employs a three-tiered distributed lock mechanism. Lock keys include the following business district dimensions: (a) Lottery group-level lock: `draw:group:{business district ID}:{groupId}`; (b) Prize level inventory-level lock: `draw:level:{business district ID}:{levelId}`; (c) SKU inventory-level lock: `draw:sku:{business district ID}:{skuId}`. The lock acquisition order is: Lottery group-level lock → Prize level inventory-level lock → SKU inventory-level lock, preventing deadlocks. The complete chain of "check prize level inventory → deduct prize level inventory → check SKU inventory → deduct SKU inventory → generate record" is encapsulated into atomic operations. The distributed lock has a preset timeout duration and supports automatic watchdog renewal. Beneficial effects

[0050] 1. By isolating and locking the qualification pool at the business district level, we ensure that the qualifications of each business district are grouped independently, the prizes are drawn independently, and the prizes are only routed within the business district, which effectively reduces the proportion of invalid prize distribution and improves the utilization rate of system prize resources.

[0051] 2. By using a business district-level grouped sequential queue and an independent blocking lottery mechanism, each business district can operate in parallel and independently. When any business district is blocked, other business districts can still draw lotteries normally, avoiding global traffic throttling caused by single-point blocking.

[0052] 3. Through district-level two-tier inventory management, independent inventory allocation for the same SKU can be achieved in different districts, matching the supply and demand differences in each district and reducing inventory backlog and waste caused by misallocation of resources.

[0053] 4. By adhering to the principles of not releasing and not reordering, the consistency of the lottery group's state is ensured, simplifying the anomaly recovery logic.

[0054] 5. By establishing a dual-channel replenishment notification mechanism at both the platform and merchant levels, a complete closed loop is formed, encompassing blocking, notification, replenishment, and automatic recovery, thereby reducing system congestion time caused by delays due to manual intervention.

[0055] 6. By triggering a complete verification process for qualification through reconciliation, the risk of fraud in the reconciliation process is reduced, ensuring system security and traceability.

[0056] 7. By using dual thresholds of full-amount lock group and timeout forced lock group, the lottery granularity is adaptively adjusted to the participation intensity, balancing system throughput and user waiting latency.

[0057] 8. By checking inventory first and then drawing lots, and by blocking and waiting for the whole group, the deterministic guarantee of the lottery result is achieved, and the rollback overhead caused by allocation failure due to inventory competition is eliminated.

[0058] 9. By locking prize levels and managing secondary inventory, duplicate or missed prize distributions caused by state splitting in a distributed environment can be avoided.

[0059] 10. By using pure random allocation and equal probability routing, the allocation process is made completely transparent and verifiable, reducing the compliance risks of algorithmic bias for system operators.

[0060] 11. Strong consistency of inventory data is ensured in high-concurrency scenarios through three-level distributed locks and atomic inventory deduction.

[0061] 12. By enabling merchants to directly sponsor products from the product inventory and manage the prize pool dynamically, the system can achieve real-time expansion of the prize pool and proactive replenishment of products in blocked states. Existing audit procedures can be reused, significantly improving the automation level of the system in terms of prize replenishment.

[0062] 13. By identifying merchant business categories and controlling differentiated distribution, local consumer merchants can lock in their local business districts to ensure redemption rates, while surrounding tourism and cultural tourism merchants can cover multiple business districts across administrative regions to acquire a wider customer base, thus meeting the differentiated marketing needs of different merchant types.

[0063] 14. By using the maximum remainder method to ensure that ΣQ_i = P always holds true and the sum of the equal probability thresholds for each prize is 100% (there is no unwinning interval), full eligibility for prizes is allocated within the group in scenarios with sufficient inventory, eliminating the invalid occupation of the eligibility pool caused by empty prize intervals.

[0064] 15. By implementing a full-process public disclosure mechanism for the lottery draw, a complete information disclosure chain is achieved, from pre-draw prize pool disclosure to in-process probability transparency to post-draw result verification, thereby reducing the platform's compliance costs. Attached Figure Description

[0065] Figure 1 This is the overall flowchart of the core process of this invention.

[0066] Figure 2 This is a detailed flowchart of the qualification process for triggering write-offs in this invention.

[0067] Figure 3 This is a flowchart of the business district identification and qualification marking process of the present invention.

[0068] Figure 4 This is a schematic diagram illustrating the process of independent grouping and locking of the multi-business district qualification pool in this invention.

[0069] Figure 5 This is a schematic diagram of the business district-level grouped sequential queue and independent blocking lottery mechanism of the present invention.

[0070] Figure 6 This is a flowchart of the pre-inspection and conditional branching of the business district level inventory in this invention.

[0071] Figure 7 This is a diagram of the business district-level two-tier inventory management architecture of the present invention.

[0072] Figure 8 This is a timing diagram for the concurrent control of the three-level distributed lock of this invention.

[0073] Figure 9 This is a flowchart of the merchant-sponsored and dynamic prize pool management process of the present invention.

[0074] Figure 10 This is a flowchart illustrating the full-process disclosure mechanism for the lottery in this invention. Detailed Implementation

[0075] Example 1: Complete process of qualifying for write-off triggers After User A completes a purchase of 288 yuan at a partner restaurant, the system generates a unique verification code for the order, containing the order ID, merchant ID, generation timestamp, and verification digit, presented in QR code format, valid for 15 days. Upon User A's arrival at the restaurant, the merchant scans the QR code at the POS terminal. The system then performs the following verifications sequentially: verification code exists and is valid; verification digit is correct; order status is pending verification; merchant ID matches; geographical location deviation is 120 meters (less than the 500-meter threshold). After all verifications are successful, the system atomically changes the order status to verified and records the verification timestamp. Subsequently, eligibility is automatically generated and stored in the eligibility pool, and the complete verification record is written to the read-only audit log.

[0076] Example 2: Business District Identification and Independent Accumulation of Multiple Business District Qualification Pools Preset business districts A and B. User A completes a purchase at a restaurant in business district A. The system queries the business district ID (BIZ_A) of that restaurant, generates a qualification, writes it to business district ID (BIZ_A), and stores it in the business district A qualification pool, with the counter starting from 0 and increasing to 1. At the same time, User B completes a purchase at a retail merchant in business district B. The system queries the business district ID (BIZ_B) of that retail merchant, generates a qualification, and stores it in the business district B qualification pool, with the counter starting from 0 and increasing to 1. When the 100th qualification enters the business district A qualification pool, a lock group is triggered, forming G_A001. At this point, the business district B qualification pool may only have 30 qualifications accumulating. The two business districts do not interfere with each other.

[0077] Example 3: Qualification Pool Scrolling Lock Group and Timeout Forced Lock Group The preset group size is N=100, and the timeout threshold is T=30 days. Qualifications 1-99 enter the pool before reaching the maximum threshold. Upon the entry of the 100th qualification, a full-amount lock is triggered: 100 qualifications are retrieved, grouped into G001, and added to the group order queue; the qualification pool counter for that business district is reset to zero. Subsequent qualifications continue to accumulate, forming the next incrementally increasing group for every 100 qualifications, and so on, creating a rolling lock mechanism.

[0078] If a business district's eligibility pool continues to accumulate but does not reach the full threshold, when the earliest eligibility entry time reaches the preset timeout threshold (for example, only 67 eligibility entries have accumulated and have not reached 100 for 30 consecutive days), the system triggers a timeout forced group lock: all 67 eligibility entries in the pool are taken out and grouped into one lottery group, and the subsequent process is executed according to the actual number of eligibility entries P=67. The eligibility pool of the business district is cleared, the counter is reset to zero, and no eligibility entries are released, broken up, or virtually filled (i.e., no additional eligibility entries are added to reach the full threshold N).

[0079] Taking P=67 and preset probability thresholds (1% for the grand prize, 10% for the first prize, 30% for the second prize, and 59% for the third prize) as an example, the maximum remainder method is used to calculate the number of integer prizes for each prize level during the inventory pre-inspection stage: base_special = floor(67×1%)=0, base_first = floor(67×10%)=6, base_second = floor(67×30%)=20, base_third = floor(67×59%)=39; the basic sum S=0+6+20 +39=65, the remaining difference Δ=67−65=2; the decimal parts of each prize are frac_special=0.67, frac_one=0.70, frac_two=0.10, frac_three=0.53, arranged in descending order as one (0.70)>special (0.67)>three (0.53)>two (0.10), and 1 is added in sequence to get Q_one=7, Q_special=1, and finally Q_special=1, Q_one=7, Q_two=20, Q_three=39, ΣQ_i=67=P, the verification is passed. This group draws prizes with an actual scale of 67 people, each qualification receives the corresponding prize, achieving 100% winning rate, and enjoys the same pure random allocation and equal probability routing rules as the full-stake group.

[0080] Example 4: Cross-traffic area congestion does not affect each other and dual-channel replenishment notification Business district A's G_A001 requires 10 first-prize tickets, but only has 8 in stock, which is insufficient. G_A001 is marked as blocked, and all subsequent groups in business district A are suspended and waiting. Business district B's G_B001 pre-check passes and executes the draw normally, completely unaffected by the blockage in business district A. The system triggers a dual-channel replenishment notification: pushing "Business district A needs to replenish 2 first-prize tickets, currently blocked group G_A001" to the management terminal; simultaneously detecting that the inventory of SKU_A1 under the first prize in business district A has reached zero, automatically pushing "Your prizes in business district A have all been drawn, it is recommended to replenish as soon as possible" to the merchant. After the administrator replenishes the inventory, a periodic recheck shows that all are sufficient, the draw for G_A001 is executed, and subsequent groups in business district A resume sequential processing.

[0081] Example 5: During the blocking period, subsequent groups are not pre-checked, released, or rearranged. G_A001 is blocked due to insufficient first-prize inventory. G_A002 and G_A003 are waiting in the queue without any inventory pre-check. Even if other prize levels have sufficient inventory at this time, the system will not pre-check or open the draw for G_A002 and G_A003 in advance. The system will not release its 100 qualifications back to the pool due to excessive waiting time, will not break them up, and will not change the group number of any group. All groups must be drawn in sequence.

[0082] Example 6: Business District-Level Two-Tier Inventory Management The inventory for each prize level within a business district is sponsored by the participating merchants. The business district affiliation of prize SKUs is constrained by the merchant's business category (local consumer merchants are limited to their own business district, while surrounding tourism and cultural merchants can be configured across business districts). Business District A's first prize pool includes SKU_A1 (restaurant vouchers, inventory 100) and SKU_A2 (scenic spot tickets, inventory 50), for a total first prize inventory of 150. Business District B's first prize pool includes SKU_B1 (retail vouchers, inventory 80) and SKU_B2 (educational training experience courses, inventory 30), for a total first prize inventory of 110. The same SKU can be configured across multiple business districts, with inventory managed independently. When SKU_A1's inventory in Business District A reaches zero, only the cascading update of the prize level inventory in Business District A is triggered (from 150 to 50); Business District B is unaffected.

[0083] Example 7: Purely Random Prize Allocation and Equal Probability Routing After the lottery draw group passes the pre-screening, the system generates 100 random numbers for 100 eligible participants. Based on fixed probability thresholds (1% for the Grand Prize, 10% for First Prize, 30% for Second Prize, and 59% for Third Prize, totaling 100%, with no unwinnable intervals), the prize levels are determined. Once the First Prize is determined, the First Prize inventory in Business District A is reduced from 100 to 90, locking the prize level. Then, specific SKUs are randomly selected from the First Prize pool in Business District A using equal probability. Each eligible participant immediately generates a prize ID and a verification QR code after SKU routing is completed, ensuring a 100% prize payout.

[0084] Example 8: 100% Winning Guarantee and Configuration Anomaly Alarm There are 100 eligible entries in lottery group G_A001 of business district A. The preset probability thresholds are: Grand Prize 1% (Q=1), First Prize 10% (Q=10), Second Prize 30% (Q=30), and Third Prize 59% (Q=59). After calculation using the maximum remainder method, ΣQ_i = 100 = P. The verification passed, and the lottery draw proceeded normally.

[0085] If a configuration error causes the sum of the probability thresholds for each prize to be less than 100% (e.g., misconfigured as 99% or 101%), or if ΣQ_i ≠ P after allocation using the maximum remainder method, the system will trigger a configuration anomaly alarm during the inventory pre-check phase, suspending the lottery process for that business district and prompting the administrator to check the configuration integrity. After the administrator corrects the configuration, the pre-check and allocation will be re-executed to ensure that ΣQ_i = P is always true before proceeding with the lottery.

[0086] Example 9: Merchants' Self-Sponsorship to Alleviate Business District Congestion (Local Consumer Category) In business district A, entry G_A001 was blocked due to insufficient first-prize inventory. A restaurant within business district A selected a "100 RMB restaurant voucher" from its inventory as a sponsored prize and submitted a sponsorship request. The target business district was automatically locked as BIZ_A. The system automatically added the vouchers to the inventory, reused existing verification, and added 20 vouchers to the first-prize pool for business district A, increasing the inventory from 8 to 28. Periodic rechecks confirmed sufficient inventory, automatically unblocked the process, and the draw was executed. Redemption data was sent back to the merchant: "Three of your sponsored vouchers have been redeemed, a redemption rate of 15%, and all redeemed users are consumers within business district A." Example 10: A business operator operating a scenic area (whose business category is "nearby tourism and cultural tourism") with multiple business districts covering various commercial areas. Upon joining the platform, the service coverage area is selected based on the prefecture-level city as the administrative region. The system automatically matches all business districts (Business District A, Business District B, and Business District C) within that administrative region. Merchants select "Scenic Spot Tickets" as sponsored prizes from the product database, sponsoring 300 tickets to the third prize pool, which are allocated to Business District A (100 tickets), Business District B (80 tickets), and Business District C (120 tickets). The system automatically splits the allocation into three sub-batches and adds them to the database separately. The prize pool for each business district is updated with the addition of scenic spot tickets as prizes and inventory.

[0087] Example 11: Lottery Result Announcement and Inquiry Once the lottery draw group G_A001 for business district A is completed, the system automatically generates a public announcement page, including the group ID, the business district it belongs to, the draw time, a list of 100 de-identified eligibility entries, the random number and prize level determination result for each eligibility, the specific SKU to which it is routed, and the verification QR code. User B can view the public announcement page to see the prize level determination result and corresponding prize for their eligibility, and can directly redeem and collect the prize at the scenic spot using the associated verification QR code. The random number corresponding to this eligibility is stored in the background record for technical verification and audit traceability.

Claims

1. A random fair routing lottery method based on business district-level qualification pool grouping and group order queue, characterized in that, include: (a) In response to a consumption redemption event, generate a lottery qualification carrying a business district identifier, identify the business district to which the qualification belongs, and write the business district ID into the qualification record; (b) Each business district maintains its own qualification pool. Qualifications enter the corresponding qualification pool according to their business district ID. Each qualification pool is accumulated and counted independently; (c) When the qualification pool of any business district reaches the preset full threshold, the system takes out the qualifications in the pool and gathers them into an independent lottery group, assigns an incremental group number within the business district, and records the business district ID of the lottery group; (d) The lottery groups enter the group sequence queue of their respective business districts in order of group number. The system independently performs inventory pre-check and lottery for the group sequence queue of each business district; (e) If the current lottery group has insufficient inventory, the group is marked as blocked. All subsequent lottery groups in the business district are suspended and waiting. Other business districts are not affected; (f) After the inventory is replenished, the lottery for the group is executed. After completion, the group is removed from the queue and the next group is processed.

2. The method according to claim 1, characterized in that, The specific steps for triggering the verification qualification include: (a) After the user completes the order payment, the system generates a unique verification code, which includes an order identifier, a merchant identifier, a generation timestamp, and a verification bit; (b) After the merchant terminal scans the verification code, the system sequentially performs validity verification, signature verification, status verification, and merchant matching verification; (c) The system obtains the merchant terminal's geographical location, and triggers risk control review when the deviation value from the merchant's registered address exceeds a preset threshold; (d) After all verifications are passed, the order status is changed from pending verification to verified using atomic operations; (e) After the order status change is successful, a lottery qualification is automatically generated and stored in the qualification pool; (f) The verification event is fully recorded and written to the read-only audit log.

3. The method according to claim 1, characterized in that, The business district identification and qualification marking specifically include: (a) when a merchant joins the system, the system assigns a business district ID to the merchant and maintains the mapping relationship between the merchant ID and the business district ID; (b) when a redemption event triggers qualification generation, the system queries the business district ID corresponding to the merchant ID; (c) the system generates a lottery qualification record and writes the business district ID as a qualification attribute; (d) the business district ID is fixed when the qualification is generated and will not change under any conditions in subsequent processes.

4. The method according to claim 1, characterized in that, After the insufficient inventory is marked as blocked, the system pushes a first replenishment notification to the management terminal. The first replenishment notification includes the blocked business district identifier, the blocked group number, the prize level and quantity to be replenished; when the inventory of a certain prize level is zero, the system identifies the merchant prize SKU associated with that prize level and pushes a second replenishment notification to the corresponding merchant. The second replenishment notification includes the merchant identifier, the name of the exhausted SKU, and the suggested replenishment quantity.

5. The method according to claim 1, characterized in that, The prize allocation is determined solely based on the mapping relationship between the random number itself and the preset probability threshold range, without introducing any of the following factors as weighting factors: user profile, spending amount, or historical winning count; the probability threshold range is a fixed value and is not dynamically adjusted according to user dimensions; the sum of the probability thresholds for each prize level is 100%, and there is no unwinning range.

6. The method according to claim 1, characterized in that, SKU routing adopts an equal probability random method, and all SKUs in the same business district and the same prize pool have an equal probability of being drawn; the equal probability random method does not introduce any of the following factors as weighting factors: inventory quantity, entry time, or supplier geographical location.

7. The method according to claim 1, characterized in that, Once the award level is allocated, it is locked, and the award level for that qualification will not be affected by subsequent changes in SKU inventory.

8. The method according to claim 1, characterized in that, The system maintains an independent two-tier inventory management architecture for each business district: (a) each prize level in each business district maintains an independent inventory counter; (b) each specific prize SKU in each business district maintains an independent inventory counter; (c) the prize level inventory is equal to the sum of the inventory quantities of all SKUs in the prize pool for that prize level in that business district; (d) the same SKU can be set with different inventory quantities in different business districts.

9. The method according to claim 1, characterized in that, Prizes will be sourced from offline physical spaces, including merchants within the business district and redeemable cultural and tourism consumption scenarios in and around the business district.

10. The method according to claim 9, characterized in that, The cultural and tourism consumption scenarios include scenic spots, rural homestays, and intangible cultural heritage workshops.

11. The method according to claim 1, characterized in that, The atomicity of inventory deduction is ensured by a three-level distributed lock system at the lottery group level, prize level level, and SKU level. The lock keys of the three-level distributed locks are draw:group:{business district ID}:{groupId}, draw:level:{business district ID}:{levelId}, and draw:sku:{business district ID}:{skuId}, respectively. The lock acquisition order is lottery group level lock → prize level inventory level lock → SKU inventory level lock.

12. The method according to claim 1, characterized in that, It also includes the steps for merchants to sponsor prizes: (a) Merchants submit prize sponsorship requests through the management terminal and select listed SKUs from the product inventory as sponsored prizes; (b) The system automatically matches the target business district based on the business category and distribution scope determined when the merchant joins the platform; (c) Sponsored prizes are directly added to the prize pool of the corresponding business district, reusing the existing review process; (d) The system automatically recalculates and updates the inventory counter for the corresponding prize level in the business district; (e) If there are any draw groups in the business district that are blocked due to insufficient inventory, the system automatically triggers a periodic re-check after the sponsorship is added to the inventory, and automatically unblocks and executes the draw after the inventory is replenished; (f) The system updates the prize pool information of the business district in real time.

13. The method according to claim 12, characterized in that, The distribution scope of merchant-sponsored prizes is determined based on the business category and service scope of the merchant when they join the platform: (a) Sponsored prizes for local consumer merchants are distributed to the business district selected by the merchant when they join the platform; (b) For merchants in the surrounding tourism and cultural tourism category, the service coverage is selected by administrative region when they join the platform. The system automatically matches all business districts within that administrative region, and the sponsored prizes are divided into multiple sub-batches and stored separately according to the quantity allocation plan specified by the merchant.

14. The method according to claim 13, characterized in that, Prizes sponsored by local tourism and cultural tourism merchants are recorded in inventory, redeemed, and replenishment reminders are triggered independently in different business districts; when the inventory of a certain SKU in any business district reaches zero, it does not affect the inventory status and prize draw progress in other business districts; when redemption data is sent back to the sponsoring merchants, it includes the redemption distribution of each business district.

15. The method according to claim 1, characterized in that, During the inventory pre-inspection phase, the system performs full qualification award allocation verification and integer quota allocation: (a) Based on the number of qualifications P in the lottery group and the preset probability threshold R_i for each prize level, the maximum remainder method is used to calculate the integer quota Q_i for each prize level, such that ΣQ_i = P always holds true, where ΣR_i = 100%; the maximum remainder method is as follows: first, take the basic quota floor(P×R_i) for each prize level, and then add 1 to the remaining difference in descending order of the decimal part of each prize level. If the decimal parts are the same, allocate them from high to low priority according to the prize level; (b) Verify whether the sum of the probability thresholds for each prize level is 100%, and check whether ΣQ_i after allocation by the maximum remainder method is equal to P, in order to investigate abnormal configuration data; (c) If the sum of the probability thresholds is not 100% or the allocation result ΣQ_i≠P, the system triggers a configuration abnormality alarm and suspends the lottery process for this business district.

16. The method according to claim 1, characterized in that, After each SKU is routed, the system immediately generates a unique prize ID and a corresponding redemption QR code. The redemption QR code includes the prize ID, the business district ID, the redemption validity period, and an encryption verification bit. Winning users can redeem their prizes at the corresponding offline physical space using this QR code.

17. The method according to claim 1, characterized in that, The system provides a full-process public disclosure mechanism for the lottery: (a) Pre-lottery disclosure of the prize pool: Before the lottery draw, the prize level configuration, probability threshold, SKU details and inventory status of each business district are disclosed to users; (b) Post-lottery disclosure of lottery results: After each lottery group is completed, a public disclosure report is generated, which includes the group ID, the business district to which it belongs, the lottery time, the list of eligible participants, the prize level determination result corresponding to each eligibility, and the specific prize SKU routed to; (c) Public disclosure report query: The lottery public disclosure report includes the prize level determination result and SKU routing result corresponding to all eligibility in the group. Users can query the winning information of the entire group through the public page and view the prize QR code in their own prize center; (d) Data storage: All public disclosure data is stored as a hash digest and written to the read-only audit log.

18. A random fair routing lottery system based on a business district-level qualification pool grouping and group order queue, characterized in that, include: (a) Verification monitoring module, used to monitor consumption verification events and trigger the generation of lottery eligibility; (b) Business district identification module, used to identify the business district to which the consumption behavior belongs and write the business district ID into the eligibility record; (c) Multi-business district eligibility pool management module, used to maintain an independent eligibility pool for each business district, count and trigger lock groups separately; (d) Business district-level lock group module, used to extract and aggregate the eligibility of each business district into a lottery group, assign a group number within the business district, lock the group boundary, and record the business district to which it belongs; (e) Multi-business district group sequence queue module, used to maintain an independent group sequence queue for each business district and maintain the lottery order separately; (f) Multi-business district independent lottery execution module, used to independently perform inventory pre-check and lottery for the group sequence queue of each business district; when any business district is blocked, only the subsequent groups of that business district are suspended, and other business districts continue to draw normally; (g) Dual-channel replenishment notification module, used to push a platform-level replenishment notification to the management end when there is insufficient inventory and blockage, and push a merchant-level replenishment notification to the corresponding merchant when the SKU is zero; (h) The merchant self-sponsorship management module is used to receive prize sponsorship requests submitted by merchants. It supports controlling the scope of the business district based on the merchant's business category. Sponsored prizes are directly selected from the sales product library, and the existing review is reused. After the prizes are put into the warehouse, the blockage is automatically restored. (i) Business district-level secondary inventory management module is used to maintain the cascading relationship between prize level inventory and SKU inventory for each business district independently. (j) Pure random allocation module is used to allocate prize levels through pure random numbers and route prizes with equal probability. (k) Full qualification prize allocation module is used to verify ΣQ_i = P in the inventory pre-inspection stage, so that each qualification in the lottery group that passes the pre-inspection is allocated to a certain prize level and there is no unwinning interval. (l) Publicity module, used to realize the pre-publication of the prize pool, the post-publication of the lottery results and public query; (m) Concurrency control module, used to ensure the atomicity of inventory deduction through a three-level distributed lock with business district dimension; (n) Voucher generation module, used to generate a unique prize ID and verification QR code for each qualification after SKU routing is completed.

19. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements all the steps of the method as described in any one of claims 1 to 17.