CN110928523A - Random number acquisition method and system for lottery industry - Google Patents

Random number acquisition method and system for lottery industry Download PDF

Info

Publication number
CN110928523A
CN110928523A CN201911226492.5A CN201911226492A CN110928523A CN 110928523 A CN110928523 A CN 110928523A CN 201911226492 A CN201911226492 A CN 201911226492A CN 110928523 A CN110928523 A CN 110928523A
Authority
CN
China
Prior art keywords
random number
random
library
sequence
residual
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201911226492.5A
Other languages
Chinese (zh)
Other versions
CN110928523B (en
Inventor
代洪强
邓力飞
田恩辉
罗春水
黄河
彭松
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
CHINA SPORTS LETTWAY TECHNOLOGY DEVELOPMENT Co Ltd
Original Assignee
CHINA SPORTS LETTWAY TECHNOLOGY DEVELOPMENT Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by CHINA SPORTS LETTWAY TECHNOLOGY DEVELOPMENT Co Ltd filed Critical CHINA SPORTS LETTWAY TECHNOLOGY DEVELOPMENT Co Ltd
Priority to CN201911226492.5A priority Critical patent/CN110928523B/en
Publication of CN110928523A publication Critical patent/CN110928523A/en
Application granted granted Critical
Publication of CN110928523B publication Critical patent/CN110928523B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/58Random or pseudo-random number generators
    • G06F7/588Random number generators, i.e. based on natural stochastic processes
    • GPHYSICS
    • G07CHECKING-DEVICES
    • G07CTIME OR ATTENDANCE REGISTERS; REGISTERING OR INDICATING THE WORKING OF MACHINES; GENERATING RANDOM NUMBERS; VOTING OR LOTTERY APPARATUS; ARRANGEMENTS, SYSTEMS OR APPARATUS FOR CHECKING NOT PROVIDED FOR ELSEWHERE
    • G07C15/00Generating random numbers; Lottery apparatus
    • G07C15/006Generating random numbers; Lottery apparatus electronically

Abstract

The invention provides a random number acquisition method and a system for the lottery industry, wherein the method comprises the following steps: acquiring initial random times L and random number seeds; calling a QT library to set a random number seed function, and adding random number seeds into parameters to obtain an initial random number sequence; calling a QT library random function for L times to obtain a first residual random number sequence; responding to the random number request, selecting a preset mode, calling a random function of a QT library for a certain number of times, and acquiring a final random number; when a next random number request is received, another preset mode is selected based on the residual random number sequence, and a random function of the QT library is called for a certain number of times to obtain a new residual random number sequence and a corresponding final random number. The method and the system can set different random number seeds according to different sales terminals, introduce various random factors in the process of acquiring the random numbers, meet the service requirements in the functional scenes of machine selection of numbers and the like which need the random numbers, and improve the use experience of random betting of lottery buyers.

Description

Random number acquisition method and system for lottery industry
Technical Field
The invention relates to the technical field of random number generation, in particular to a method and a system for acquiring random numbers in the lottery industry.
Background
At present, random numbers are widely used for various data encryption algorithms, such as RSA (Rivest, Shamir, Adleman), Digital Signature Algorithm (DSA), and Diffie-Hellman. The random number generator may be a computing device designed to generate a series of numbers and/or symbols that lack any recognizable pattern. In the case of lottery tickets, prize sales (e.g., kill of seconds), etc., the fairness of the results depends almost directly on how random the random sequence is. Thus, the randomness of the random sequence must meet very stringent requirements.
Nowadays, a lottery terminal is provided with a 'machine selection' button, and a lottery player can randomly generate a betting number for betting through a machine selection mode. In the existing machine selection mode, the adopted random number mode is generally as follows: starting up a sales terminal, calculating, setting a random number seed and calling a QT library random function for a plurality of times; when the application of the sales terminal needs to acquire a random number (if a user needs to select a bet number, the application needs to acquire the random number), calling a QT library random function to acquire the required random number; in this way, the random number seed setting mode is single, the random factor is few, and the randomness of the random number needs to be improved.
Therefore, a random number acquisition scheme with a plurality of random factors and capable of meeting service requirements in various functional scenes is needed.
Disclosure of Invention
In order to overcome the problems, the invention provides a random number acquisition method and a random number acquisition system for the lottery industry, different random number seeds can be set according to different sales terminals, and various random factors are introduced in the process of acquiring the random numbers by the sales terminals, so that the service requirements of machine selection and other functional scenes requiring the random numbers are met, and the use experience of random betting of lottery buyers is improved.
In an embodiment of the present invention, a method for acquiring random numbers in lottery industry is provided, wherein the method includes:
acquiring initial random times L and random number seeds;
calling a QT library to set a random number seed function according to the random number seeds, and adding the random number seeds into parameters to obtain an initial random number sequence;
calling a random function of the QT library for L times according to the initial random number sequence to obtain a first residual random number sequence;
responding to a random number request, selecting a preset mode based on the first residual random number sequence, and calling a random function of a QT library for a certain number of times to obtain a second residual random number sequence and a corresponding final random number;
when a next random number request is received, another preset mode is selected based on a residual random number sequence obtained by the previous random number request, and a random function of the QT library is called for a certain number of times to obtain a new residual random number sequence and a corresponding final random number.
In an embodiment of the present invention, a system for acquiring random numbers in lottery industry is further provided, where the system includes:
the data acquisition module is used for acquiring the initial random times L and the random number seeds;
the initial random number sequence calculation module is used for calling a QT library to set a random number seed function according to the random number seeds and adding the random number seeds into parameters to obtain an initial random number sequence;
the first residual random number sequence calculation module is used for calling a random function of the QT library for L times according to the initial random number sequence to obtain a first residual random number sequence;
the random number acquisition module is used for responding to a random number request, selecting a preset mode based on the first residual random number sequence, calling a random function of a QT library for a certain number of times, and obtaining a second residual random number sequence and a corresponding final random number;
when a next random number request is received, another preset mode is selected based on a residual random number sequence obtained by the previous random number request, and a random function of the QT library is called for a certain number of times to obtain a new residual random number sequence and a corresponding final random number.
In an embodiment of the present invention, a computer device is further provided, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, and the processor implements a random number acquisition method for lottery industry when executing the computer program.
In an embodiment of the present invention, a computer-readable storage medium storing a computer program for executing the random number acquisition method for the lottery industry is also presented.
The random number acquisition method and the random number acquisition system for the lottery industry can set different random number seeds according to different sales terminals, introduce various random factors in the process of acquiring the random numbers, meet the service requirements of machine-selected numbers and other functional scenes needing the random numbers, and improve the use experience of random betting of lottery buyers.
Drawings
Fig. 1 is a flow chart of a method for acquiring random numbers in the lottery industry according to an embodiment of the present invention.
Fig. 2 is a flowchart illustrating an initial random number obtaining process according to an embodiment of the present invention.
Fig. 3 is a flowchart illustrating a process of acquiring a random number seed according to an embodiment of the invention.
Fig. 4 is a flowchart illustrating a process of acquiring a random number seed according to a terminal number according to an embodiment of the present invention.
Fig. 5 is a diagram illustrating a corresponding relationship between province IDs and province mapping values according to an embodiment of the present invention.
FIG. 6 is a flow chart of random number acquisition in multiple modes according to an embodiment of the present invention.
Fig. 7 is a schematic diagram of a random number acquisition system for lottery industry according to an embodiment of the present invention.
Fig. 8 is a schematic structural diagram of a computer device according to an embodiment of the present invention.
Detailed Description
The principles and spirit of the present invention will be described with reference to a number of exemplary embodiments. It is understood that these embodiments are given solely for the purpose of enabling those skilled in the art to better understand and to practice the invention, and are not intended to limit the scope of the invention in any way. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
As will be appreciated by one skilled in the art, embodiments of the present invention may be embodied as a system, apparatus, device, method, or computer program product. Accordingly, the present disclosure may be embodied in the form of: entirely hardware, entirely software (including firmware, resident software, micro-code, etc.), or a combination of hardware and software.
According to the embodiment of the invention, a method and a system for acquiring random numbers in the lottery industry are provided. The method and the system introduce various random factors, enrich the algorithm for acquiring the random number and meet the service requirement of the user on the related function for acquiring the random number.
First, terms related to the present invention are explained as follows:
random number: the data generated randomly is used for carrying out random betting on a sports lottery selling client side or other functional scenes needing random numbers.
Random number seed: the initial condition of the random number generation algorithm is a number in nature.
And numbering the terminals: the number of the sports lottery sales terminal is unique, and the terminal number of each sales terminal is unique.
QT library: the graphical user interface application program provides a random number seed setting method and a random number obtaining method, and after the random number seeds are set, the random functions provided by the random number seeds can be called to obtain random numerical values.
The principles and spirit of the present invention are explained in detail below with reference to several representative embodiments of the invention.
Fig. 1 is a flow chart of a random number acquisition method for the lottery industry according to an embodiment of the present invention. As shown in fig. 1, the method includes:
step S101, obtaining initial random times L and random number seeds;
step S102, calling a QT library to set a random number seed function according to the random number seeds, and entering the random number seeds into a parameter to obtain an initial random number sequence;
step S103, calling a random function of the QT library for L times according to the initial random number sequence to obtain a first residual random number sequence;
step S104, responding to a random number request, selecting a preset mode based on the first residual random number sequence, calling a random function of a QT library for a certain number of times, and obtaining a second residual random number sequence and a corresponding final random number;
and step S105, when a next random number request is received, selecting another preset mode based on the residual random number sequence obtained by the previous random number request, and calling a random function of the QT library for a certain number of times to obtain a new residual random number sequence and a corresponding final random number.
If a new random number request is received again, step S105 is repeatedly performed.
The following is a detailed description of each step:
first, in step S101, an initial random number l (duration) and a random number seed are obtained. The specific process of acquiring the initial random number L is shown in fig. 2, and includes:
step S201, when the sports lottery sales terminal is started, acquiring the current time, and calculating the time difference between the current time and 1970, 1 month, 1 day, 0 hour, 0 minute and 0 second, wherein the time difference is taken as a unit;
step S202, calling a QT library to set a random number seed function, taking the time difference as a random number seed parameter, and obtaining a random number sequence QA
Step S203, according to the random number sequence QACalling a random function of the QT library once to obtain a current random value;
and step S204, the current random value pair 22000000 is subjected to remainder, and the obtained remainder is used as the initial random number L.
It should be noted that the random number sequence obtained in step S202 may be regarded as a string of random numbers; after the random function of the QT library is called once through the step S203, the first random number in the sequence is taken out, and the taken-out random number is used as a current random number value; since the random number is "taken out", the remaining sequence is compared with the original sequence, and the first random number of the original sequence is considered to be "discarded" from the subsequent random number sequence.
If the random function of the QT library is called for N times, the former N random numbers are correspondingly taken out, and the random number taken out for the Nth time is the current random number corresponding to the calling for the Nth time; the remaining sequence may be considered to "discard" the first N random numbers of the original sequence as compared to the original sequence.
The following is further explained by a specific example, and the random number sequence mentioned in this example is only an exemplary illustration.
For example, the string of random numbers obtained in step S202 is "X, Y, Z, A, B, … …", and each letter represents a random number. After step S203, X in the sequence is taken out as the current random number value, and the random number sequence "Y, Z, A, B, … …" is obtained. If the QT library random function is called again 2 times, the current random number value is "Z", and the remaining random number sequence is "A, B, … …".
After the acquisition mode of the initial random number L is introduced, the acquisition mode of the random number seed is introduced next.
Referring to fig. 3, a flow chart of acquiring a random number seed is shown, including:
step S301, acquiring a terminal number of a lottery terminal;
step S302, extracting provincial ID information, city ID information, store ID information and terminal ID information according to the terminal number;
step S303, the province ID is mapped into a province mapping numerical value, and a random number seed is obtained by utilizing the following formula:
X=A1×100000000+A2×1000000+A3×10+A4
wherein X is a random number seed, A1To province map values, A2For city ID information, A3As store ID information, A4Is terminal ID information.
For example, taking a certain terminal as an example, the terminal number is composed of 13 digits: 1398712345106, as shown in FIG. 4, the process of obtaining the random number seed comprises:
step S401, acquiring a province id (provinceid) value, and intercepting the first two digits to form a number for the terminal number, where provinceid is 13.
Step S402, according to the province ID value, obtaining a corresponding province mapping value (providencmapvalue) in the mapping table, where the mapping table is as shown in fig. 5, and obtaining the corresponding province mapping value after querying: provinceMapValue ═ 3.
In step S403, a city id (cityid) value is obtained, and a number formed by two digits, i.e., 3 rd and 4 th from left to right, is intercepted for the terminal number, where cityid is 98.
In step S404, a store id (shop) value is obtained, and a number of 5 bits from the 6 th to the 10 th bits from left to right is extracted for the terminal number, where shop id is 12345.
In step S405, a terminal id (terminal id) value is obtained, which is the last digit of the terminal number, and the terminal id is 6.
In step S406, a random number seed is calculated according to the formula in step S303, where the random number seed is 398123456.
After the initial random number l (timeout) and the random number seed are obtained, step S102 is further executed, according to the random number seed 398123456, a QT library is called to set a random number seed function, and the random number seed is referred to obtain an initial random number sequence.
And step S103 is combined, the random function of the QT library is called for L times according to the initial random number sequence, namely, the previous L random numbers are discarded, and a first residual random number sequence is obtained.
By this point, it can be considered that the preparation work of the sales terminal for random number acquisition has been completed.
The following describes the processing of the random number request and the process of acquiring the random number in detail with reference to steps S104 and S105.
First, in conjunction with step S104, in response to a random number request, the first mode is selected, a remainder operation is performed on 100 according to the number of milliseconds of the current time, and the obtained remainder is used as a random number C1
Based on the first residual random number sequence, a random function C of a QT library is further called1And +1 times, obtaining a second residual random number sequence and a corresponding final random number.
Further, in conjunction with step S105, when a next random number request is received, and the random number request is responded, the preset mode to be used in the current processing procedure may be selected according to the preset mode used by the previous random number request and by sequentially cycling through the first mode, the second mode, and the third mode.
For example, when the next random number request is received, if the second mode is selected, based on the residual random number sequence obtained by the previous random number request, the random function of the QT library is called for 1 time to obtain a transition random number sequence and a random number return value;
carrying out remainder operation on the random number return value pair 100, and taking the obtained remainder as random times C2
According to the transitional random number sequence, further calling a random function C of a QT library2+1 times, obtaining a new residual random number sequence and a corresponding final random number;
if the third mode is selected, according to the Mth day of the year today, carrying out remainder operation on M to 100, and taking the obtained remainder as random times C3
Based on the residual random number sequence obtained by the previous random number request, a random function C of the QT library is further called3+1 times, obtaining a new residual random number sequence and a corresponding final random number;
through the cycle of selecting the mode, if the first mode is selected again, the remainder operation is carried out on 100 according to the millisecond number of the current time, and the obtained remainder is taken as the random number C4
Based on the residual random number sequence obtained by the previous random number request, a random function C of the QT library is further called4And +1 times, obtaining a new residual random number sequence and a corresponding final random number.
In order to explain the above random number acquisition method for the lottery industry more clearly, the following description is made with reference to specific embodiments.
After the random number request is provided, the application of the sales terminal calls a packaged method for obtaining the random number according to the corresponding flow to obtain the required random number. Each random number request corresponds to a "method of obtaining a random number".
In the method for obtaining the random value, the processing logic is that after the random number is firstly generated for a certain number of times (wherein the certain number of times is also generated by a certain algorithm), the random number finally required is obtained by calling a random function of a QT library by a sales terminal application.
Referring to fig. 6, the process of "random a certain number of times" is shown as a labeled box 600, the algorithm relies on a static variable, namely, the initial value of the variable is 0, and then, each time a new random number request is received, a "get random number method" is called, the variable is automatically incremented by 1, and if the value is 3 after the increment, the variable is reset to 0, that is, the value of the variable is only 0, 1, and 2, and the change rule is "0-1-2-0-1-2 … …".
When the application of the point-of-sale terminal invokes the "get random value method",
if the current glabolrdmdindex is 0, executing step S601, where the pre-random number of times is a value obtained by "taking the remainder of the number of milliseconds of the current time to 100";
if the current glabolrdmdindex is 1, executing step S602, where the pre-random number is a value obtained by "calling a random value returned by the QT library random function once and taking the remainder of the random value pair 100";
if the current value of glabolrdmdindex is equal to another value (i.e. 2), step S603 is executed, and the pre-random number is a value obtained by "this value is left over to 100 in the current day of this year".
Here, the calculated pre-random number is denoted as currentStep.
currentStep is obtained according to the algorithm, step S604 is executed, and the random function currentStep of the QT library is called for times.
Step S605 is executed, and the QT library random function is called 1 time to obtain a "new remaining random number sequence" and a corresponding numerical value, which is the random number currentRdmNum required this time.
After step S606, the static variable value of the glabolrdmdnex is processed to increase the value by 1, and if the value is greater than or equal to 3 after the increase, the value is reset to 0, so that the method for obtaining the random value is called next time.
In addition, when the "method for obtaining a random number" is called next time, the random number sequence used is the "new remaining random number sequence" obtained in step S605 this time.
In short, the random number sequence is a string of random numbers, each time the random function of the QT library is called, the first certain number of the string of random numbers is "discarded", and the remaining random number sequence is used to perform the subsequent steps.
When receiving the random number request, if the mode of step S601 is executed, the current time millisecond is 750, and after 750 is left to 100, currentStep is 50; through step S604, "take out" the first 50 of the string of random numbers; after step S605, 1 random number is "taken out" again, and the 51 st random number is the random number currentrdmnnum finally used by the application. The remaining random number sequence at this time is a random number sequence after the first 51 random number sequences are "discarded" based on the original random number sequence.
When receiving the next random number request, executing the mode of step S602, "take out" 1 (52 th), to obtain the 52 th random number, and take it over to 100; if the remainder is 10, step S604 is executed, and then 10 are "fetched", and step S605 is executed to "fetch" 1, so that the 63 rd random number is the random number currentrdmnnum finally used by the application. The remaining random number sequence at this time is the random number sequence after the first 63 are "discarded" on the basis of the original random number sequence.
When the next random number request is received again, the mode of step S603 is executed, today is the 200 th day of this year, after 200 is left over for 100, currentStep is equal to 0, step S604 is executed to "take out" 0, and after step S605, then "take out" 1, the 64 th random number is the random number currentrdmnnum finally used for the application. The remaining random number sequence at this time is a random number sequence after the first 64 numbers is "discarded" based on the original random number sequence.
When more random number requests are received, the aforementioned step patterns are cycled through in sequence.
The random number acquisition method provided by the invention adopts diversified random number seed setting modes, has multiple random factors, can meet the random number acquisition scheme of service requirements under various functional scenes, improves the credibility of sales outlets and lottery players to lottery tickets, and improves the satisfaction degree of lottery technical services.
It should be noted that although the operations of the method of the present invention have been described in the above embodiments and the accompanying drawings in a particular order, this does not require or imply that these operations must be performed in this particular order, or that all of the operations shown must be performed, to achieve the desired results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions.
Having described the method of an exemplary embodiment of the present invention, a random number acquisition system for a lottery industry according to an exemplary embodiment of the present invention will be described with reference to fig. 7.
The implementation of the random number acquisition system for the lottery industry can refer to the implementation of the above method, and repeated details are omitted. The term "module" or "unit" used hereinafter may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
Based on the same inventive concept, the present invention also provides a random number acquisition system for lottery industry, as shown in fig. 7, the system includes:
a data obtaining module 710, configured to obtain an initial random number L and a random number seed;
an initial random number sequence calculation module 720, configured to call a QT library to set a random number seed function according to the random number seeds, and enter the random number seeds into parameters to obtain an initial random number sequence;
a first remaining random number sequence calculating module 730, configured to call the QT library random function L times according to the initial random number sequence to obtain a first remaining random number sequence;
a random number obtaining module 740, configured to respond to a random number request, select a preset mode based on the first remaining random number sequence, and call a QT library random function for a certain number of times to obtain a second remaining random number sequence and a corresponding final random number;
when a next random number request is received, another preset mode is selected based on a residual random number sequence obtained by the previous random number request, and a random function of the QT library is called for a certain number of times to obtain a new residual random number sequence and a corresponding final random number.
It should be noted that although several modules of a random number acquisition system for the lottery industry are mentioned in the above detailed description, such partitioning is merely exemplary and not mandatory. Indeed, the features and functionality of two or more of the modules described above may be embodied in one module according to embodiments of the invention. Conversely, the features and functions of one module described above may be further divided into embodiments by a plurality of modules.
Based on the aforementioned inventive concept, as shown in fig. 8, the present invention further provides a computer device 800, which comprises a memory 810, a processor 820 and a computer program 830 stored on the memory 810 and operable on the processor 820, wherein the processor 820 executes the computer program 830 to implement the aforementioned random number acquisition method for the lottery industry.
Based on the same inventive concept, the present invention also provides a computer-readable storage medium storing a computer program for executing the random number acquisition method for the lottery industry.
The random number acquisition method and the random number acquisition system for the lottery industry can set different random number seeds according to different sales terminals, introduce various random factors in the process of acquiring the random numbers, meet the service requirements of machine-selected numbers and other functional scenes needing the random numbers, and improve the use experience of random betting of lottery buyers.
While the spirit and principles of the invention have been described with reference to several particular embodiments, it is to be understood that the invention is not limited to the disclosed embodiments, nor is the division of aspects, which is for convenience only as the features in such aspects may not be combined to benefit. The invention is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.

Claims (10)

1. A method for random number acquisition for the lottery industry, the method comprising:
acquiring initial random times L and random number seeds;
calling a QT library to set a random number seed function according to the random number seeds, and adding the random number seeds into parameters to obtain an initial random number sequence;
calling a random function of the QT library for L times according to the initial random number sequence to obtain a first residual random number sequence;
responding to a random number request, selecting a preset mode based on the first residual random number sequence, and calling a random function of a QT library for a certain number of times to obtain a second residual random number sequence and a corresponding final random number;
when a next random number request is received, another preset mode is selected based on a residual random number sequence obtained by the previous random number request, and a random function of the QT library is called for a certain number of times to obtain a new residual random number sequence and a corresponding final random number.
2. The method of claim 1, wherein obtaining the initial random number L and the random number seed comprises:
acquiring a first parameter, and acquiring an initial random number L by using an initial random number generation algorithm according to the first parameter;
and acquiring a second parameter, and acquiring a random number seed by using a random number seed algorithm according to the second parameter.
3. The method of claim 2, wherein obtaining a first parameter and obtaining an initial random number L using an initial random number generation algorithm based on the first parameter comprises:
acquiring current time, and calculating the time difference between the current time and 0 min 0 s at 1 month, 1 day and 0 th at 1970, wherein the time difference is taken as a unit of seconds;
calling a QT library to set a random number seed function, and taking the time difference as a random number seed parameter to obtain a random number sequence QA
According to a random number sequence QACalling a random function of the QT library once to obtain a current random value;
and (4) taking the remainder of the current random value pair 22000000, and taking the remainder as the initial random number L.
4. The method of claim 2, wherein obtaining a second parameter and obtaining a random number seed using a random number seed algorithm based on the second parameter comprises:
acquiring a terminal number of a lottery terminal;
extracting provincial ID information, city ID information, store ID information and terminal ID information according to the terminal number;
and mapping the province ID into a province mapping numerical value, and calculating by using the following formula to obtain a random number seed:
X=A1×100000000+A2×1000000+A3×10+A4
wherein X is a random number seed, A1To province map values, A2For city ID information, A3As store ID information, A4Is terminal ID information.
5. The method of claim 1, wherein responding to a random number request, selecting a predetermined pattern based on the first remaining random number sequence, invoking a QT library random function a number of times to obtain a second remaining random number sequence and a corresponding final random number comprises:
selecting a first mode, carrying out remainder operation on 100 according to the number of milliseconds of the current time, and taking the obtained remainder as random times C1
Based on the first residual random number sequence, a random function C of a QT library is further called1And +1 times, obtaining a second residual random number sequence and a corresponding final random number.
6. The method of claim 5, wherein when receiving a next random number request, selecting another preset mode based on a remaining random number sequence obtained from a previous random number request, calling a random function of the QT library a certain number of times to obtain a new remaining random number sequence, and obtaining a corresponding final random number, further comprises:
when the next random number request is received, the selected preset mode is selected according to the preset mode used by the previous random number request and the sequential and cyclic sequence of the first mode, the second mode and the third mode.
7. The method of claim 6, wherein when receiving a next random number request, selecting another preset mode based on a remaining random number sequence obtained from a previous random number request, and calling a random function of the QT library a certain number of times to obtain a new remaining random number sequence and a corresponding final random number, further comprising:
when a next random number request is received, if the second mode is selected, calling a random function of a QT library for 1 time based on a residual random number sequence obtained by the previous random number request to obtain a transitional random number sequence and a random number return value;
carrying out remainder operation on the random number return value pair 100, and taking the obtained remainder as random times C2
According to the transitional random number sequence, further calling a random function C of a QT library2+1 times, obtaining a new residual random number sequence and a corresponding final random number;
if the third mode is selected, according to the Mth day of the year today, carrying out remainder operation on M to 100, and taking the obtained remainder as random times C3
Based on the residual random number sequence obtained by the previous random number request, a random function C of the QT library is further called3+1 times, obtaining a new residual random number sequence and a corresponding final random number;
if the first mode is selected, the remainder operation is carried out on 100 according to the millisecond number of the current time, and the obtained remainder is used as the random number C4
Based on the residual random number sequence obtained by the previous random number request, a random function C of the QT library is further called4And +1 times, obtaining a new residual random number sequence and a corresponding final random number.
8. A random number acquisition system for the lottery industry, the system comprising:
the data acquisition module is used for acquiring the initial random times L and the random number seeds;
the initial random number sequence calculation module is used for calling a QT library to set a random number seed function according to the random number seeds and adding the random number seeds into parameters to obtain an initial random number sequence;
the first residual random number sequence calculation module is used for calling a random function of the QT library for L times according to the initial random number sequence to obtain a first residual random number sequence;
the random number acquisition module is used for responding to a random number request, selecting a preset mode based on the first residual random number sequence, calling a random function of a QT library for a certain number of times, and obtaining a second residual random number sequence and a corresponding final random number;
when a next random number request is received, another preset mode is selected based on a residual random number sequence obtained by the previous random number request, and a random function of the QT library is called for a certain number of times to obtain a new residual random number sequence and a corresponding final random number.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program for executing the method of any one of claims 1 to 7.
CN201911226492.5A 2019-12-04 2019-12-04 Random number acquisition method and system for lottery industry Active CN110928523B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911226492.5A CN110928523B (en) 2019-12-04 2019-12-04 Random number acquisition method and system for lottery industry

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911226492.5A CN110928523B (en) 2019-12-04 2019-12-04 Random number acquisition method and system for lottery industry

Publications (2)

Publication Number Publication Date
CN110928523A true CN110928523A (en) 2020-03-27
CN110928523B CN110928523B (en) 2021-11-19

Family

ID=69857889

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911226492.5A Active CN110928523B (en) 2019-12-04 2019-12-04 Random number acquisition method and system for lottery industry

Country Status (1)

Country Link
CN (1) CN110928523B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112835555A (en) * 2021-01-22 2021-05-25 广东智源机器人科技有限公司 Random number generation method, device and equipment
CN113658371A (en) * 2021-07-01 2021-11-16 折折朋比(武汉)互联网服务有限公司 Online real-time lottery system and method based on lottery mode

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7020283B1 (en) * 1999-08-10 2006-03-28 Sony Corporation Random number generation apparatus and random number generation method
CN101483723A (en) * 2008-01-11 2009-07-15 新奥特(北京)视频技术有限公司 Method for performance guarantee of television subtitle playing apparatus based on diversity application
CN101719826A (en) * 2009-05-13 2010-06-02 北京宏基恒信科技有限责任公司 Dynamic token having function of updating seed key and updating method for seed key thereof
CN102063285A (en) * 2010-12-24 2011-05-18 倍奥锐(北京)科技有限公司 True random number generation method implemented by software
US20130013657A1 (en) * 2009-11-25 2013-01-10 Emelko Glenn A Random number generator
CN103135961A (en) * 2011-11-28 2013-06-05 中泽宏 Method for generating multiplicative congruential random numbers based on modulus with two odd prime factors
CN103188075A (en) * 2013-02-01 2013-07-03 广州大学 Secret key and true random number generator and method for generating secret key and true random number
CN103530928A (en) * 2013-10-09 2014-01-22 新彩软件无锡有限公司 Sound-based mobile phone lottery random numerical selection method
US20170163416A1 (en) * 2015-12-07 2017-06-08 The Boeing Company Hardware assisted fast pseudorandom number generation
CN107368282A (en) * 2017-04-27 2017-11-21 北京大学 The unrelated continuous type quantum random number production method of one introduces a collection and device
CN108762725A (en) * 2018-05-31 2018-11-06 飞天诚信科技股份有限公司 A kind of method and system that distributed random number is generated and detected

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7020283B1 (en) * 1999-08-10 2006-03-28 Sony Corporation Random number generation apparatus and random number generation method
CN101483723A (en) * 2008-01-11 2009-07-15 新奥特(北京)视频技术有限公司 Method for performance guarantee of television subtitle playing apparatus based on diversity application
CN101719826A (en) * 2009-05-13 2010-06-02 北京宏基恒信科技有限责任公司 Dynamic token having function of updating seed key and updating method for seed key thereof
US20130013657A1 (en) * 2009-11-25 2013-01-10 Emelko Glenn A Random number generator
CN102063285A (en) * 2010-12-24 2011-05-18 倍奥锐(北京)科技有限公司 True random number generation method implemented by software
CN103135961A (en) * 2011-11-28 2013-06-05 中泽宏 Method for generating multiplicative congruential random numbers based on modulus with two odd prime factors
CN103188075A (en) * 2013-02-01 2013-07-03 广州大学 Secret key and true random number generator and method for generating secret key and true random number
CN103530928A (en) * 2013-10-09 2014-01-22 新彩软件无锡有限公司 Sound-based mobile phone lottery random numerical selection method
US20170163416A1 (en) * 2015-12-07 2017-06-08 The Boeing Company Hardware assisted fast pseudorandom number generation
CN107368282A (en) * 2017-04-27 2017-11-21 北京大学 The unrelated continuous type quantum random number production method of one introduces a collection and device
CN108762725A (en) * 2018-05-31 2018-11-06 飞天诚信科技股份有限公司 A kind of method and system that distributed random number is generated and detected

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
ANVI JAIN: ""How to generate different random numbers in a loop in C++?"", 《HTTPS://WWW.TUTORIALSPOINT.COM/HOW-TO-GENERATE-DIFFERENT-RANDOM-NUMBERS-IN-A-LOOP-IN-CPLUSPLUS》 *
FRIENDBABY: ""QT中的随机函数的用法"", 《HTTPS://BLOG.CSDN.NET/FRIENDBABY/ARTICLE/DETAILS/6862741》 *
WSFXZXB: ""QT怎样生成随机数"", 《HTTPS://JINGYAN.BAIDU.COM/ARTICLE/AD310E80C417FD1849F49E2D.HTML》 *
曾晓红等: ""连续随机数的产生"", 《福建电脑》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112835555A (en) * 2021-01-22 2021-05-25 广东智源机器人科技有限公司 Random number generation method, device and equipment
CN113658371A (en) * 2021-07-01 2021-11-16 折折朋比(武汉)互联网服务有限公司 Online real-time lottery system and method based on lottery mode

Also Published As

Publication number Publication date
CN110928523B (en) 2021-11-19

Similar Documents

Publication Publication Date Title
CN110928523B (en) Random number acquisition method and system for lottery industry
WO2019024489A1 (en) Project progress management method, device, terminal apparatus and medium
CA2075254A1 (en) Method for generating public and private key pairs without using a passphrase
CA2689853A1 (en) Secure access by a user to a resource
CN105303410B (en) Virtual article sharing method and device
CN111143633B (en) Data decryption method and device, electronic equipment and storage medium
CN111063093B (en) Lottery drawing system and method
CN110415044A (en) Cheat detection method, device, equipment and storage medium
CN109800078A (en) A kind of task processing method, task distribution terminal and task execution terminal
CN104407838B (en) A kind of method and apparatus generating random number and random array
CN109284154A (en) Desktop starter template renewal method and device, server and storage medium
CN109660587B (en) Data pushing method and device based on random number, storage medium and server
CN109144624B (en) Method, storage medium, device and system for displaying unequal height lists in IOS
CN115729990A (en) Distributed data storage method and device, electronic equipment and storage medium
CN108351629A (en) functional unit and control device
CN111028409B (en) Random lottery number selection system and method
CN108304113A (en) A kind of interface alternation configuration method and terminal
JP2015108905A (en) Visualization method, display device, and display program
CN105979021A (en) Information processing method and user terminal
CN109242682B (en) Currency exchange rate conversion method, currency exchange rate conversion device, computer equipment and storage medium
CN106470108B (en) Method and device for generating password of target event
CN109800146B (en) Application program start time testing method and device, computer equipment and storage medium
JP2020195680A5 (en)
CN106411955B (en) A kind of account generation method based on mould m congruence class ring
CN111628862A (en) Multi-party participating random number generation method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant