System used for single-volunteer and multi-volunteer assignment lottery

The lottery system, which uses random algorithms and hash values, solves the problem of one-time allocation in multi-choice scenarios, achieving fair, secure, and traceable lottery results, shortening process time and reducing coordination workload.

CN121146313APending Publication Date: 2025-12-16SICHUAN YOULIAN COMMUNICATION ENGINEERING CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510557265.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-29
Publication Date
2025-12-16

AI Technical Summary

Technical Problem

The existing lottery system cannot achieve one-time allocation in multi-choice scenarios, which increases the human operation steps and time costs, and cannot guarantee the randomness and security of the results.

Method used

A random algorithm is used to sort the student list. An irreversible lottery seed and a cryptographically secure random number generation algorithm are used, combined with hash values ​​to generate unique candidate identifiers. Multi-layer randomization processes are used to ensure the randomness and security of the results, and quota matching is carried out in the adjustment process.

Benefits of technology

This centralized process enables multiple choices to be drawn in a single lottery, shortening the process time, reducing the workload of organization and coordination, ensuring the fairness and traceability of the results, and allowing students and parents to understand the admission status in a timely manner.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121146313A_ABST
    Figure CN121146313A_ABST
Patent Text Reader

Abstract

The invention discloses a position dispatching lottery system and method suitable for single-volunteer and multi-volunteer scenes, and the process is as follows: firstly, initializing data, importing a data file according with the specification of the Ministry of Education through a system interface, including student basis, volunteer and school enrollment plan number, and checking integrity and uniqueness; and then generating irreversible lottery seed parameters by combining a millisecond timestamp of'lottery beginning 'with a student list hash value. And then fully arranging the student list by using an encryption security algorithm to realize random sorting. And then, sequentially extracting voluntary information, establishing a mapping relation, performing sequence check on a voluntary list, judging whether the voluntary list is the last voluntary if the voluntary list is full, and if the voluntary list is not full, putting the voluntary list into a pre-admission list and deducting the quota. And after verification of the current voluntary school is completed, if the enrollment plan is full, entering the next batch, and if the enrollment plan is not full, triggering a dispensing process. The system integrates the multi-voluntary lottery process, shortens the enrollment process time, reduces the organization coordination cost, and is convenient for students, parents and education departments.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of data processing technology, specifically a lottery system for single-choice and multi-choice placement. Background Technology

[0002] With the increasing prevalence of data-driven decision-making in resource allocation scenarios (such as student enrollment and public service resource allocation), the scale of data to be processed (including candidate identity data, application data, and resource allocation plan data) is growing rapidly, placing higher demands on the efficiency, randomness, and security of data processing. In multi-choice lottery scenarios, traditional data processing solutions have significant limitations. Currently available lottery systems are mainly used for single-choice or specific multi-choice lotteries, and cannot solve the problem of one-time multi-choice lottery. In cases with multiple choices, rules need to be set up before ranking and lotterying the applied schools, which increases the risk of human intervention and potential challenges to the lottery system, as well as the time spent on the entire lottery process. Summary of the Invention

[0003] The purpose of this invention is to provide a lottery system for single-choice and multi-choice allocation, so as to solve the problems mentioned in the background art.

[0004] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows: A lottery system for single-choice and multi-choice placement includes the following steps: Step S1: Import the student list, the student preferences corresponding to the student list, and the school's enrollment plan. Step S2: Set the lottery seed based on the student list and the student preferences corresponding to the student list; Step S3: Randomly sort the student list using a random algorithm; Step S4: Obtain the student's volunteer information according to the randomly sorted student list; Step S5: Select a school choice according to the order of the student's choices based on their application information; Step S6: Determine whether the selected school still has remaining places in its enrollment plan; if so, add the student to the lottery list; if not, determine whether it is the last choice in the student's application information. Step S7: Determine if this is the last student to fill in the application for this school. If yes, output the list of students who were selected. If not, select the next student for the lottery.

[0005] According to the above technical solution, in step S2, the lottery seed is the millisecond time when the start lottery button is clicked.

[0006] According to the above technical solution, in step S6, determining whether it is the last choice in the student's application information specifically involves: If it is the last choice in the student's application information, it means that all of the student's choices have been selected, and the lottery ends; otherwise, it is necessary to return to step S5 and select the student's next choice.

[0007] According to the above technical solution, in step S7, after the lottery for all students who have applied to the school is completed, it is also necessary to determine whether the planned quota of the school has been used up. If it has been used up, the process ends directly; if it has not been used up, the process of adjusting the allocation begins.

[0008] According to the above technical solution, the transfer process includes the following steps: Step A1: Sort the remaining student list using a random algorithm; Step A2: Import the schools with unused quotas into the system; Step A3: Select a school choice according to the student's application information and in the order of application. Step A4: Determine if the selected school still has remaining places in its enrollment plan; if so, add the student to the lottery list; if not, determine if it is the last choice in the student's application information; if so, end the process directly; otherwise, select the next choice according to the order of choices. Step A5: Export the list of students selected in the lottery and end the lottery process.

