Resource allocation method
By generating supply and demand queues and using blockchain evidence storage information to disclose supply and demand information, and using the hash allocation method for public random number service within the random allocation time range, the problem of unfair resource allocation and high cost is solved, a fair and auditable resource allocation process is realized, and the ticket booking experience is improved.
Patent Information
- Application Number
- CN202410092172.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-23
- Publication Date
- 2025-07-25
AI Technical Summary
There are problems of unfairness, high cost and poor experience in the existing resource allocation methods. Especially when ticketing resources are in short supply, bookers need to wait highly nervously for ticket grabbing at a fixed time point, and the success rate is low.
The resource allocation system generates a set of supply and demand queues and supply and demand queues, uses blockchain evidence storage information to disclose supply and demand information, and uses the public random number service hash allocation method to allocate within the random allocation time range, and is allocated in the order of demand information within the queue allocation time range.
It realizes the fairness of resource allocation and public auditability, reduces system operation costs, improves ticket booking experience, and reduces ticket booking anxiety.
Smart Images

Figure CN120373680A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computers, and particularly to a method for allocating public resources through online ordering. Background Art
[0002] Currently, the online ticketing system has facilitated the ticketing process for people. However, in the case of a shortage of ticket resources, how to solve the problems of unfair distribution of ticket resources, high costs, and poor experience has become a difficult problem. For example, during the Spring Festival travel rush, the supply of train tickets falls short of demand. People need to go to the official website 12306 to select the train number, seat type, etc., and then participate in the ticket grabbing at the designated ticket selling time point. Only a very small number of ticket purchasers who place their orders earliest can obtain train tickets. Most ticket purchasers who fail to get tickets may try to book tickets again. Due to the above reasons, the official website 12306 will experience a large number of visits and high concurrency in a short period of time. Therefore, a large amount of cost is required to allocate a large number of server resources to ensure the normal operation of the official website 12306. Since ticket purchasers need to abandon other daily work and life affairs and wait nervously at the fixed ticket release time point with a high probability of failure, the ticketing experience is very poor. Summary of the Invention
[0003] The technical problem to be solved by the present invention is to provide a resource allocation method. This method can solve the technical problems of unfairness, high cost, and poor experience existing in the existing resource allocation methods.
[0004] The method steps include: The resource provider submits supply information, where the supply information includes supply time, supply model, supply quantity, random allocation time range, public random number service hash allocation method, and queuing allocation time range; The resource consumer submits demand information, where the demand information includes demand time range, demand model range, and demand quantity; The resource allocation system generates a supply-demand queue, a set of supply-demand queues, and blockchain deposit information based on the information submitted by the provider and the consumer, and discloses the supply-demand queue, the set of supply-demand queues, and the blockchain deposit information; The resource allocation system performs random allocation within the random allocation time range according to the supply-demand queue and the set of supply-demand queues using the public random number service hash allocation method; The resource allocation system performs allocation according to the queuing order of the demand information in the supply-demand queue within the queuing allocation time range.
[0005] This method solves the problems of non-disclosure, untrustworthiness, and difficult auditing of supply-demand information in resource allocation by disclosing the supply-demand information and blockchain deposit information. This method solves the problems of unfairness, high cost, and poor experience by increasing the random allocation time range and using the public random number service hash allocation method. Brief Description of the Drawings
[0006] The accompanying drawings described herein are used to provide a further understanding of the present disclosure and form a part of this application. The illustrative embodiments of the present disclosure and their descriptions are used to explain the present disclosure and do not constitute an improper limitation of the present disclosure. In the drawings: Figure 1 is a schematic flowchart of a resource allocation method according to the present application; Detailed implementation manners
[0007] In order to enable those skilled in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those of ordinary skill in the art without making creative efforts shall fall within the scope of protection of the present disclosure.
[0008] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned accompanying drawings are used to distinguish similar objects and do not necessarily need to describe a specific order or sequence. It should be understood that such used data may be interchanged under appropriate circumstances so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these process, method, product or device.
[0009] Now, taking the example of a consumer ordering a train ticket through the network, the specific steps include: Step 1: The resource provider submits supply information. Shanghai Railway Bureau released the supply information of train tickets from Shanghai to Beijing on 12306 on January 18, 2024, including: Train G6 departing at 8:00 am on February 4, 2024, passing through Nanjing and Jinan, with 2 first-class seats from Shanghai to Beijing directly, 3 second-class seats from Shanghai to Beijing directly, and 4 second-class seats from Nanjing to Jinan; Train G8 departing at 9:00 am on February 4, 2024, with 3 second-class seats from Shanghai to Beijing directly. The specified reservation start time for both Train G6 and G8 on February 4, 2024, is 8:00 am on January 19, 2024, and the random allocation time range is January 20, 2024. The public random number service hash allocation method uses the random seed produced by the public random number service provided by the National Institute of Standards and Technology at 10:00 am on January 20, 2024 (https: / / csrc.nist.gov / projects / interoperable-randomness-beacons / beacon-20) and the random number hash cyclic skip code table with the information digest of e12bcb0180e75e7c29173809cb53173d64b28eb860b7404fbf4a3c2976d1eed3 (https: / / www.12306.cn / randomNoHash.txt, this website is only for illustration, and the network file is a data table in which the set of consecutive integers from 1 to 2 to the 28th power is randomly arranged, with one integer placed in each line of the randomNoHash.txt file, and there are 268435456 lines). The start time of queue allocation is 8:00 am on January 21, 2024, and the end time of queue allocation is 20 minutes before the train departs.
[0010] Step 2: The resource consumer submits demand information. Between 8:00 am on January 19, 2024, and 8:00 am on January 20, 2024, 18 consumers submitted demand order information. The demand information of specific train ticket reservation consumers is in JSON data format as follows: {user ID: user01, last 3 digits of mobile phone number: 001, demand time range: between 8:00 am and 9:00 am on February 4, 2024, range of train number and seat class of demand model: [G6 first-class seat, G6 second-class seat, G8 second-class seat], station of demand model: from Shanghai to Beijing directly, demand quantity: 2}, {user ID: user02, last 3 digits of mobile phone number: 002, demand time range: between 8:00 am and 9:00 am on February 4, 2024, range of train number and seat class of demand model: [G6 first-class seat, G6 second-class seat, G8 second-class seat], station of demand model: from Shanghai to Beijing directly, demand quantity: 2}, {User ID: user03, Last 3 digits of mobile phone number: 003, Demand time range: Between 8:00 am and 9:00 am on February 4, 2024, Range of train seat classes for demand models: [First-class seat on G6, Second-class seat on G6, Second-class seat on G8], Stations for demand models: Direct from Shanghai to Beijing, Demand quantity: 2}, {User ID: user04, Last 3 digits of mobile phone number: 004, Demand time range: 8:00 am on February 4, 2024, Range of train seat classes for demand models: [First-class seat on G6], Stations for demand models: Direct from Shanghai to Beijing, Demand quantity: 1}, {User ID: user05, Last 3 digits of mobile phone number: 005, Demand time range: 8:00 am on February 4, 2024, Range of train seat classes for demand models: [First-class seat on G6], Stations for demand models: Direct from Shanghai to Beijing, Demand quantity: 1}, {User ID: user06, Last 3 digits of mobile phone number: 006, Demand time range: 8:00 am on February 4, 2024, Range of train seat classes for demand models: [First-class seat on G6], Stations for demand models: Direct from Shanghai to Beijing, Demand quantity: 1}, {User ID: user07, Last 3 digits of mobile phone number: 007, Demand time range: Between 8:00 am and 9:00 am on February 4, 2024, Range of train seat classes for demand models: [Second-class seat on G6, Second-class seat on G8], Stations for demand models: Direct from Shanghai to Beijing, Demand quantity: 1}, {User ID: user08, Last 3 digits of mobile phone number: 008, Demand time range: Between 8:00 am and 9:00 am on February 4, 2024, Range of train seat classes for demand models: [Second-class seat on G6, Second-class seat on G8], Stations for demand models: Direct from Shanghai to Beijing, Demand quantity: 1}, {User ID: user09, Last 3 digits of mobile phone number: 009, Demand time range: Between 8:00 am and 9:00 am on February 4, 2024, Range of train seat classes for demand models: [Second-class seat on G6, Second-class seat on G8], Stations for demand models: Direct from Shanghai to Beijing, Demand quantity: 1}, {User ID: user10, Last 3 digits of mobile phone number: 010, Demand time range: 8:00 am on February 4, 2024, Range of train seat classes for demand models: [Second-class seat on G6], Stations for demand models: From Nanjing to Jinan, Demand quantity: 2}, {User ID: user11, Last 3 digits of mobile phone number: 011, Demand time range: 8:00 am on February 4, 2024, Range of train seat classes for demand models: [Second-class seat on G6], Stations for demand models: From Nanjing to Jinan, Demand quantity: 2}, {User ID: user12, Last 3 digits of mobile phone number: 012, Demand time range: 8:00 AM, February 4, 2024, Train seat class range of demand model: [G6 second-class seat], Station of demand model: From Nanjing to Jinan, Demand quantity: 2}, {User ID: user13, Last 3 digits of mobile phone number: 013, Demand time range: 8:00 AM, February 4, 2024, Train seat class range of demand model: [G6 second-class seat], Station of demand model: From Nanjing to Jinan, Demand quantity: 2}, {User ID: user14, Last 3 digits of mobile phone number: 014, Demand time range: 8:00 AM, February 4, 2024, Train seat class range of demand model: [G6 second-class seat], Station of demand model: From Nanjing to Jinan, Demand quantity: 1}, {User ID: user15, Last 3 digits of mobile phone number: 015, Demand time range: 8:00 AM, February 4, 2024, Train seat class range of demand model: [G6 second-class seat], Station of demand model: From Nanjing to Jinan, Demand quantity: 1}, {User ID: user16, Last 3 digits of mobile phone number: 016, Demand time range: 9:00 AM, February 4, 2024, Train seat class range of demand model: [G8 second-class seat], Station of demand model: From Shanghai to Beijing directly, Demand quantity: 1}, {User ID: user17, Last 3 digits of mobile phone number: 017, Demand time range: 9:00 AM, February 4, 2024, Train seat class range of demand model: [G8 second-class seat], Station of demand model: From Shanghai to Beijing directly, Demand quantity: 1}, {User ID: user18, Last 3 digits of mobile phone number: 018, Demand time range: 9:00 AM, February 4, 2024, Train seat class range of demand model: [G8 second-class seat], Station of demand model: From Shanghai to Beijing directly, Demand quantity: 2} 。
[0011] Step 3: At 9:00 AM on January 20, 2024, the 12306 ticketing system generates a supply-demand queue, a supply-demand queue set, and blockchain deposit information based on the supply and demand information, and publicly discloses the supply-demand queue, the supply-demand queue set, and the blockchain deposit information. First, generate 4 supply-demand queues, represented in JSON data format: { Supply-demand queue number: 1, Supply information: 2 tickets for G6 first-class seat from Shanghai to Beijing directly at 8:00 AM on February 4, 2024, Demand list: {User ID: user01, last 3 digits of mobile phone number: 001, required quantity: 2}, {User ID: user02, last 3 digits of mobile phone number: 002, required quantity: 2}, {User ID: user03, last 3 digits of mobile phone number: 003, required quantity: 2}, {User ID: user04, last 3 digits of mobile phone number: 004, required quantity: 1}, {User ID: user05, last 3 digits of mobile phone number: 005, required quantity: 1}, {User ID: user06, last 3 digits of mobile phone number: 006, required quantity: 1} }, { Supply - demand queue number: 2, Supply information: 3 tickets for second - class seat on G6 from Shanghai to Beijing directly at 8:00 am on February 4, 2024, Demand list: {User ID: user01, last 3 digits of mobile phone number: 001, required quantity: 2}, {User ID: user02, last 3 digits of mobile phone number: 002, required quantity: 2}, {User ID: user03, last 3 digits of mobile phone number: 003, required quantity: 2}, {User ID: user07, last 3 digits of mobile phone number: 007, required quantity: 1}, {User ID: user08, last 3 digits of mobile phone number: 008, required quantity: 1}, {User ID: user09, last 3 digits of mobile phone number: 009, required quantity: 1} }, { Supply - demand queue number: 3, Supply information: 4 tickets for second - class seat on G6 from Nanjing to Jinan at 8:00 am on February 4, 2024, Demand list: {User ID: user10, last 3 digits of mobile phone number: 010, required quantity: 2}, {User ID: user11, last 3 digits of mobile phone number: 011, required quantity: 2}, {User ID: user12, last 3 digits of mobile phone number: 012, required quantity: 2}, {User ID: user13, last 3 digits of mobile phone number: 013, required quantity: 2}, {User ID: user14, last 3 digits of mobile phone number: 014, required quantity: 1}, {User ID: user15, last 3 digits of mobile phone number: 015, required quantity: 1} }, { Supply - demand queue number: 4, Supply information: 3 tickets for second - class seat on G8 from Shanghai to Beijing directly at 9:00 am on February 4, 2024, Demand list: {User ID: user01, last 3 digits of mobile phone number: 001, required quantity: 2}, {User ID: user02, last 3 digits of mobile phone number: 002, required quantity: 2}, {User ID: user03, last 3 digits of mobile phone number: 003, required quantity: 2}, {User ID: user07, last 3 digits of mobile phone number: 007, required quantity: 1}, {User ID: user08, last 3 digits of mobile phone number: 008, required quantity: 1}, {User ID: user09, last 3 digits of mobile phone number: 009, required quantity: 1}, {User ID: user16, last 3 digits of mobile phone number: 016, required quantity: 1}, {User ID: user17, last 3 digits of mobile phone number: 017, required quantity: 1}, {User ID: user18, last 3 digits of mobile phone number: 018, required quantity: 2} }。
[0012] Then the set of supply - demand queues is represented as an array in JSON data format: [{Supply - demand queue number: 1}, {Supply - demand queue number: 2}, {Supply - demand queue number: 3}, {Supply - demand queue number: 4}].
[0013] Then, use the national cryptographic SM3 information digest algorithm to calculate the file information digest of the file containing the text content of each supply and demand queue respectively. The file information digest of the file containing the text content of supply and demand queue number 1 is 31806e57db59bfecb3b65bd185820330a1e69883d126d40d14d289646b539353. The file information digest of the file containing the text content of supply and demand queue number 2 is 39ae4e59c71468224a89b463d3b015075f6c2c9500b98993448451bd2e6d2947. The file information digest of the file containing the text content of supply and demand queue number 3 is 5e59ed66056cca0e2ff08e261bcd78cb31d8335bef9ad287600daf350775fce9. The file information digest of the file containing the text content of supply and demand queue number 4 is f838ea97d418cd8d9a576e4c6cecbe9c85588bccc28c5ca5cd7fb1c220f19ce9.
[0014] Then generate the text in JSON data format to be stored on the blockchain as follows: { Supply information: "The Shanghai Railway Bureau released the train ticket supply information from Shanghai to Beijing on 12306 on January 18, 2024, including: Train G6 departing at 8:00 am on February 4, 2024, with 2 first-class tickets from Shanghai to Beijing and 3 second-class tickets from Shanghai to Beijing, and 4 second-class tickets from Nanjing to Jinan; Train G8 departing at 9:00 am on February 4, 2024, with 3 second-class tickets from Shanghai to Beijing. The designated booking start time for both Train G6 and Train G8 on February 4, 2024, is 8:00 am on January 19, 2024, and the random allocation time range is January 20, 2024. The public random number service hash allocation method uses the random seed produced by the public random number service provided by the National Institute of Standards and Technology of the United States at 10:00 am on January 20, 2024 (https: / / csrc.nist.gov / projects / interoperable-randomness-beacons / beacon-20) and the random number hash loop jump code table with the information digest of e12bcb0180e75e7c29173809cb53173d64b28eb860b7404fbf4a3c2976d1eed3. The start time of queuing allocation is 8:00 am on January 21, 2024, and the end time of queuing allocation is 20 minutes before the train departs.", Supply and demand queue collection information summary: [{Supply and demand queue number: 1, information summary: 31806e57db59bfecb3b65bd185820330a1e69883d126d40d14d289646b539353}, {Supply and demand queue number: 2, information summary: 39ae4e59c71468224a89b463d3b015075f6c2c9500b98993448451bd2e6d 2947},{Supply and demand queue number: 3, information summary: 5e59ed66056cca0e2ff08e261bcd78cb31d8335bef9ad287600daf350775fce9},{Supply and demand queue number: 4, information summary: f838ea97d418cd8d9a576e4c6cecbe9c85588bccc28c5ca5cd7fb1c220f19ce9}], Allocation method: "Use the last seven digits of the outPutValue field of the data returned by https: / / beacon.nist.gov / / beacon / 2.0 / pulse / time / 1705716000000 as the random seed and convert it into decimal N. Starting from the N+1th row (inclusive) in the random number hash cyclic hopping code table, extract the same number of hash random numbers as the number of elements in the longest supply and demand queue (because the maximum value of the random number range 268435456 cannot be divided by the longest supply and demand queue length 9, there is a problem that the demand information in the front has an advantage, and the hash value greater than 268435456 needs to be eliminated. The hash number of 35449, the number of hash random numbers after elimination is equal to the longest supply and demand queue length 9. If the number drawn to the end of the random number hash cyclic hopping code table is insufficient, continue to draw from the first row of the random number hash cyclic hopping code table). These hash random numbers are allocated to each demand information in the supply and demand queue in order. Then sort them from small to large according to the random value of each demand information. Then allocate them in order according to the queue order in the supply and demand queue set. If it is found during the allocation process that the demand has been allocated by the previous queue, it will not be allocated. After the queue allocation start time, the new ticket purchase demand is added to the end of the supply and demand queue, and the allocation is made from the head of the queue. " }.
[0015] Then, the information digest of the JSON data format text that needs to be stored in the blockchain is calculated using the national secret SM3 information digest algorithm, which is eb5e5ba56af35df11e37ffdbaa552baadfedba90ae1f09e451d0521549a6963e.
[0016] Then, conduct judicial deposit evidence on the Baidu Blockchain Platform (https: / / xuper.baidu.com / ) for eb5e5ba56af35df11e37ffdbaa552baadfedba90ae1f09e451d0521549a6963e and generate a deposit evidence certificate with a certificate number of 69aab47c40aec8bc75a23ef5763ce28db166e9edbaca5ae0e8b85b8900222548. The public and third-party law enforcement and auditing departments can query and verify supply and demand information at any time through this certificate number at https: / / xuper.baidu.com / n / verify.
[0017] Then, publicize all supply and demand queues, supply and demand queue sets, and blockchain deposit evidence information in the third step on the 12306 platform before 9:30 am on January 20, 2024.
[0018] In the fourth step, at 10:01 am on January 20, 2024, conduct random allocation according to the supply and demand queues and supply and demand queue sets using the public random number service hashing allocation method. The 12306 system obtains the random number corresponding to 10:00 am on January 20, 2024, which is D913973014564FD7A3657A9804EF43A81409B0F6559856A5D6BB23C33E284EAFE3B8902758FA026392C6D3F23397EBFCAF26875C399A4425DA2141E2DFFFFFFE, from the official website of the National Institute of Standards and Technology of the United States at the network data interface address https: / / beacon.nist.gov / / beacon / 2.0 / pulse / time / 1705716000000.
[0019] Convert the last 7 bits of the 512-bit hexadecimal representation data (2 to the 28th power, corresponding to the amount of data in the random number hash loop skip code table in the first step) FFFFFFFD to the decimal integer 268435454. Then, from the random number hash loop skip code table with the message digest e12bcb0180e75e7c29173809cb53173d64b28eb860b7404fbf4a3c2976d1eed3, remove the random numbers on the 268435455th row (corresponding to the decimal value of FFFFFFFD, starting from 0 and the random number hash loop skip code table starting from the first row, so 1 needs to be added), the random number 70057484, the random number 211710438 on the 268435456th row, the random number 31594772 on the 1st row, the random number 55699475 on the 2nd row, the random number 21800843 on the 3rd row, the random number 201525433 on the 4th row, the random number 37419295 on the 5th row, the random number 268435455 on the 6th row (due to the problem that the maximum value of the random number range 268435456 cannot be divided evenly by the longest supply-demand queue length 9, resulting in an advantage for the demand information ranked in the front, so remove the hash numbers with hash values greater than 268435449), the random number 3830864 on the 7th row, and the random number 20920437 on the 8th row, a total of 9 numbers (consistent with the longest supply-demand queue length). After allocating these 9 numbers to the supply-demand queue, the JSON data format for supply-demand queue number 1 is: { Supply-demand queue number: 1, Supply information: 2 first-class seat tickets from Shanghai to Beijing directly on G6 at 8:00 am on February 4, 2024, Demand list: {User ID: user01, last 3 digits of mobile phone number: 001, demand quantity: 2, random number: 70057484}, {User ID: user02, last 3 digits of mobile phone number: 002, demand quantity: 2, random number: 211710438}, {User ID: user03, last 3 digits of mobile phone number: 003, demand quantity: 2, random number: 31594772}, {User ID: user04, last 3 digits of mobile phone number: 004, demand quantity: 1, random number: 55699475}, {User ID: user05, last 3 digits of mobile phone number: 005, demand quantity: 1, random number: 21800843}, {User ID: user06, last 3 digits of mobile phone number: 006, demand quantity: 1, random number: 201525433} }}。
[0020] After sorting the random numbers in ascending order, the JSON data format is as follows: { Supply and demand queue number: 1, Supply information: 2 tickets for first-class seat of G6 from Shanghai to Beijing directly at 8:00 am on February 4, 2024, Demand list: {User ID: user05, last 3 digits of mobile phone number: 005, demand quantity: 1, random number: 21800843}, {User ID: user03, last 3 digits of mobile phone number: 003, demand quantity: 2, random number: 31594772}, {User ID: user04, last 3 digits of mobile phone number: 004, demand quantity: 1, random number: 55699475}, {User ID: user01, last 3 digits of mobile phone number: 001, demand quantity: 2, random number: 70057484}, {User ID: user06, last 3 digits of mobile phone number: 006, demand quantity: 1, random number: 201525433}, {User ID: user02, last 3 digits of mobile phone number: 002, demand quantity: 2, random number: 211710438} }。
[0021] Then, the 2 tickets for first-class seat of G6 from Shanghai to Beijing directly at 8:00 am on February 4, 2024 are allocated to user05 and user04.
[0022] The JSON data format of the supply and demand queue numbered 2 is as follows: { Supply and demand queue number: 2, Supply information: 3 tickets for second-class seat of G6 from Shanghai to Beijing directly at 8:00 am on February 4, 2024, Demand list: {User ID: user01, last 3 digits of mobile phone number: 001, demand quantity: 2, random number: 70057484}, {User ID: user02, last 3 digits of mobile phone number: 002, demand quantity: 2, random number: 211710438}, {User ID: user03, last 3 digits of mobile phone number: 003, demand quantity: 2, random number: 31594772}, {User ID: user07, last 3 digits of mobile phone number: 007, demand quantity: 1, random number: 55699475}, {User ID: user08, last 3 digits of mobile phone number: 008, required quantity: 1, random number: 21800843}, {User ID: user09, last 3 digits of mobile phone number: 009, required quantity: 1, random number: 201525433} }。
[0023] After sorting in ascending order of random numbers, the JSON data format is: { Supply - demand queue number: 2, Supply information: 3 tickets for second - class seat on G6 from Shanghai to Beijing directly at 8:00 am on February 4, 2024, Demand list: {User ID: user08, last 3 digits of mobile phone number: 008, required quantity: 1, random number: 21800843}, {User ID: user03, last 3 digits of mobile phone number: 003, required quantity: 2, random number: 31594772}, {User ID: user07, last 3 digits of mobile phone number: 007, required quantity: 1, random number: 55699475}, {User ID: user01, last 3 digits of mobile phone number: 001, required quantity: 2, random number: 70057484}, {User ID: user09, last 3 digits of mobile phone number: 009, required quantity: 1, random number: 201525433}, {User ID: user02, last 3 digits of mobile phone number: 002, required quantity: 2, random number: 211710438} }。
[0024] Then, allocate 3 tickets for second - class seat on G6 from Shanghai to Beijing directly at 8:00 am on February 4, 2024 to user08 and user03 who are at the front of the queue.
[0025] The JSON data format for supply - demand queue number 3 is: { Supply - demand queue number: 3, Supply information: 4 tickets for second - class seat on G6 from Nanjing to Jinan at 8:00 am on February 4, 2024, Demand list: {User ID: user10, last 3 digits of mobile phone number: 010, required quantity: 2, random number: 70057484}, {User ID: user11, last 3 digits of mobile phone number: 011, required quantity: 2, random number: 211710438}, {User ID: user12, last 3 digits of mobile phone number: 012, required quantity: 2, random number: 31594772}, {User ID: user13, last 3 digits of mobile phone number: 013, required quantity: 2, random number: 55699475}, {User ID: user14, last 3 digits of mobile phone number: 014, required quantity: 1, random number: 21800843}, {User ID: user15, last 3 digits of mobile phone number: 015, required quantity: 1, random number: 201525433} }。
[0026] After sorting in ascending order of the random number, the JSON data format is as follows: { Supply and demand queue number: 3, Supply information: 4 tickets for second-class seat of G6 from Nanjing to Jinan at 8:00 am on February 4, 2024, Demand list: {User ID: user14, last 3 digits of mobile phone number: 014, required quantity: 1, random number: 21800843}, {User ID: user12, last 3 digits of mobile phone number: 012, required quantity: 2, random number: 31594772}, {User ID: user13, last 3 digits of mobile phone number: 013, required quantity: 2, random number: 55699475}, {User ID: user10, last 3 digits of mobile phone number: 010, required quantity: 2, random number: 70057484}, {User ID: user15, last 3 digits of mobile phone number: 015, required quantity: 1, random number: 201525433}, {User ID: user11, last 3 digits of mobile phone number: 011, required quantity: 2, random number: 211710438} }。
[0027] Then allocate the 4 tickets for second-class seat of G6 from Nanjing to Jinan at 8:00 am on February 4, 2024 to user14, user12, and user15 who are at the front of the queue.
[0028] After deleting user03 and user08 that have been allocated in supply-demand queue number 2, the JSON data format of supply-demand queue number 4 is as follows: { Supply-demand queue number: 4, Supply information: 3 tickets for second-class seat of G8 from Shanghai to Beijing directly at 9:00 am on February 4, 2024, Demand list: {User ID: user01, last 3 digits of mobile phone number: 001, demand quantity: 2, random number: 70057484}, {User ID: user02, last 3 digits of mobile phone number: 002, demand quantity: 2, random number: 211710438}, {User ID: user07, last 3 digits of mobile phone number: 007, demand quantity: 1, random number: 31594772}, {User ID: user09, last 3 digits of mobile phone number: 009, demand quantity: 1, random number: 55699475}, {User ID: user16, last 3 digits of mobile phone number: 016, demand quantity: 1, random number: 21800843}, {User ID: user17, last 3 digits of mobile phone number: 017, demand quantity: 1, random number: 201525433}, {User ID: user18, last 3 digits of mobile phone number: 018, demand quantity: 2, random number: 37419295} [[ID=26}}.
[0029] After sorting in ascending order of random numbers, the JSON data format is as follows: { Supply-demand queue number: 4, Supply information: 3 tickets for second-class seat of G8 from Shanghai to Beijing directly at 9:00 am on February 4, 2024, Demand list: {User ID: user16, last 3 digits of mobile phone number: 016, demand quantity: 1, random number: 21800843}, {User ID: user07, last 3 digits of mobile phone number: 007, demand quantity: 1, random number: 31594772}, {User ID: user18, last 3 digits of mobile phone number: 018, demand quantity: 2, random number: 37419295}, {User ID: user09, last 3 digits of mobile phone number: 009, demand quantity: 1, random number: 55699475}, {User ID: user01, last 3 digits of mobile phone number: 001, required quantity: 2, random number: 70057484}, {User ID: user17, last 3 digits of mobile phone number: 017, required quantity: 1, random number: 201525433}, {User ID: user02, last 3 digits of mobile phone number: 002, required quantity: 2, random number: 211710438} }。
[0030] Then, at 9:00 am on February 4, 2024, 3 second-class seat tickets of G8 from Shanghai to Beijing directly are allocated to user16, user07, and user09 who are at the front of the queue.
[0031] Then, the 12306 system notifies consumers user05, user04, user08, user03, user14, user12, user15, user16, user07, and user09 to make payment in time within 12 hours, otherwise the ticket resources will be recycled.
[0032] Step 5: The 12306 system makes allocations according to the queuing order of the demand information in the demand queue after random sorting within the queuing and allocation time range (from 8:00 am on January 21, 2024 to 20 minutes before the train departs). After deleting the demand information of the allocated train tickets in the supply-demand queue in the fourth step, the JSON format data of the supply-demand queue is as follows: { Supply-demand queue number: 1, Supply information: 2 first-class seat tickets of G6 from Shanghai to Beijing directly at 8:00 am on February 4, 2024, Demand list: {User ID: user01, last 3 digits of mobile phone number: 001, required quantity: 2}, {User ID: user06, last 3 digits of mobile phone number: 006, required quantity: 1}, {User ID: user02, last 3 digits of mobile phone number: 002, required quantity: 2} }, { Supply-demand queue number: 2, Supply information: 3 second-class seat tickets of G6 from Shanghai to Beijing directly at 8:00 am on February 4, 2024, Demand list: {User ID: user01, last 3 digits of mobile phone number: 001, required quantity: 2}, {User ID: user02, last 3 digits of mobile phone number: 002, required quantity: 2} }, { Supply and demand queue number: 3, Supply information: 4 tickets for second-class seat of G6 from Nanjing to Jinan arriving at 8:00 am on February 4, 2024, Demand list: {User ID: user13, last 3 digits of mobile phone number: 013, required quantity: 2}, {User ID: user10, last 3 digits of mobile phone number: 010, required quantity: 2}, {User ID: user11, last 3 digits of mobile phone number: 011, required quantity: 2} }, { Supply and demand queue number: 4, Supply information: 3 tickets for second-class seat of G8 direct from Shanghai to Beijing at 9:00 am on February 4, 2024, Demand list: {User ID: user18, last 3 digits of mobile phone number: 018, required quantity: 2}, {User ID: user01, last 3 digits of mobile phone number: 001, required quantity: 2}, {User ID: user17, last 3 digits of mobile phone number: 017, required quantity: 1}, {User ID: user02, last 3 digits of mobile phone number: 002, required quantity: 2} }.
[0033] If there are new consumers who want to buy tickets, they will be added to the end of the corresponding supply and demand queue. During the queuing allocation time, if there are ticket refunds or temporary addition of carriages, the allocation will be made from the head of the queue according to the queuing order. If the number of train tickets in the supply ticket queue is greater than the required quantity, the consumer can complete the ticket purchase process immediately without waiting in line.
[0034] Through the above specific implementation manners, the invention solves the problems of non-disclosure and untrustworthiness of supply and demand information in resource allocation by disclosing supply and demand information and blockchain deposit information. By adding a random allocation time range and using a public random number service hashing allocation method, the invention greatly improves the fairness of ticket purchasing. It is easy for the public and third-party law enforcement departments to conduct full-process verification and auditing of ticket purchasing based on the disclosed information. Since there is no ticket grabbing link in the invention, the sudden load on the 12306 system is greatly reduced, thereby greatly reducing the operating cost, improving the system stability and reducing the social transaction cost. Consumers purchasing train tickets do not need to arrange extra time to participate in ticket grabbing highly nervously throughout the process. They can purchase tickets fairly based on luck and queuing order, effectively alleviating consumer anxiety and enhancing the sense of fairness and experience of ticket purchasing.
[0035] The above are only the preferred implementation manners of the present invention. It should be noted that for those of ordinary skill in the art in this technical field, without departing from the principle of the present invention, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present invention.
Claims
1. A resource allocation method, characterized in that, Including: The resource provider submits supply information, where the supply information includes supply time, supply model, supply quantity, randomly allocated time range, common random number service hash allocation method, queuing allocation time range; The resource consumer submits demand information, where the demand information includes demand time range, demand model range, demand quantity; The resource allocation system generates a supply-demand queue, a set of supply-demand queues, and blockchain deposit information based on the information submitted by the provider and the consumer, and discloses the supply-demand queue, the set of supply-demand queues, and the blockchain deposit information; The resource allocation system performs random allocation within the randomly allocated time range using the common random number service hash allocation method based on the supply-demand queue and the set of supply-demand queues; The resource allocation system performs allocation in the queuing allocation time range according to the queuing order of the demand information in the supply-demand queue.
2. The method according to claim 1, wherein The supply-demand queue refers to an ordered queue composed of all demand information that matches the preset supply time and supply model, and the set of supply-demand queues refers to a set composed of supply-demand queues.
3. The method according to claim 1, characterized in that, The common random number service hash allocation method includes: specifying a set of common random number service time points to be used within the randomly allocated time range and a random number hash cyclic skip code table, reordering the demand information in the supply-demand queue according to the random seed generated by the common random number service at the specified time point and the random number hash cyclic skip code table, and performing resource allocation according to the queuing order of the demand information in the set of supply-demand queues and the reordered supply-demand queue.
4. The method according to claim 1, wherein The method for generating the blockchain deposit information includes: first calculating the information digest of each supply-demand queue in the set of supply-demand queues respectively, then calculating the information digest S2 of the file composed of the above one or more information digests, and sending the information digest S2 to the blockchain deposit node for deposit.
5. The method according to claim 3, characterized in that, The random number hash cyclic skip code table is a data structure formed by randomly hashing a set of integers within a continuous range and connecting the head and tail.