Lottery drawing method, electronic equipment and computer readable storage medium
By selecting the target to be drawn queue in the lottery system and processing the prizes for new prizes, the problem of unstable winning probability of new prizes in the existing technology is solved, and the stability and fairness of the winning probability are achieved.
Patent Information
- Application Number
- CN202411908678.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-23
- Publication Date
- 2025-06-03
AI Technical Summary
In the existing lottery methods, the winning probability of new prizes is unstable, resulting in uncertainty in the winning results.
When receiving the lottery request, the qualification checksum prize information is carried out. If the preset conditions are met, the target queue will be selected from other lottery queues to add new prizes, and the new prizes will be ensured in the same queue, so that the probability of the prize will be related to itself.
It ensures the winning probability of new prizes and ensures the predictability and fairness of the winning results.
Smart Images

Figure CN120088009A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular, to a lottery method, an electronic device, and a computer-readable storage medium. Background Art
[0002] Currently, the information technology in society develops rapidly, and many offline activities have been replicated on the Internet platform. As one of the most popular offline activities, lottery, after being replicated on the Internet platform, has also become one of the most popular activities on the Internet platform because it can not only expand the platform gameplay but also increase user stickiness.
[0003] The current lottery method usually puts the initial prizes into a prize pool. When the number of initial prizes in the prize pool reaches a preset threshold, the newly added prizes are mixed into the initial prizes in the prize pool to continue the lottery activity. This lottery method will make the winning probability of the newly added prizes unstable. Summary of the Invention
[0004] The main technical problem to be solved by this application is to provide a lottery method, an electronic device, and a computer-readable storage medium, which can ensure the stability of the winning probability when new prizes are added.
[0005] To solve the above technical problem, this application provides a lottery method. The lottery method includes: in response to receiving a lottery request, performing eligibility verification processing according to the lottery request to obtain an eligibility verification result; in response to the eligibility verification result indicating that the requesting object has the lottery eligibility and the obtained prize information in the current lottery queue meets the preset prize addition condition, selecting a target lottery queue from the other lottery queues according to the attribute information of the other lottery queues; performing prize addition processing on the target lottery queue to obtain the target lottery queue after the addition processing; in response to the situation that there are no prizes in the obtained lottery queue, performing lottery processing based on the target lottery queue after the addition processing.
[0006] In one embodiment, the step of performing prize addition processing on the target lottery queue to obtain the target lottery queue after the addition processing includes: obtaining the prizes to be added; randomly generating sorting numbers of each prize to be added in the target lottery queue; sorting each prize to be added according to the sorting numbers of each prize to be added to obtain a target prize sequence, where the target prize sequence includes the prizes to be added sorted according to the sorting numbers; placing the target prize sequence in the target lottery queue to obtain the target lottery queue after the addition processing.
[0007] In one embodiment, the step of sorting each to-be-added prize according to the sorting number of each to-be-added prize to obtain a target prize sequence includes: sorting according to the sorting numbers of each to-be-added prize to obtain an initial prize sequence; performing a verification process on the initial prize sequence to obtain a verification result; in response to the verification result indicating successful verification, determining the initial prize sequence as the target prize sequence; in response to the verification result indicating failed verification, adjusting the to-be-added prizes in the initial prize sequence that are sorted before a preset sorting number to obtain the target prize sequence.
[0008] In one embodiment, the step of obtaining the to-be-added prize includes: obtaining the winning probability of the current lottery queue; determining the winning probability of the target to-be-lottery queue according to the winning probability of the current lottery queue; determining the to-be-added prize according to the winning probability of the target to-be-lottery queue.
[0009] In one embodiment, the attribute information includes the number of prizes and the queue serial number. The step of, in response to the eligibility verification result indicating that the requesting object has the lottery eligibility and the prize information in the obtained current lottery queue satisfies the preset prize addition condition, selecting a target to-be-lottery queue from the other to-be-lottery queues according to the attribute information of the other to-be-lottery queues includes: obtaining the prize information in the current lottery queue; in response to the prize information in the current lottery queue satisfying the preset prize addition condition, determining the other to-be-lottery queues with zero prize quantity as the alternative to-be-lottery queues; selecting the alternative to-be-lottery queue whose queue serial number is adjacent to the queue serial number of the current lottery queue from the alternative to-be-lottery queues as the target to-be-lottery queue.
[0010] In one embodiment, the lottery queue includes the current lottery queue and other lottery queues with prizes. The queue serial number of the current lottery queue is less than the queue serial numbers of the other lottery queues. The step of, in response to there being no prize in the obtained lottery queue, performing a lottery process based on the target to-be-lottery queue after the addition process includes: in response to there being no prize in the current lottery queue, performing a lottery process on the other lottery queues; in response to there being no prize in the other lottery queues, drawing a prize from the target to-be-lottery queue after the addition process.
[0011] In one embodiment, the step of, in response to receiving a lottery request, performing an eligibility verification process according to the lottery request to obtain an eligibility verification result includes: in response to receiving the lottery request, obtaining a request object in the lottery request; determining lottery eligibility information and the current lottery draw times of the request object from a preset database according to the request object, where the preset database includes a correspondence relationship between a preset object, preset lottery eligibility information, and the current lottery draw times; and determining the eligibility verification result according to the lottery eligibility information and the current lottery draw times.
[0012] In one embodiment, the lottery eligibility information includes whether the preset object is an eligible object with lottery eligibility. The step of determining the eligibility verification result according to the lottery eligibility information and the current lottery draw times includes: in response to the lottery eligibility information indicating that the request object is the same as the eligible object and the current lottery draw times being less than a preset times threshold, determining that the eligibility verification result is that the request object has lottery eligibility; and in response to the lottery eligibility information indicating that the request object is not the same as the eligible object and the current lottery draw times being greater than or equal to the preset times threshold, determining that the eligibility verification result is that the request object does not have lottery eligibility.
[0013] To solve the above technical problems, the present application provides an electronic device, including a memory and a processor. The memory stores program instructions, and the processor retrieves the program instructions from the memory to execute the above lottery method.
[0014] To solve the above technical problems, the present application provides a computer-readable storage medium, including: storing program data, where the program data, when executed by a processor, is used to implement the above lottery method.
[0015] In the above solution, in response to receiving a lottery request, an eligibility verification process is performed according to the lottery request to obtain an eligibility verification result; in response to the eligibility verification result indicating that the request object has lottery eligibility and the obtained prize information in the current lottery queue satisfies a preset prize addition condition, a target lottery queue is selected from other lottery queues to be drawn according to the attribute information of the other lottery queues to be drawn; a prize addition process is performed on the target lottery queue to be drawn to obtain the target lottery queue after the addition process; and in response to the absence of prizes in the obtained lottery queue, a lottery process is performed based on the target lottery queue after the addition process. Thus, when the prize information satisfies the preset prize addition condition, the prize addition is performed separately on the target lottery queue to be drawn, so as to ensure that the newly added prizes are in the same queue, making the winning probability of the newly added prizes only related to the newly added prizes themselves and ensuring the stability of the winning probability when adding prizes. Description of the Drawings
[0016] To more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings, where:
[0017] Figure 1 is a schematic flowchart of an exemplary embodiment of a lottery method shown in the present application;
[0018] Figure 2 is Figure 1 a schematic flowchart of an exemplary embodiment of step S130 in the lottery method shown;
[0019] Figure 3 is a schematic state diagram of an exemplary embodiment of prize placement shown in the present application;
[0020] Figure 4 is a schematic state diagram of another exemplary embodiment of prize placement shown in the present application;
[0021] Figure 5 is a schematic state diagram of yet another exemplary embodiment of prize placement shown in the present application;
[0022] Figure 6 is a lottery flowchart of an exemplary embodiment of a lottery device shown in the present application;
[0023] Figure 7 is a flowchart of an exemplary embodiment of a monitoring module in the lottery device shown in the present application;
[0024] Figure 8 is a schematic flowchart of initializing in the lottery method shown in the present application;
[0025] Figure 9 is an application schematic diagram of a lottery method shown in the present application;
[0026] Figure 10 is a block diagram of a lottery device shown in an exemplary embodiment of the present application;
[0027] Figure 11 is a schematic structural diagram of an embodiment of an electronic device provided by the present application;
[0028] Figure 12 is a schematic structural diagram of an embodiment of a computer-readable storage medium provided by the present application. Detailed implementation manners
[0029] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. It can be understood that the specific embodiments described herein are only used to explain the present application, rather than limiting the present application. Additionally, it should be noted that for the sake of description, only the parts related to the present application rather than all the structures are shown in the accompanying drawings. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present application.
[0030] First of all, it should be noted that the current social informatization technology is developing rapidly, and many offline activities have been replicated onto the Internet platform. As one of the most popular offline activities, after being replicated onto the Internet platform, the lottery draw has also become one of the most popular activities on the Internet platform because it can not only expand the platform's gameplay but also increase user stickiness.
[0031] The current lottery draw method usually places the initial prizes in a prize pool. When the number of initial prizes in the prize pool reaches a preset threshold, the newly added prizes are mixed into the initial prizes in the prize pool to continue the lottery draw activity. This lottery draw method will result in unstable winning probabilities for the newly added prizes.
[0032] Based on this, the present application provides a lottery draw method, an electronic device, and a computer-readable storage medium. For details, please refer to Figure 1 , Figure 1 which is a schematic flowchart of an exemplary embodiment of a lottery draw method shown in the present application.
[0033] The execution subject of the lottery draw method in the embodiments of the present application can be a terminal device, a server, or other processing devices. Among them, the terminal device can be a computer, a mobile device, a terminal, a computing device, a vehicle-mounted device, etc. The execution subject of the lottery draw method can also be a lottery draw device. In some possible implementation manners, this lottery draw method can be implemented by a processor invoking computer-readable instructions stored in a memory.
[0034] Specifically, the process of the lottery draw method in the embodiments of the present application includes the following steps:
[0035] Step S110: In response to receiving a lottery draw request, perform eligibility verification processing according to the lottery draw request to obtain an eligibility verification result.
[0036] A lottery draw request refers to the request information for participating in the lottery draw proposed by the request object. For example, the lottery draw request can include the request object, the request address, the request time, etc. Specifically, the lottery draw device receives the request information for participating in the lottery draw sent by the client and determines the received request information for participating in the lottery draw as the lottery draw request. Among them, the client can be a mobile phone, a computer, etc.
[0037] The eligibility verification process refers to the verification of whether the request object has the eligibility to participate in the lottery. For example, the eligibility verification process can be the verification of the number of lottery draws, the verification of whether the request object is consistent with the preset object, and the verification of whether the request address matches the preset lottery address, etc.
[0038] The eligibility verification result refers to the result of the eligibility verification of the request object for the lottery. The eligibility verification result can include that the request object does not have the eligibility to participate in the lottery and that the request object has the eligibility to participate in the lottery.
[0039] The lottery device responds to receiving a lottery request, performs an eligibility verification process according to the lottery request, and obtains an eligibility verification result. Specifically, the lottery device responds to receiving a lottery request, calculates the similarity between the request address in the lottery request and the preset lottery address in the preset lottery address database to obtain the address similarity; if there is a preset lottery address with an address similarity greater than the preset similarity threshold with the request address, it is determined that the eligibility verification result is that the request object has the eligibility to participate in the lottery; if not, it is determined that the eligibility verification result is that the request object does not have the eligibility to participate in the lottery.
[0040] Step S120, in response to the eligibility verification result indicating that the request object has the eligibility to participate in the lottery, and the obtained prize information in the current lottery queue meets the preset prize addition conditions, select a target pending lottery queue from other pending lottery queues according to the attribute information of other pending lottery queues.
[0041] The current lottery queue refers to the queue where the lottery is currently being conducted. The current lottery queue exists in the initial prize pool. The initial prize pool includes multiple queues, and the multiple queues include the current lottery queue and other pending lottery queues. Among them, other pending lottery queues refer to the queues in the initial prize pool other than the current lottery queue. In one embodiment, the preset lottery pool includes at least two queues with a prize quantity of 0, that is, blank queues. The lottery device initializes the blank queues in the preset prize pool to obtain the initial prize pool. Specifically, the lottery device randomly generates sorting numbers for the preset number of initial prizes; places the preset number of initial prizes in a blank queue in the preset prize pool and sorts them according to the sorting numbers of the initial prizes to obtain the initialized queue; conducts a lottery on the initialized queue to obtain the current lottery queue. In another embodiment, the lottery device determines the winning queue in the historical winning record as the current lottery queue. The historical winning record includes the historical winning time and the winning queue corresponding to the historical winning time, and the historical winning time is earlier than the request time in the current lottery request.
[0042] Prize information refers to the information of the prizes in the queue. The prize information can be the winning probability, the number of prizes, the type of prizes, etc. Among them, the type of prizes can be physical objects, points, platform services, coupons, currency, thank you for participating, etc. It should be noted that physical objects, points, platform services, coupons, currency, etc. are valuable prizes, and thank you for participating is a worthless prize.
[0043] The preset prize addition condition refers to the preset condition for performing prize addition processing.
[0044] Attribute information refers to the information of the prizes in the queue. The attribute information can include the number of prizes.
[0045] The target queue to be drawn refers to the queue to which prizes are to be added. The target queue to be drawn can be an empty queue with the number of prizes being 0.
[0046] The lottery device selects the target queue to be drawn from other queues to be drawn according to the attribute information of other queues to be drawn. Specifically, the lottery device determines whether the number of prizes in other queues to be drawn is 0. If so, it determines the other queue to be drawn with the number of prizes being 0 as the target queue to be drawn.
[0047] Step S130: Perform prize addition processing on the target queue to be drawn to obtain the target queue to be drawn after the addition processing.
[0048] Prize addition processing refers to the process of placing new prizes in the queue.
[0049] The lottery device performs prize addition processing on the target queue to be drawn to obtain the target queue to be drawn after the addition processing. Specifically, the lottery device randomly places a preset number of prizes to be added in the target queue to be drawn to obtain the target queue to be drawn after the addition processing.
[0050] Step S140: In response to the absence of prizes in the obtained lottery queue, perform lottery processing based on the target queue to be drawn after the addition processing.
[0051] The lottery queue refers to the queue for performing the lottery. The lottery queue can include the current lottery queue and other lottery queues where prizes may exist, etc. As an example, the lottery device determines the current lottery queue as the lottery queue. As another example, in response to the number of prizes in the current lottery queue being 0, the lottery device performs arithmetic processing on the queue serial number of the current lottery queue to obtain the updated queue serial number; and determines the queue corresponding to the updated queue serial number as the lottery queue. Specifically, the lottery device obtains the sum value between the queue serial number of the current lottery queue and the preset increment value; performs a modulo operation on the quotient of the sum value and the total number of queues in the initial prize pool to obtain the remainder; uses the remainder as the updated queue serial number; and determines the queue corresponding to the updated queue serial number as the lottery queue.
[0052] When the lottery device responds that there is no prize in the obtained lottery queue, it performs lottery processing based on the target lottery queue to be processed after the new addition. Specifically, when the lottery device responds that there is no prize in the current lottery queue, it determines whether there is a prize in other lottery queues; when there is no prize in other lottery queues, it conducts a lottery on the target lottery queue to be processed after the new addition.
[0053] In one embodiment, the preset prize pool includes two blank queues without prizes; after the lottery device initializes one blank queue, an initial prize pool is obtained; the initial prize pool includes a queue with prizes and another queue without prizes; the lottery device starts the first lottery with the queue with prizes as the current lottery queue; when the number of prizes in the current lottery queue is less than or equal to the preset prize quantity threshold, it performs prize addition processing on the other queue without prizes to obtain the target lottery queue to be processed after the new addition; continue to conduct a lottery on the current lottery queue until there is no prize in the current lottery queue; when the lottery device responds that there is no prize in the current lottery queue, it conducts a lottery on the target lottery queue to be processed after the new addition. Among them, the queue numbers of the two queues in the initial prize pool are opposite, and the lottery device performs an inversion operation based on the queue number of the current prize queue to obtain the updated queue number; the queue corresponding to the updated queue number in the initial prize pool is used as the target lottery queue to be processed after the new addition for the lottery.
[0054] It can be seen that in response to receiving a lottery request, qualification verification processing is performed according to the lottery request to obtain a qualification verification result; in response to the qualification verification result indicating that the requesting object has the lottery qualification and the prize information in the obtained current lottery queue meets the preset prize addition condition, the target lottery queue is selected from other lottery queues according to the attribute information of other lottery queues to be processed; prize addition processing is performed on the target lottery queue to be processed to obtain the target lottery queue to be processed after the new addition; when it responds that there is no prize in the obtained lottery queue, lottery processing is performed based on the target lottery queue to be processed after the new addition. Thus, when the prize information meets the preset prize addition condition, prizes are added separately to the target lottery queue, which can ensure that the newly added prizes are in the same queue, making the winning probability of the newly added prizes only related to the newly added prizes themselves and ensuring the stability of the winning probability when adding prizes.
[0055] Before the lottery device responds to receiving a lottery request and performs qualification verification processing according to the lottery request to obtain a qualification verification result, it also includes: performing initialization processing. Specifically, the lottery device obtains the initial prize configuration, which includes various types of initial prizes, and randomly generates sorting numbers for each initial prize; places each initial prize in a blank queue with a prize quantity of 0, and sorts each initial prize in the placed queue according to the sorting number to obtain the initialized queue.
[0056] In one embodiment, the lottery device responds to receiving a lottery request, performs an eligibility verification process according to the lottery request, and obtains an eligibility verification result. Specifically, the lottery device responds to receiving a lottery request, obtains the request object in the lottery request; determines the lottery eligibility information and the current lottery times of the request object from a preset database according to the request object, and the preset database includes the corresponding relationship between the preset object, the preset lottery eligibility information, and the current lottery times; determines the eligibility verification result according to the lottery eligibility information and the current lottery times.
[0057] Among them, the lottery eligibility information includes whether the preset object is an eligible object with lottery eligibility. The lottery device calculates the similarity between the preset object and the request object, and determines the preset object with a similarity greater than the preset threshold as the preset object matching the request object; determines the preset lottery eligibility information and the current lottery times corresponding to the preset object matching the request object as the lottery eligibility information and the current lottery times of the request object; if the preset object in the lottery eligibility information of the request object is an eligible object with lottery eligibility, it is determined that the request object is consistent with the eligible object, and if the preset object in the lottery eligibility information of the request object is an eligible object without lottery eligibility, it is determined that the request object is inconsistent with the eligible object.
[0058] The lottery device determines the eligibility verification result according to the lottery eligibility information and the current lottery times. Specifically, the lottery device responds that the lottery eligibility information indicates that the request object and the eligible object are consistent and the current lottery times are less than the preset times threshold, and determines that the eligibility verification result is that the request object has lottery eligibility; responds that the lottery eligibility information indicates that the request object and the eligible object are inconsistent and the current lottery times are greater than or equal to the preset times threshold, and determines that the eligibility verification result is that the request object does not have lottery eligibility; responds that the lottery eligibility information indicates that the request object and the eligible object are inconsistent, and determines that the eligibility verification result is that the request object does not have lottery eligibility; responds that the current lottery times are greater than or equal to the preset times threshold, and determines that the eligibility verification result is that the request object does not have lottery eligibility.
[0059] Furthermore, the lottery device responds to receiving a lottery request, performs a matching process on the preset objects in the preset request database according to the request object of the lottery request, and obtains a matching result. The preset request database includes the corresponding relationship between the historical lottery requests within the preset historical time period and the preset objects; responds that the matching result indicates that there is a historical lottery request of the request object within the preset historical time period in the preset request database, and determines that the eligibility verification result is that the request object does not have lottery eligibility; responds that the matching result indicates that there is no historical lottery request of the request object within the preset historical time period in the preset request database, and determines that the eligibility verification result is that the request object has lottery eligibility.
[0060] In one embodiment, the attribute information includes the number of prizes and the queue serial number. When the lottery device responds that the qualification verification result indicates that the requesting object has the lottery qualification, and the prize information in the currently obtained lottery queue meets the preset prize addition condition, the lottery device selects a target lottery queue from other lottery queues to be drawn according to the attribute information of other lottery queues to be drawn. Specifically, the lottery device obtains the prize information in the current lottery queue; when the prize information in the current lottery queue meets the preset prize addition condition, it determines the other lottery queues to be drawn with zero prize quantity as the alternative lottery queues to be drawn; and selects the alternative lottery queue whose queue serial number is adjacent to the queue serial number of the current lottery queue as the target lottery queue to be drawn.
[0061] Among them, the prize information can be the number of prizes, the prize drawing speed, and the prize addition speed. The prize information in the current lottery queue meeting the preset prize addition condition includes: the number of prizes in the current lottery queue is less than or equal to a preset first threshold, and / or the difference between the prize drawing speed and the prize addition speed is less than or equal to a preset second threshold.
[0062] Based on the above embodiment, please refer to Figure 2 , Figure 2 is Figure 1 a schematic flowchart of an exemplary embodiment of step S130 in the lottery method shown. Specifically, in step S130, the process of performing prize addition processing on the target lottery queue to be drawn to obtain the target lottery queue after the addition processing includes the following steps:
[0063] Step S210: Obtain the prizes to be added.
[0064] The prizes to be added refer to the prizes waiting to be added to the queue. Specifically, the lottery device determines a preset number of prizes as the prizes to be added. Among them, the number of prizes to be added can be determined by the number of additional rounds. For example, the number of coupons can decrease in each round. The number of prizes to be added can also be the same in each round. For example, the number of "Thank you for participating" is the same in each round. The number of prizes to be added can also increase to a preset multiple of the initial quantity when the lottery speed is greater than a preset speed threshold. For example, when the lottery speed of 100 points is greater than the preset speed threshold, it increases to 1.2 times.
[0065] In one embodiment, the initial prize configuration can be 8,000 "Thank you for participating", 100 100-points, 100 physical items, and 900 coupons. The prizes to be added can include 8,000 "Thank you for participating", 1,200 100-points, 0 physical items, and 800 coupons.
[0066] It can be seen that by presetting the initial prizes and the number of prizes to be newly added, the winning probabilities of various types of prizes are preset probability values. Then, by separately adding the prizes to be newly added to the target lottery queue without mixing them with the initial prizes in the current lottery queue, it is ensured that the winning probability of the prizes to be newly added when placed is consistent with the preset winning probability. At the same time, it is ensured that each prize growth queue contains valuable prizes, the prize winning probability is smoother, and the winning probability is more stable. Moreover, by presetting the number of prizes, the steps of generating the winning numbers and the repetitive judgment are avoided, and the process is more concise.
[0067] In one embodiment, the lottery device obtains the winning probability of the current lottery queue; determines the winning probability of the target lottery queue according to the winning probability of the current lottery queue; and determines the prizes to be newly added according to the winning probability of the target lottery queue. Specifically, the lottery device obtains the number of other prizes and the number of "thank you for participating" in the current lottery queue, where the other prizes are the prizes in the current lottery queue other than "thank you for participating"; obtains the sum value between the number of other prizes and the number of "thank you for participating"; determines the ratio of the number of other prizes to the sum value as the winning probability of the current lottery queue; matches the winning probability of the target lottery queue from the preset winning probability mapping table according to the winning probability of the current lottery queue; the preset winning probability mapping table includes the corresponding relationship between the winning probability of the preset lottery queue and the winning probability of the preset lottery queue; and determines the number of prizes to be newly added as the product of the preset total quantity and the winning probability of the target lottery queue to obtain the prizes to be newly added.
[0068] Step S220: Randomly generate the sorting numbers of each prize to be newly added in the target lottery queue.
[0069] The sorting number refers to the parameter used to sort the prizes.
[0070] The lottery device randomly generates the sorting numbers of each prize to be newly added in the target lottery queue. Specifically, the lottery device uses a random number generator or a disordering algorithm to generate random parameters corresponding to each prize to be newly added, and determines the random parameters corresponding to each prize to be newly added as the sorting numbers of each prize to be newly added in the target lottery queue. For example, the disordering algorithm can be a shuffling algorithm, a random exchange algorithm, a Monte Carlo method, etc.
[0071] Step S230: Sort each prize to be newly added according to the sorting numbers of each prize to be newly added to obtain a target prize sequence, where the target prize sequence includes the prizes to be newly added sorted according to the sorting numbers.
[0072] The target prize sequence refers to the sequence of each prize to be newly added arranged in a certain order.
[0073] The lottery device sorts each to-be-added prize according to the sorting number of each to-be-added prize to obtain a target prize sequence. As an example, the lottery device sorts each to-be-added prize in descending order of the sorting number of each to-be-added prize to obtain a target prize sequence. As another example, the lottery device sorts each to-be-added prize in ascending order of the sorting number of each to-be-added prize to obtain a target prize sequence.
[0074] Step S240: Place the target prize sequence in the target to-be-drawn queue to obtain the target to-be-drawn queue after the addition process.
[0075] The lottery device places the target prize sequence in the target to-be-drawn queue to obtain the target to-be-drawn queue after the addition process.
[0076] Further, the lottery device places each to-be-added prize in the target to-be-drawn queue and sorts each to-be-added prize in the target to-be-drawn queue according to the sorting number of each to-be-added prize to obtain the target to-be-drawn queue after the addition process. In one embodiment, the to-be-added prizes include physical objects, points, and thank you for participating. The lottery device randomly generates the sorting numbers of each to-be-added prize. The sorting number of the physical object is 1231.11, and the sorting numbers of the 3 thank you for participating are 11000.11, 2231.11, and 38 respectively. The sorting numbers of the 2 points are 1555 and 2444 respectively. As Figure 3 shown, the lottery device first places the physical object with the sorting number of 1231.1 in the target to-be-drawn queue according to the preset placement order of physical objects, thank you for participating, and points, and sorts the physical object to obtain the target to-be-drawn queue, and the target to-be-drawn queue includes the physical object 1231.1. As Figure 4 shown, then the lottery device continues to place the 3 thank you for participating with the sorting numbers of 11000.11, 2231.11, and 38 in the target to-be-drawn queue, and sorts the physical object and the thank you for participating in the target to-be-drawn queue according to the sorting number to obtain the Figure 4 shown target to-be-drawn queue. The order of the physical object and the thank you for participating in the target to-be-drawn queue is: thank you for participating 38, physical object 1231.1, thank you for participating 2231.11, thank you for participating 11000.11. As Figure 5 shown, the lottery device finally places the 2 points with the sorting numbers of 1555 and 2444 in the target to-be-drawn queue and sorts them to obtain the Figure 5 shown target to-be-drawn queue. The order of the physical object, the thank you for participating, and the points in the target to-be-drawn queue is: thank you for participating 38, physical object 1231.1, points 1555, thank you for participating 2231.11, points 2444, thank you for participating 11000.11.
[0077] It can be seen that by obtaining the prizes to be newly added, randomly generating the sorting numbers of each prize to be newly added in the target lottery queue, then sorting each prize to be newly added according to the sorting numbers of each prize to be newly added to obtain the target prize sequence, and then placing the target prize sequence in the target lottery queue, the target lottery queue after the addition process is obtained. Thus, by adding each prize to be newly added to the target lottery queue, it is ensured that each prize to be newly added is not mixed with other prizes, and the winning probability of the newly added prizes is ensured to be stable.
[0078] The lottery device sorts each prize to be newly added according to the sorting numbers of each prize to be newly added to obtain the target prize sequence. Specifically, the lottery device performs a sorting process according to the sorting numbers of each prize to be newly added to obtain the initial prize sequence; performs a verification process on the initial prize sequence to obtain a verification result; in response to the verification result indicating successful verification, determines the initial prize sequence as the target prize sequence; in response to the verification result indicating failed verification, adjusts the prizes to be newly added in the initial prize sequence that are sorted before the preset sorting number to obtain the target prize sequence.
[0079] The lottery device performs a sorting process according to the sorting numbers of each prize to be newly added to obtain the initial prize sequence. For example, the lottery device sorts each prize to be newly added in ascending order of the sorting number to obtain the initial prize sequence.
[0080] The lottery device performs a verification process on the initial prize sequence to obtain a verification result. As an example, the lottery device obtains the prizes to be newly added in the initial prize sequence that are sorted before the preset sorting number, and determines whether the prizes to be newly added that are sorted before the preset sorting number are prizes of a preset type. If so, determines the verification as failed as the verification result, and if not, determines the verification as successful as the verification result. For example, the lottery device obtains the prizes to be newly added in the first 10 positions of the initial prize sequence, and determines whether the prizes to be newly added in the first 10 positions are all "Thank you for participating". If so, determines the verification as failed as the verification result, and if not, determines the verification as successful as the verification result. Another example is that the lottery device obtains the prizes to be newly added in the first 3 positions of the initial prize sequence, and determines whether the prizes to be newly added in the first 3 positions are all physical objects. If so, determines the verification as failed as the verification result, and if not, determines the verification as successful as the verification result.
[0081] If the lottery device responds that the verification fails according to the verification result, it adjusts the prizes to be newly added in the initial prize sequence whose sorting is before the preset sorting number to obtain the target prize sequence. As an example, if the lottery device responds that the verification fails according to the verification result, it regenerates the sorting numbers of the prizes to be newly added before the preset sorting number, and re-sorts each prize to be newly added with the regenerated sorting number and other prizes to be newly added in the initial prize sequence to obtain the target prize sequence. As another example, if the lottery device responds that the verification fails according to the verification result, it selects a prize to be newly added with a different type from the prizes to be newly added after the preset sorting number from the prizes to be newly added; randomly inserts the prize to be newly added with a different type into the prizes to be newly added before the preset sorting number to obtain the target prize sequence.
[0082] In one embodiment, the lottery queue includes the current lottery queue and other lottery queues with prizes, and the queue number of the current lottery queue is less than the queue numbers of other lottery queues. The steps for the lottery device to perform lottery processing based on the target lottery queue after addition processing in response to the fact that there are no prizes in the obtained lottery queue include: in response to the fact that there are no prizes in the current lottery queue, performing lottery processing on other lottery queues; in response to the fact that there are no prizes in other lottery queues, drawing prizes from the target lottery queue after addition processing.
[0083] The lottery device obtains the number of prizes in the lottery queue, and determines whether the number of prizes in the lottery queue is 0. If so, it determines that there are no prizes in the lottery queue; if not, it determines that there are prizes in the lottery queue. Among them, the lottery queue can be the current lottery queue or other lottery queues.
[0084] The lottery device performs lottery processing on other lottery queues. Specifically, the lottery device takes the prize ranked first in other lottery queues as the target prize won by the requesting object.
[0085] The lottery device draws prizes from the target lottery queue after addition processing. Specifically, the lottery device takes the prize ranked first in the target lottery queue after addition processing as the target prize won by the requesting object. Thus, by sorting the prizes and directly taking the prize ranked first in the queue as the won target prize, the speed of obtaining prizes is faster.
[0086] Furthermore, the lottery device obtains the inventory quantity of the target prize won by the requesting object. In response to the fact that the inventory quantity of the target prize is 0, it sends a "Thank you for participating" to the client that sent the lottery request. Thus, on the one hand, the number of "Thank you for participating" is increased, pulling down the winning probability; on the other hand, the situation of winning but having no prizes is avoided.
[0087] In one embodiment, Figure 6The drawing flow chart of an exemplary embodiment of the lottery device shown in this application. As Figure 6 shown, the process of the lottery device for conducting a lottery includes the following steps:
[0088] Step S600: After receiving the current lottery request, the lottery process starts.
[0089] Step S610: Determine whether the requested object is eligible for the lottery. If not, execute step S620; if so, execute step S630.
[0090] Step S620: Prompt that the requested object is not eligible for the lottery, and then execute step S690.
[0091] Step S630: Determine whether a new prize needs to be added. If so, execute step S640; if not, execute step S650.
[0092] Step S640: Prompt that a new prize needs to be added; after receiving the new instruction, perform the new prize addition process, and then execute step S650.
[0093] Step S650: Obtain the lottery queue.
[0094] Step S660: Determine whether there is a prize in the lottery queue. If not, execute step S670; if so, execute step S680.
[0095] Step S670: Update the queue serial number and return to step S650.
[0096] Step S680: Pop up the prize at the head of the lottery queue.
[0097] Step S690: The lottery process for the current lottery request ends.
[0098] Furthermore, the lottery device may include an object record interception module. The object record interception module in the lottery device records the winning information and performs eligibility verification processing according to the lottery request to obtain an eligibility verification result; in response to the eligibility verification result indicating that the requested object is not eligible for the lottery, the lottery request is intercepted. Thus, through the eligibility verification by the object record interception module, the invasion of the gray industry can be prevented and the security can be improved.
[0099] Among them, the object record interception module uses a time-expired storage device to store lottery requests for a preset time period. The data stored in the time-expired storage device automatically becomes invalid or is deleted after the preset time period. For example, the time-expired storage device can be Redis (Remote Dictionary Server), etc. The object record interception module uses a persistent storage device to store winning records. The data stored in the persistent storage device can be permanently stored. For example, the persistent storage device can be a row-based or column-based storage device such as Mysql (My Structured Query Language), ClickHouse (Click Stream Data WareHouse), etc.
[0100] Furthermore, the lottery device may further include a monitoring module. The monitoring module in the lottery device monitors the prize information to obtain a monitoring result. In response to the monitoring result indicating that the number of prizes is insufficient, a target pending lottery queue is selected from other pending lottery queues according to the attribute information of other pending lottery queues; the target pending lottery queue is processed for adding prizes to obtain the target pending lottery queue after the addition process. For example, the monitoring module in the lottery device obtains the prize information in the current lottery queue. In response to the prize information in the current lottery queue meeting the preset prize addition condition, it determines that the number of prizes is insufficient as the monitoring result, otherwise it determines that the number of prizes is sufficient as the monitoring result.
[0101] Figure 7 It is a flowchart of an exemplary embodiment of the monitoring module in the lottery device shown in this application. The monitoring process of the monitoring module includes the following steps:
[0102] Step S710: Statistically count the number of prizes in the lottery queue at every preset time interval to obtain the total current number of prizes.
[0103] Step S720: Determine whether the total current number of prizes is less than or equal to a preset quantity threshold. If so, execute step S730; if not, end.
[0104] Step S730: Determine the other pending lottery queues with the obtained number of prizes being 0 as the queues to be processed.
[0105] Step S740: Obtain the new prize configuration, where the new prize configuration includes various types of prizes to be newly added.
[0106] Step S750: Randomly generate the sorting numbers of each prize to be newly added in the queue to be processed, sort each prize to be newly added according to the sorting numbers of each prize to be newly added to obtain a sequence of prizes to be newly added, and place the sequence of prizes to be newly added in the queue to be processed to obtain the lottery queue.
[0107] For example, the preset quantity threshold may be 20% of the initial prize quantity. When the current total prize quantity is less than or equal to 20% of the initial prize quantity, the lottery device performs prize addition processing.
[0108] Furthermore, the monitoring module further includes: statistically calculating the prize addition speed and the prize drawing speed in the lottery queue at every preset time interval to obtain the prize addition speed and the prize drawing speed; in response to the prize addition speed being less than the prize drawing speed, increasing the quantity of the prizes to be newly added by a preset multiple in the step of performing prize addition processing on the target lottery queue or the queue to be processed; in response to the prize addition speed being greater than the preset multiple of the prize drawing speed, reducing the quantity of the prizes to be newly added by a preset multiple in the step of performing prize addition processing on the target lottery queue or the queue to be processed. Thus, by changing the quantity of the prizes to be newly added, the winning probability can be changed to other fixed probabilities during the lottery activity, which is beneficial to dealing with the situation where the number of request objects is first large and then small, such as new user acquisition lottery activities, etc., and improves flexibility.
[0109] As Figure 8 shown, the process of initializing the lottery device may further include the following steps:
[0110] Step S810: Obtain the initial prize configuration, where the initial prize configuration includes the quantity of each type of initial prize, and randomly generate the sorting numbers of the initial prizes.
[0111] Step S820: Place the initial prizes in an empty queue with a prize quantity of 0, and sort each initial prize in the placed queue according to the sorting number to obtain the initialized queue.
[0112] Step S830: Turn on the object record interception module.
[0113] Step S840: Turn on the monitoring module.
[0114] As Figure 9 shown, when the lottery device receives a lottery request, it performs eligibility verification on the lottery request through the object record interception module to obtain the eligibility verification result; in response to the eligibility verification result indicating that the requesting object has the lottery eligibility, it monitors the prize information of queues 1 to n in the initial prize pool through the monitoring module, and when the prize information meets the preset prize addition conditions, it performs prize addition processing on the queue without prizes; then it determines the lottery queue from queues 1 to n, pops the drawn prize from the head of the lottery queue, and returns the drawn prize to the object record interception module for recording.
[0115] Figure 10It is a block diagram of a lottery device shown in an exemplary embodiment of the present application. As Figure 10 shown, the exemplary lottery device 1000 includes: an eligibility verification module 1010, a selection module 1020, a prize addition module 1030, and a lottery module 1040. Specifically:
[0116] The eligibility verification module 1010 is configured to, in response to receiving a lottery request, perform eligibility verification processing according to the lottery request to obtain an eligibility verification result.
[0117] The selection module 1020 is configured to, in response to the eligibility verification result indicating that the requesting object is eligible for the lottery and the prize information in the currently obtained lottery queue satisfies the preset prize addition condition, select a target lottery queue from other lottery queues according to the attribute information of other lottery queues.
[0118] The prize addition module 1030 is configured to perform prize addition processing on the target lottery queue to obtain the target lottery queue after the addition processing.
[0119] The lottery module 1040 is configured to, in response to the absence of prizes in the obtained lottery queue, perform lottery processing based on the target lottery queue after the addition processing.
[0120] In this exemplary lottery device, in response to receiving a lottery request, eligibility verification processing is performed according to the lottery request to obtain an eligibility verification result; in response to the eligibility verification result indicating that the requesting object is eligible for the lottery and the prize information in the currently obtained lottery queue satisfies the preset prize addition condition, a target lottery queue is selected from other lottery queues according to the attribute information of other lottery queues; prize addition processing is performed on the target lottery queue to obtain the target lottery queue after the addition processing; in response to the absence of prizes in the obtained lottery queue, lottery processing is performed based on the target lottery queue after the addition processing. Thus, when the prize information satisfies the preset prize addition condition, prizes are added to the target lottery queue separately, so as to ensure that the added prizes are in the same queue, making the winning probability of the added prizes only related to the added prizes themselves, and ensuring the stability of the winning probability when performing lottery based on the target lottery queue after prize addition.
[0121] Among them, the functions of each module can be referred to the embodiments of the lottery method, which will not be elaborated here.
[0122] To implement the lottery method of the above embodiment, the present application proposes another electronic device. For details, please refer to Figure 11 , Figure 11 It is a schematic structural diagram of an embodiment of the electronic device provided by the present application.
[0123] The electronic device 1100 includes a memory 1101 and a processor 1102, wherein the memory 1101 and the processor 1102 are coupled.
[0124] The memory 1101 is used to store program data, and the processor 1102 is used to execute the program data to implement the lottery method of the above embodiments.
[0125] In this embodiment, the processor 1102 can also be referred to as a CPU (Central Processing Unit). The processor 1102 may be an integrated circuit chip with signal processing capabilities. The processor 1102 can also be a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field-programmable gate array, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor 1102 can also be any conventional processor, etc.
[0126] This application also provides a computer-readable storage medium, such as Figure 12 shown, the computer-readable storage medium 1200 is used to store program data 1201, and when the program data 1201 is executed by the processor, it is used to implement the lottery method in the method embodiment of this application.
[0127] The method involved in the method embodiment of the lottery method of this application, when implemented in the form of a software functional unit and sold or used as an independent product, can be stored in a device, such as a computer-readable storage medium. Based on such an understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the methods described in various embodiments of the present invention. And the aforementioned storage medium includes: USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical disks, etc., which can store program codes.
[0128] The above are only the embodiments of this application, and do not limit the patent scope of this application. Any equivalent structure or equivalent process transformation made using the specification and drawings of this application, or directly or indirectly applied in other related technical fields, shall be included in the patent protection scope of this application by the same token.
Claims
1. A lottery method, characterized in that: The method comprises: In response to receiving a lottery request, performing qualification verification processing according to the lottery request to obtain a qualification verification result; In response to the qualification verification result indicating that the requesting object is qualified for the lottery, and the prize information obtained in the current lottery queue meets the preset prize addition condition, a target lottery queue is selected from the other lottery queues according to the attribute information of the other lottery queues; Performing a prize adding process on the target lottery queue to obtain a target lottery queue after the adding process; In response to the absence of prizes in the obtained lottery queue, a lottery process is performed based on the newly processed target lottery queue.
2. The lottery method according to claim 1, characterized in that: The step of performing a prize adding process on the target lottery queue to obtain the newly added target lottery queue comprises: Get new prizes to be added; Randomly generate a ranking number for each prize to be added in the target draw queue; Sorting each prize to be added according to its ranking number to obtain a target prize sequence, wherein the target prize sequence includes the prizes to be added sorted according to the ranking number; The target prize sequence is placed in the target lottery queue to obtain the newly processed target lottery queue.
3. The lottery method according to claim 2, characterized in that: The step of sorting the prizes to be added according to their sorting numbers to obtain a target prize sequence includes: Sorting is performed according to the ranking numbers of the prizes to be added to obtain an initial prize sequence; Performing verification processing on the initial prize sequence to obtain a verification result; In response to the verification result indicating successful verification, determining the initial prize sequence as the target prize sequence; In response to the verification result indicating a verification failure, the prizes to be added that are ranked before the preset ranking number in the initial prize sequence are adjusted to obtain the target prize sequence.
4. The lottery method according to claim 2, characterized in that: The step of obtaining the prize to be added includes: Obtain the winning probability of the current lottery queue; Determine the winning probability of the target lottery queue according to the winning probability of the current lottery queue; The prize to be added is determined according to the winning probability of the target lottery queue.
5. The lottery method according to claim 1, characterized in that: The attribute information includes the number of prizes and the queue number. In response to the qualification verification result indicating that the requesting object is qualified for the lottery, and the prize information obtained in the current lottery queue meets the preset prize addition condition, the step of selecting a target lottery queue from the other lottery queues according to the attribute information of the other lottery queues includes: Obtain prize information in the current lottery queue; In response to the prize information in the current lottery queue satisfying the preset prize adding condition, determining the other lottery queues with zero prize quantity as the alternative lottery queues; The candidate queue to be drawn whose queue number is adjacent to the queue number of the current draw queue in the candidate queue to be drawn is selected as the target queue to be drawn.
6. The lottery method according to claim 1, characterized in that: The lottery queue includes the current lottery queue and other lottery queues with prizes, the queue number of the current lottery queue is smaller than the queue number of the other lottery queues, and in response to the fact that there is no prize in the obtained lottery queue, the step of performing lottery processing based on the newly processed target lottery queue includes: In response to the absence of a prize in the current lottery queue, performing lottery processing on the other lottery queues; In response to the absence of prizes in the other lottery queues, prizes are drawn from the newly processed target lottery queue.
7. The lottery method according to claim 1, characterized in that: In response to receiving the lottery request, the step of performing qualification verification processing according to the lottery request to obtain the qualification verification result includes: In response to receiving the lottery request, obtaining a request object in the lottery request; Determining the lottery qualification information and the current lottery number of the requesting object from a preset database according to the requesting object, wherein the preset database includes a correspondence between preset objects, preset lottery qualification information and the current lottery number; The qualification verification result is determined according to the lottery qualification information and the current lottery number.
8. The lottery method according to claim 7, characterized in that: The lottery qualification information includes whether the preset object is a qualified object with lottery qualification, and the step of determining the qualification verification result according to the lottery qualification information and the current lottery number includes: In response to the lottery qualification information indicating that the request object and the qualification object are consistent and the current lottery number is less than a preset number threshold, determining that the qualification verification result is that the request object is qualified for the lottery; In response to the lottery qualification information indicating that the request object and the qualification object are inconsistent and the current lottery number is greater than or equal to a preset number threshold, it is determined that the qualification verification result is that the request object is not qualified for the lottery.
9. An electronic device, characterized in that: include: A memory and a processor, wherein the memory stores program instructions, and the processor retrieves the program instructions from the memory to execute the lottery method according to any one of claims 1-8.
10. A computer-readable storage medium, characterized in that: include: Program data is stored, and when the program data is executed by a processor, it is used to implement the lottery method according to any one of claims 1 to 8.