Online real-time lottery system and method based on lottery mode

文档序号:1847845 发布日期:2021-11-16 浏览:17次 中文

阅读说明:本技术 一种基于抽牌模式的在线实时抽奖系统与方法 (Online real-time lottery system and method based on lottery mode ) 是由 钱久义 徐琪 于 2021-07-01 设计创作,主要内容包括:本发明提供一种基于抽牌模式的在线实时抽奖系统与方法,系统由用户抽奖模块,抽奖请求监控模块和中奖号码生成模块三部分组成。该系统抽奖方法包括:用户通过抽奖模块选择抽奖号码;抽奖请求监控模块监控到抽奖列队中有抽奖请求时,中奖号码生成模块启动抽奖程序;中奖号码生成模块根据抽奖概率设置抽奖号码种类,生成抽奖号码原始表;中奖号码生成模块通过洗牌算法产生抽奖号码随机排序表;中奖号码生成模块通过真随机间隔种子产生抽奖间隔序列;中奖号码生成模块根据生成的抽奖间隔序列从抽奖号码随机排序表中抽出中奖号码,产生中奖号码序列;抽奖请求监控模块将中奖结果返回给抽奖模块;抽奖模块根据中奖结果通知用户是否中奖,公布中奖结果。(The invention provides an online real-time lottery system and method based on a lottery mode. The lottery drawing method of the system comprises the following steps: the user selects a lottery number through the lottery module; when the lottery request monitoring module monitors that a lottery request exists in the lottery queue, the lottery number generating module starts a lottery program; the lottery number generation module sets the type of the lottery numbers according to the lottery probability and generates a lottery number original table; the winning number generation module generates a random ranking table of the lottery numbers by a shuffling algorithm; the winning number generation module generates a lottery interval sequence through the true random interval seeds; the lottery number generation module extracts lottery numbers from the lottery number random sorting table according to the generated lottery interval sequence to generate a lottery number sequence; the lottery drawing request monitoring module returns the winning result to the lottery drawing module; and the lottery module informs the user whether the user wins the prize according to the winning result and publishes the winning result.)

1. A computer-based online true random lottery system and a computer-based online true random lottery method are characterized in that the system consists of a user lottery module, a lottery request monitoring module and a lottery number generating module, wherein a user participates in lottery through the lottery module, the lottery number generating module is responsible for generating a lottery number, the lottery request monitoring module is responsible for monitoring the lottery request generated by the user lottery module, the lottery number generating module is started, whether the user wins a prize is determined according to the lottery number generated by the lottery number generating module, and a lottery result is notified to the lottery module.

2. An online true random lottery system and method based on computer realization is characterized in that the system lottery comprises the following steps:

s1, a user selects a lottery drawing number to participate in lottery drawing, submits a lottery drawing request to enter a lottery drawing request queue of a lottery drawing request monitoring module;

s2, when the lottery request monitoring module monitors that a lottery request exists in the lottery queue, the lottery request monitoring module submits the lottery request to the lottery number generating module, and the lottery number generating module starts a lottery program;

s3, the lottery number generation module sets the type of the lottery numbers according to the lottery probability and generates a lottery number original table;

s4, the prize-winning number generation module scrambles the original table of the lottery numbers through a shuffling algorithm to generate a random ranking table of the lottery numbers;

s5, generating a character sequence with true random attributes by a winning number generation module through real-time state data of computer hardware;

s6, generating true random lottery drawing interval seeds by a winning number generation module through a true random character sequence;

s7, the winning number generation module generates a true random lottery interval sequence by using the true random lottery interval seeds;

s8, the winning number generating module extracts winning numbers from the lottery number sorting table according to the true random lottery interval sorting table, generates a winning number sequence and returns the winning number sequence to the lottery request monitoring module;

s9, returning to the lottery drawing request monitoring module to determine whether the user wins a prize according to the lottery number code sequence, wherein the number selected by the user is the prize when the number is consistent with the prize number, and the lottery drawing request monitoring module returns the prize result to the lottery drawing module;

s10, the lottery module informs the user whether the user wins the prize according to the winning result and publishes the winning result.

3. The system and method for lottery-based online real-time drawing according to claim 2, wherein in step S1, the users participating in the drawing select any one or more drawing numbers through the drawing module, wherein the optional drawing numbers are all drawing numbers in the drawing number original table; the user submits a lottery drawing request, and the lottery drawing request enters a lottery drawing queue of the lottery drawing request monitoring module.

4. The system and method for a lottery-based online real-time lottery as claimed in claim 2, wherein in step S2, when the lottery request monitoring module monitors that there is a lottery request in the lottery queue, it submits the lottery request to the winning number generation module, which starts the lottery process.

5. The system and method for an on-line real-time lottery drawing based on a drawing mode of claim 2, wherein the winning number generation module sets the lottery numbers and numbers according to the winning probability set by the system and generates the original table of the lottery numbers after the lottery drawing program of the winning number generation module is started in step S3.

6. The system and method for a lottery-based online real-time lottery as claimed in claim 2, wherein the winning number generating module shuffles the lottery numbers in the lottery number original table using a shuffling algorithm to generate a lottery number random ranking table at step S4.

7. The system and method for lottery-based online real-time drawing as claimed in claim 2, wherein the winning number generating module composes a true random character sequence with a length of 51 according to the current computer' S17-bit millisecond-level time stamp digit sequence, 17-bit CPU usage rate digit sequence and 17-bit memory usage rate digit sequence in step S5.

8. The system and method for an online real-time lottery drawing based on a drawing mode of claim 2, wherein in step S6, the winning number generation module randomly shuffles the sequence of 51-long characters by using a shuffling algorithm, converts the sequence into 16-hexadecimal digits by using an MD5 algorithm, and converts the 16-hexadecimal digits into decimal digits, wherein the decimal digits are true random seeds of the lottery drawing interval, and the decimal digits are real random seeds of the lottery drawing interval.

9. The system and method for a lottery-based online real-time lottery according to claim 2, wherein the winning number generating module generates a true random lottery interval sequence of a length corresponding to all lottery requests according to the number of requests in the current lottery queue and the lottery interval true random seed at step S7.

10. The system and method of claim 2, wherein the winning number generating module sequentially extracts winning numbers from the lottery number ranking table to form a winning number sequence using elements in the truly random lottery interval sequence as drawing intervals, and returns the winning number sequence to the lottery request monitoring module at step S8.

11. The computer-based online true random lottery system and method as claimed in claim 2, wherein the lottery request monitoring module determines whether the user participating in the lottery wins a prize based on the sequence of winning numbers, and returns the result of the lottery to the lottery module when the number selected by the user coincides with the winning number for winning the prize in step S9.

12. The computer-based online true random lottery system and method as claimed in claim 2, wherein the lottery module notifies the user whether a prize is won or not based on the winning result and publishes the winning result at step S10.

Technical Field

The invention relates to the technical field of internet, in particular to an online real-time lottery system based on a lottery mode.

Background

Random drawing is a commercial marketing tool that is currently very popular. The conventional lottery drawing methods such as dice and rotary discs have high cost and low efficiency, and can only be used for offline activities, and the internet era generates an online lottery drawing method for generating winning numbers by using a computer program. At present, most of online lottery methods generate random numbers by using a pseudo-random number generation program, a winning number is determined according to the random, a computer pseudo-random generation program can efficiently generate a large number of random numbers, but the pseudo-random numbers are generated according to a certain mathematical method, so that the problems of predictability, periodicity and the like exist, and the online lottery safety is low. The true random number generator can avoid the defects of pseudo random numbers by collecting the true random data generated by various natural physical random phenomena, but has the defects of high production cost, low output efficiency and complex production and use processes, and can not meet the requirements of online real-time lottery on the production efficiency and cost of random numbers.

Disclosure of Invention

Aiming at the problems of the existing online lottery method, the invention provides a low-cost, high-efficiency and safe online real-time lottery system and method by adopting a mode similar to playing card drawing. The lottery system consists of a user lottery module, a lottery request monitoring module and a lottery number generating module, wherein a user participates in lottery through the lottery module, the lottery number generating module is responsible for generating a lottery number, the lottery request monitoring module is responsible for monitoring the lottery request generated by the user lottery module, the lottery number generating module is started, whether the user wins or not is determined according to the lottery number generated by the lottery number generating module, and a lottery result is notified to the lottery module. When the system draws a lottery, a user selects a lottery number through the lottery module to participate in the lottery, and the lottery module submits a lottery request to the lottery request queue of the lottery request monitoring module; when the lottery request monitoring module monitors that a lottery request exists in the lottery queue, the lottery request monitoring module submits the lottery request to the lottery number generating module, and the lottery number generating module starts a lottery program; the lottery number generation module sets the type of the lottery numbers according to the lottery probability and generates a lottery number original table; the prize-winning number generation module scrambles the original table of the lottery numbers by shuffling algorithm to generate a random ranking table of the lottery numbers; the winning number generation module generates true random lottery interval seeds through real-time state data of computer hardware, and generates lottery interval sequences with true random attributes according to the true random interval seeds; the lottery number generation module extracts lottery numbers from the lottery number random sorting table according to the generated lottery interval sequence, generates a lottery number sequence and returns the lottery number sequence to the lottery request monitoring module; the lottery drawing request monitoring module determines whether the user wins a prize according to the winning number sequence and returns a winning result to the lottery drawing module; and the lottery module informs the user whether the user wins the prize according to the winning result and publishes the winning result. The winning numbers generated by the lottery through the system have the properties of uniform distribution, unpredictability and non-periodicity. The invention directly produces the random number only according to the inherent functions of the computer, has low production cost and high efficiency, and can be used for generating mass random numbers for online real-time lottery.

1. The complete technical scheme (invention scheme) provided by the invention is as follows:

(1) user selects lottery drawing number to participate in lottery drawing

The user selects to participate in the lottery in a certain period through the system lottery module, the number of the lottery is selected, the number of the selectable lottery is all kinds of numbers in the lottery number original table, the lottery module submits a lottery request to the lottery request monitoring module, and the lottery request enters the lottery request queue of the lottery request monitoring module.

(2) Lottery program initiation

When the lottery system monitors that lottery requests exist in the lottery queue, the lottery requests are submitted to the lottery number generating module for all the lottery requests, and the lottery number generating module starts a lottery program after receiving the requests to extract the lottery numbers for all the lottery requests.

(3) Lottery drawing number original table generation

1) The lottery numbers and the number of each number in the lottery number original table are set according to the probability of winning. For example, lottery numbers may be set to 0, 1, and the number of each number may be set to ten thousand, one hundred thousand, one million, etc., to form an original table of lottery numbers of different levels. The lottery numbers contained in each of the original tables of lottery numbers may also be adjusted. The lowest number can be set as 2, and the highest number can be set as the same number as the numbers of the lottery number original table. If the number of numbers in the lottery number original table is set to 100 ten thousand: when the types of the lottery numbers are 2, the number of each lottery number is set to be 50 ten thousand, and the occurrence probability of each random number is one half; when the types of the lottery numbers are 10, the number of each lottery number is set to be 10 ten thousands, and the occurrence probability of each lottery number is one tenth; when the maximum number of types of lottery numbers is set to 100 ten thousand, the number of each type of winning number is set to 1, and the probability of occurrence of each type of random number is one millionth. The probability of occurrence of each kind of lottery numbers decreases correspondingly when the kind of lottery numbers increases one by one. Further, the larger the number of lottery numbers in the lottery number original table, the larger the short-term winning probability deviation ratio of the lottery numbers.

2) The probability of winning for each lottery number may be set equal or close, and may be adjusted as desired. If the lottery numbers are 2 types (1 and 2), the length of the array is 1 ten thousand: assuming that the winning probability is set equal for each lottery number, 5000 for 1 and 5000 for 2 can be set; 4900 for 1 and 5100 for 2 can be set under unequal conditions, and the setting can be customized according to different requirements. Under the condition of equality, if the number of the lottery numbers is divided by the types of the lottery numbers, the number of the lottery numbers which is not divided is removed, for example, the number of the lottery numbers is 3 (1, 2 and 3), each number of the lottery numbers is 3333, the total number of the numbers of the original table of the lottery numbers is 9999, and 1 number of the mantissas is removed. And so on.

3) The winning number generation module automatically generates N winning numbers according to the setting conditions of the winning probability of the winning numbers and the winning probability of different numbers, the number of N is generally set to be 100 ten thousand, under the condition that the winning probabilities of different numbers are different, the winning number generation module needs to regularly and automatically adjust the number of different numbers, so that the winning probability of each kind of the winning numbers is uniformly fluctuated up and down, the average probability of each kind of the winning numbers is equal, and the adjustment period can be set to be 1 day or 1 week.

(4) Lottery number random ordering table generation

1) The lottery drawing number sorting table is formed by different permutation and combination changes of all lottery drawing numbers in the lottery drawing number original table.

2) The number of different winning number sorting tables that can be generated by the lottery number original table is determined by the number of winning numbers and the kind of winning numbers of the lottery number original table. The most winning number ranking tables can be generated when the number of types of winning numbers is equal to the number of winning numbers in the original table of winning numbers, in which case the total number of different random winning number ranking tables is a factorial in the length of the array. The minimum number of winning number ranking tables that can be generated when there are only 2 random number categories is, in this case, the total number of different random winning number ranking tables is (the factorial of array length) divided by (the factorial of half array length).

3) The winning number generation module randomly shuffles the number order in the original table of lottery numbers by a shuffling algorithm (e.g., Fisher-Yates Shuffle algorithm) to generate a random ranking table of lottery numbers.