[0009] According to the above technical solution, the student list includes the student's identity information, avoids duplicate items, and uses the combination of name and ID number as the identifier.

[0010] Compared with the prior art, the present invention has the following beneficial effects: The system described in this invention integrates the previously fragmented lottery process, which involved multiple schools and multiple application periods, into a centralized and unified operation. This not only significantly shortens the overall enrollment process but also reduces the organizational and coordination workload and time costs associated with separate school districts and batches of lotteries. Students and parents no longer need to wait for long periods for lottery results from different schools; instead, they can learn about the admission status of all their applications at the same time, which is crucial for them to make timely educational choices and arrangements. Attached Figure Description

[0011] Figure 1 This is a schematic diagram of the lottery process in the lottery system of this invention. Detailed Implementation

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

[0013] Example 1 like Figure 1 As shown in the figure, this embodiment provides a lottery system and method applicable to single-choice and multi-choice scenarios. The specific process is as follows: Step 1, Data Initialization: Import standardized data files through the system interface, including basic student information (name, ID number, and other unique identifiers), application information (choices and their order of preference), and the number of students each school plans to enroll. The data format must conform to the Ministry of Education's Basic Education Enrollment Data Specifications, ensuring the integrity and uniqueness of each field.

[0014] Step 2, Seed Parameter Generation: Using the real-time millisecond-level timestamp (accurate to 1ms) of the user triggering the "Start Lottery" operation as the initial random seed, and combining it with the hash value of the student list for obfuscation processing, irreversible lottery seed parameters are generated to provide a secure entropy source input for subsequent random algorithms.

[0015] Step 3, Random Sorting of the Candidate Set: A secure, encrypted random number generation algorithm (such as the ANSI X9.31 standard pseudo-random number generator) is used to permutate the student list, generating an unordered candidate sequence. This process is implemented through a hardware random number generator or a certified encryption module to ensure the unpredictability and uniform distribution of the sorting results.

[0016] Step 4, Volunteer Information Traversal: Extract student volunteer information sequentially according to the randomly sorted candidate sequence, establish a "student-volunteer queue" mapping relationship, and form an ordered list of each student's volunteers according to the order of submission (such as first volunteer, second volunteer, etc.).

[0017] Step 5, Application Matching Verification: Verify the current student's application list in order of priority: Select the target school corresponding to the nth choice and query the remaining enrollment quota of that school; If the quota is not filled, the student will be included in the target school's pre-admission list, and the corresponding quota will be reduced. If the quota is full, check if it is the last choice: if so, mark it as "not admitted" and end the student's process; otherwise, proceed to the next choice for repeated verification.

[0018] Step 6, Batch Closed-Loop Processing: After verifying all candidate students for the current preferred school, perform a quota balance check: If the school's enrollment quota is full, the application pool will be frozen and processed in the next batch. If there are still remaining places, the transfer process will be triggered (see Implementation Example 2 for transfer logic). Finally, a list of admitted students and a list of unadmitted students will be generated for each school, ensuring data integrity and operational traceability.

[0019] The system described in this invention integrates the previously fragmented lottery process, which involved multiple schools and multiple application periods, into a centralized and unified operation. This not only significantly shortens the overall enrollment process but also reduces the organizational and coordination workload and time costs associated with separate school districts and batches of lotteries. Students and parents no longer need to wait for long periods for lottery results from different schools; instead, they can learn about the admission status of all their applications at the same time, which is crucial for them to make timely educational choices and arrangements.

[0020] Example 2 This embodiment provides a system that supports single-choice and multi-choice lottery selection. Its purpose is to randomly and fairly select qualified candidates from the candidate list through a series of calculations and operations. The system will be further explained below regarding input parameters, calculation rounds, sorting and offsetting, and result acquisition.

[0021] Candidate Identifier List (L): The SHA-256 hash algorithm is used to encrypt the string "Name + ID Number + School Choice + Choice Order" to generate a 256-bit fixed-length hash value as a unique candidate identifier. The formula is as follows: Uniqueness constraint verification is used to exclude duplicate registrations or invalid data.

[0022] The parameter initialization is as follows: Number of candidates (L1): Determined by calculating the length of the candidate identifier list, i.e., the total number of valid candidates, calculated as follows: Number of students selected (L2): determined dynamically based on the enrollment quota of each school.

[0023] Seed value (S): Retrieved from the UNIX timestamp of the system clock, accurate to 1ms; that is: Calculate the round parameter (R): It is calculated based on the seed value S, using the following formula: Ensure the number of rounds dynamically adjusts according to the candidate size, with a minimum of 10 hash iterations. This parameter determines the number of subsequent repeated calculations, used to increase the randomness and complexity of the lottery.

[0024] The randomization layer is specifically as follows: Offset (O): via formula: The calculated offset is used to rearrange the data in subsequent offset rounds, further increasing the randomness of the results.

[0025] Initial Round (V0): For each element v in the candidate identifier list L, the HMAC-SHA256 message authentication code algorithm is used to perform the first round of hashing on the candidate identifier set L with the key. The standard digest algorithm is combined with the seed value S to calculate the initial round result V0, which is mathematically expressed as: An initial hash value sequence is generated, and key correlation is introduced to enhance randomness. The map function here performs an HMAC256 calculation operation on each element in list L.

[0026] Calculation round (Vn): This round of operation is repeated R times. In each round, Vn is calculated by modifying the previous round. Each element v in the algorithm is calculated using the SHA256 standard hash algorithm, i.e. As the number of computation rounds increases, the data undergoes multiple hash calculations and spreads through a multi-layered avalanche effect, making the data distribution approach uniform randomness.

[0027] The sorting and offset processing are as follows: Sorting Round (Vs): Sorts the final result Vn obtained from the calculation round, resulting in the sorted result Vs, expressed as Vs = Vn.sort(). The sorting operation ensures that elements are selected in a specific order in subsequent rounds, guaranteeing the determinism and repeatability of the lottery results.

[0028] Offset wheel (Vo): For the final iteration result V R Sorting by lexicographical order yields an ordered sequence V. s Based on the previously calculated offset O, the sorted result Vo is offset.

[0029] The dynamic offset O is calculated as follows: V s Cut off the portion at position O and join the two halves together, moving the latter half to the front to form a new order. The mathematical expression is: Vo=[...Vo.slice(O),...Vo.slice(0,O)].

[0030] The resulting disordered sequence after cyclic offset eliminates potential biases introduced by sorting. The offset operation disrupts the original order, further increasing the randomness of the lottery results.

[0031] The result round (Vr): Based on the sorted result after offset, the first L2 elements are taken as the final lottery result, i.e., Vr = Vo.slice(0, L2). The student identifier is retrieved in reverse by hash value to generate the final admission list.

[0032] The adjustment process is implemented as follows: When a school's enrollment plan is not fulfilled, a second matching process is initiated. Unsuccessful students will be randomly re-ranked and included in the transfer candidate pool. The remaining schools are traversed, and a second matching is performed according to the principle of "priority of choice + random sorting" until the plan is full or there are no valid choices.

[0033] This embodiment ensures that the results meet the requirements of uniformity, independence, and unpredictability by using a cryptographic hash algorithm chain, dynamic parameter configuration, and multi-layer randomization processing.

[0034] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.

[0035] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A lottery system for single-choice and multi-choice placement, characterized in that: Includes the following steps: Step S1: Import the student list, the student preferences corresponding to the student list, and the school's enrollment plan. Step S2: Set the lottery seed based on the student list and the student preferences corresponding to the student list; Step S3: Randomly sort the student list using a random algorithm; Step S4: Obtain the student's volunteer information according to the randomly sorted student list; Step S5: Select a school choice according to the order of the student's choices based on their application information; Step S6: Determine whether the selected school still has remaining places in its enrollment plan; if so, add the student to the lottery list; if not, determine whether it is the last choice in the student's application information. Step S7: Determine if this is the last student to fill in the application for this school. If yes, output the list of students who were selected. If not, select the next student for the lottery.

2. The lottery system for single-choice and multi-choice placement according to claim 1, characterized in that: In step S2, the lottery seed is the millisecond time when the start lottery button is clicked.

3. A lottery system for single-choice and multi-choice placement according to claim 2, characterized in that: In step S6, determining whether it is the last choice in the student's application information specifically involves: If it is the last choice in the student's application information, it means that all of the student's choices have been selected, and the lottery ends; otherwise, it is necessary to return to step S5 and select the student's next choice.

4. A lottery system for single-choice and multi-choice placement according to claim 3, characterized in that: In step S7, after all students who have applied to the school have completed the lottery, it is necessary to determine whether the school's planned quota has been used up. If it has been used up, the process ends directly; if it has not been used up, the process of adjusting the allocation will begin.

5. A lottery system for single-choice and multi-choice placement according to claim 4, characterized in that: The transfer process includes the following steps: Step A1: Sort the remaining student list using a random algorithm; Step A2: Import the schools with unused quotas into the system; Step A3: Select a school choice according to the student's application information and in the order of application. Step A4: Determine if the selected school still has remaining places in its enrollment plan; if so, add the student to the lottery list; if not, determine if this is the last choice in the student's application information; if so, end the process directly; otherwise, select the next choice according to the order of choices. Step A5: Export the list of students selected in the lottery and end the lottery process.

6. A lottery system for single-choice and multi-choice placement according to claim 5, characterized in that: The student list includes students' identity information, and to avoid duplicate entries, it uses a combination of name and ID number as the identifier.