(5) True random lottery interval seed generation based on computer hardware state data

The winning number generation module utilizes the computer system function to obtain the computer time, the CPU utilization rate and the memory utilization rate to form a character sequence, the character sequence is totally composed of 51 digits, the first 17 digits are computer time data, the first 18 to 34 digits are computer CPU utilization rate percentage data, the second 35 to 51 digits are computer memory utilization rate percentage data, the sequence is randomly disordered by using a shuffling algorithm, then the data is converted into 16 hexadecimal by using MD5, and then the data is converted into decimal digits, and the decimal digits are true random seeds of the lottery interval.

(6) Lottery interval sequence generation

1) The lottery number generation module generates a sequence of lottery intervals having a length equal to the number of lottery requests using the true random seed for the lottery intervals.

2) And when the lottery interval true random seed number is N, and the lottery request number is M, the lottery number generation module generates M positive integer random numbers between 1 and N by using a pseudo-random algorithm, wherein each random number represents the position of the lottery interval true random seed, and the numbers of the corresponding positions in the lottery interval true random seeds are sequentially copied according to the M random numbers to form a M-number true random interval number sequence.

3) Each digit in the sequence of drawing intervals represents the interval between two adjacent drawing positions when drawing a winning number. For example, the number 2 represents that the currently extracted number position is separated from the previously extracted number position by 2 numbers.

(7) Winning number sequence generation

1) The winning number generation module extracts winning numbers from the random lottery number ranking table for each lottery request in turn according to the interval number sequence to form a winning number code sequence,

2) if the lottery numbers are only 0 and 1, the number sequence in the sorting table is 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0. The drawing interval sequence is 1, 3, 2, 1. The winning number is the 2 nd, 6 th, 9 th, 11 th digit number, i.e., the winning number sequence is 0, 1, 0, 1.

3) And after the winning number generating module generates a winning number sequence, the result is returned to the lottery drawing request monitoring module.

(8) Determining winning results

The lottery request monitoring module determines the winning number of each lottery request according to the winning number sequence, determines whether the user wins according to the winning number, and returns the result to the user lottery module. And the user lottery module informs the user whether the user wins the prize according to the winning result and publishes the winning result.

(9) The winning number produced by the method has the characteristics

The winning number produced by the method has the following characteristics: uniform distribution, unpredictability, aperiodic.

1) Uniformity of distribution

The number of each number in the lottery drawing number original table has uniformity, and the lottery drawing numbers in the lottery drawing number sorting table produced by using the lottery drawing number original table have uniform distribution. Drawing from a lottery number sorting table with uniform distribution property according to the hardware state data of the true random calculator, wherein the sequence formed by the drawing result has the same uniform distribution property. Whether the true random numbers themselves have uniform distribution does not affect the uniform distribution of the extraction results.

2) Unpredictability

Because there is no inevitable logic relation based on algorithm between the winning numbers produced by the method, the drawing position of the winning numbers is related to the real-time computer hardware state data and can not be predicted before drawing, therefore, the winning numbers produced by the method are the same as any true random numbers and can not be predicted.

3) Aperiodic

From the structure set by the original table of lottery numbers, different array lengths, different random number types and array proportions of the random number types and the array are changed, any variable of the original table of the lottery numbers can generate a different original table of the lottery numbers, and each original table of the lottery numbers can generate different astronomical-grade permutation and combination, so that the number of the random permutation tables of the lottery numbers tends to be infinite and has non-periodicity. Real random data of computer hardware state that changes instantly has natural physical objective properties that are aperiodic. The computer hardware state true random data is superimposed with the lottery number random sort list to produce winning numbers which are non-periodic.

2. The technical scheme of the invention has the following beneficial effects:

the invention solves the problems of true randomness and safety of online real-time lottery drawing, generates uniformly distributed random winning numbers with low cost and high efficiency, and provides an effective technical solution for online infinite convenient production and supply of true random numbers for timely large-scale lottery drawing. The production method can be used for conveniently and effectively producing the true random number on any common computer without adding and modifying any function, and compared with other lottery drawing methods, the method has strong economic advantages of low cost in production, management and use.

Drawings

Fig. 1 is a system configuration diagram of an online real-time lottery system and method according to a drawing mode of the present invention.

Fig. 2 is a main flowchart of an on-line real-time lottery system and method according to a drawing mode of the present invention.

Detailed Description

Referring to fig. 1, a system structure diagram of an online real-time lottery system and method in a drawing mode according to the present invention is shown. The user sends out lottery drawing request, the system generates the sequence of winning numbers, compares with the user lottery drawing numbers, and returns the user lottery drawing result.

Referring to fig. 2, a main flow chart of an online real-time lottery system and method according to a drawing mode of the present invention is shown. The following takes an original table of pseudo-random lottery numbers with millions of sets, ten random numbers and equal probability as an example (hereinafter referred to as original table of million pseudo-random lottery numbers for short), and introduces the production steps and flow of the production method.

(1) If the current 10 users select the lottery numbers to participate in the lottery through the lottery module, the lottery module sends 10 lottery requests to the lottery monitoring module.

(2) And the lottery drawing monitoring module starts the winning number generation module after receiving the lottery drawing request.

(3) The winning number generation module generates an original table of millions of pseudorandom lottery numbers using a computer pseudorandom algorithm, 0 representing 10.

A. Length of original table of lottery numbers: 100 ten thousand.

B. Lottery number types are 10: namely 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, ten possibilities.

C. The probability of occurrence of each lottery number is the same: all 10 percent, namely 10 ten thousand numbers are set for each lottery drawing number.

(4) The lottery number generation module converts the lottery number original table into a lottery number random ranking table.

A. And (3) disordering the sequence of the lottery drawing number original table through a shuffle algorithm shuffle to generate a lottery drawing number random ordering table.

B. The million winning number sorting table is a static sequence table of million pseudo-random winning numbers, and is one of a plurality of sequence tables generated by a million pseudo-random lottery number original table.

C. The original table of million pseudorandom lottery numbers may generate a ranked list of winning numbers for different combinations totaling 100 kilo-factorials divided by (10 to the power of 10 kilo-factorials).

(5) The winning number generation module uses three kinds of instant data of computer hardware to generate the true random seed of the lottery interval.

The method comprises the steps of forming a character sequence by 51 natural numbers of 'memory utilization rate + CPU utilization rate + time information', randomly disordering the sequence by using a shuffle algorithm, converting the sequence into 16-bit hexadecimal by using an MD5 algorithm, and converting the hexadecimal into decimal numbers, wherein the decimal numbers are true random seeds. The winning number generation module generates the real random seed of the lottery interval by using hardware instant data each time the lottery interval real random seed is generated, and the unpredictable property of the hardware instant data determines that the generated winning number also has unpredictable objective property.

For example, the following steps are carried out:

time information: 20210501110851324, respectively;

CPU utilization rate: 29.354628576093881, respectively;

the memory utilization rate is as follows: 10.133572678420579, respectively;

the composed character sequence is as follows: 202105011108513242935462857609388110133572678420579, respectively;

randomly disorderly ordered character sequences: 511020836122298036448175392021123641738709505057158, respectively;

MD5 value: df6a3b7ca9370 cba;

conversion to decimal number: 16098745224590199994.

(6) the lottery number generation module generates a lottery interval sequence through the lottery interval true random seed.

A. The winning number generation module generates a positive integer random number by using a pseudo-random algorithm, and sequentially copies the numbers at corresponding positions in the lottery interval true random seed according to the random number to form a true random interval number sequence with the length equal to the request number.

B. If the lottery request number received by the lottery monitoring module is 10, the lottery number generation module needs to generate a lottery interval sequence with a length of 10 by using the lottery interval true random seed.

For example, the following steps are carried out:

the number of digits of the lottery interval true random seed '16098745224590199994' is 20, and the lottery request quantity is 10;

pseudo-randomly generating 10 random numbers between 1 and 20: 1, 2, 14, 5, 6, 9, 5, 3, 18, 10;

generating a true random lottery interval sequence: 1,6,0,8,7,2,8,0,9,2.

(7) The winning number generation module draws numbers through the sequence of drawing intervals and the random sorting table of drawing numbers.

And drawing the winning numbers once from the random lottery number sorting table according to the lottery interval sequence to form a lottery number sequence.

For example, the following steps are carried out:

random ranking table of lottery numbers: 0003679595283817988824512403057919403770351758196661295276836652750529339934286924841950629084941396;

generating a true random lottery interval sequence: 1, 6, 0, 8,7, 2, 8, 0, 9, 2;

winning number sequence: 0,9,8,0,3,0,6,3,9,9.

(8) Winning result

The lottery module determines whether 10 users have won based on the sequence of winning numbers, and ultimately generates a winning result.

The embodiments described herein are merely illustrative and not restrictive, and those skilled in the art can make various modifications and additions to the described embodiments or substitute them in a similar manner without departing from the spirit and scope of the present invention.

9页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种便携式网上国网移动服务终端

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!