Lottery drawing method and device, electronic equipment and storage medium

By obtaining and processing the user identity information and lottery indication parameters of candidate users, determining the target lottery indication parameters and selecting the winning user, the problem of performance pressure in the game's full server lottery activities is solved, and more efficient system operation is achieved.

CN119991202AActive Publication Date: 2025-05-13NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411996549.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-05-13
Estimated Expiration
2044-12-31

AI Technical Summary

Technical Problem

In the game full server lottery, due to the large number of players participating, a large amount of memory space and calculation amount is required, resulting in performance pressure.

Method used

By obtaining the user identity information and lottery indication parameters of the candidate users to be drawn, the target lottery indication parameters for participating in the lottery are determined, and based on the number of users and user identity information corresponding to the parameter, the winning user is determined from the target candidate users to avoid reading the lottery-related data of all candidate users.

Benefits of technology

It reduces the performance pressure during the game's full server lottery and improves the system's operating efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119991202A_ABST
    Figure CN119991202A_ABST
Patent Text Reader

Abstract

The invention discloses a lottery drawing method and device, electronic equipment and a computer readable storage medium. According to the embodiment of the invention, user identity information and lottery drawing indication parameters of a plurality of candidate users to be subjected to lottery drawing are acquired; determining the number of candidate users corresponding to the lottery drawing indication parameters; determining a target lottery drawing indication parameter participating in lottery drawing from the lottery drawing indication parameters; and determining a winning user from the candidate users corresponding to the target lottery drawing indication parameter based on the user number corresponding to the target lottery drawing indication parameter and the user identity information of each candidate user. According to the embodiment of the invention, the performance pressure existing during the full-clothing lottery drawing activity of the game can be relieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of data processing technology, and in particular to a lottery method, device, electronic device and storage medium. Background Art

[0002] Under the wave of the Internet, the continuous development and evolution of hardware and software technologies have promoted the emergence of smart devices and software. At the same time, a large number of games with different themes have emerged to meet the needs of users, and some game activities are often set up in game operations to enhance the activity of players, such as the game-wide lucky draw, which is an activity in which multiple players in the game participate in the lucky draw together.

[0003] Currently, in a game server-wide lottery event, it is generally necessary to read all lottery-related data of the players who need to draw the lottery into the memory for the lottery operation. However, due to the large number of participating players, a large memory space and computing power are required, which leads to greater performance pressure when conducting a game server-wide lottery event. Summary of the invention

[0004] The embodiments of the present application provide a lottery method, device, electronic device and storage medium, which can reduce the performance pressure when conducting a lottery activity for the entire game server.

[0005] In a first aspect, an embodiment of the present application provides a lottery method, the method comprising:

[0006] Obtaining user identity information and lottery indication parameters of multiple candidate users to be drawn;

[0007] Determine the number of candidate users corresponding to each of the above lottery indication parameters;

[0008] Determining target lottery indication parameters for participating in the lottery from the above lottery indication parameters;

[0009] Based on the number of users corresponding to the target lottery indication parameter and the user identity information of each of the candidate users, a winning user is determined from the candidate users corresponding to the target lottery indication parameter.

[0010] In a second aspect, an embodiment of the present application provides a lottery device, the device comprising:

[0011] A parameter acquisition module, used to obtain user identity information and lottery indication parameters of multiple candidate users to be drawn;

[0012] A quantity determination module, used to determine the number of candidate users corresponding to each of the above lottery indication parameters;

[0013] A parameter determination module, used to determine target lottery indication parameters for participating in the lottery from the above lottery indication parameters;

[0014] The user determination module is used to determine the winning user from the candidate users corresponding to the target lottery indication parameter based on the number of users corresponding to the target lottery indication parameter and the user identity information of each of the candidate users.

[0015] In a third aspect, an embodiment of the present application further provides an electronic device, comprising a memory storing a plurality of instructions; a processor loads instructions from the memory to execute the steps of any one of the lottery methods provided in the embodiments of the present application.

[0016] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, which stores a plurality of instructions suitable for loading by a processor to execute the steps of any lottery method provided in the embodiment of the present application.

[0017] In a fifth aspect, an embodiment of the present application further provides a computer program product, including a computer program or instructions, which, when executed by a processor, implements the steps of any lottery method provided in the embodiment of the present application.

[0018] By adopting the scheme of the embodiment of the present application, the user identity information and lottery indication parameters of multiple candidate users to be drawn can be obtained to determine the number of candidate users corresponding to each of the above lottery indication parameters, and then, the target lottery indication parameters participating in the lottery are determined from the above lottery indication parameters. Finally, based on the number of users corresponding to the above target lottery indication parameters and the above user identity information of each of the above candidate users, the winning user is determined from the candidate users corresponding to the above target lottery indication parameters. Therefore, it is only necessary to determine the target lottery indication parameters participating in the lottery from multiple lottery indication parameters to select the winning user from the candidate users corresponding to the target lottery parameter, thereby avoiding the process of reading the lottery-related data of all candidate users for the lottery, and greatly alleviating the performance pressure existing when conducting a lottery activity for the entire game server. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0020] Figure 1 This is a schematic diagram of an embodiment of the lottery method provided in the embodiments of the present application;

[0021] Figure 2 It is a structural schematic diagram of the lottery method provided in the embodiment of the present application;

[0022] Figure 3 It is a structural schematic diagram of a lottery device provided in an embodiment of the present application;

[0023] Figure 4 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0024] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present application. At the same time, in the description of the embodiments of the present application, the terms "first", "second", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more features. In the description of the embodiments of the present application, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.

[0025] Embodiments of the present application provide a lottery method, device, electronic device, and computer-readable storage medium.

[0026] Specifically, this embodiment will be described from the perspective of a lottery device, which can be integrated into an electronic device, that is, the lottery method of the embodiment of the present application can be executed by an electronic device, and optionally, the electronic device can include: a terminal device. The terminal device can be a mobile phone, a tablet computer, a smart Bluetooth device, a laptop computer, a game console, or a personal computer (PC) and other devices.

[0027] The lottery method provided in the embodiment of the present application can be applied to a lottery system. The lottery system may include a player terminal device and a server, and the terminal may be a device including both receiving and transmitting hardware, that is, a device having receiving and transmitting hardware capable of performing two-way communication on a two-way communication link. The player terminal device and the server may perform two-way communication via a network.

[0028] Optionally, the server may be an independent server, or a server network or server cluster composed of servers, including but not limited to a computer, a network host, a single network server, a plurality of network server sets or a cloud server composed of multiple servers. The cloud server is composed of a large number of computers or network servers based on cloud computing.

[0029] The following is a detailed description in conjunction with the accompanying drawings. In this embodiment, the execution subject is a terminal device as an example. It should be noted that the description order of the following embodiments is not intended to limit the preferred order of the embodiments. Although the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in an order different from that shown in the accompanying drawings.

[0030] The lottery method of this embodiment can obtain user identity information and lottery indication parameters of multiple candidate users to be drawn; determine the number of candidate users corresponding to each of the above lottery indication parameters; determine the target lottery indication parameters participating in the lottery from the above lottery indication parameters; based on the number of users corresponding to the above target lottery indication parameters and the above user identity information of each of the above candidate users, determine the winning user from the candidate users corresponding to the above target lottery indication parameters, which can reduce the performance pressure that exists when conducting a lottery activity for the entire game server.

[0031] Please refer to Figure 1 Taking a terminal as an example, this embodiment provides a lottery method. The specific process of the lottery method can be as follows: Step 101 to Step 104, wherein:

[0032] Step 101: Obtain user identity information and lottery indication parameters of multiple candidate users to be drawn.

[0033] Among them, the above-mentioned candidate users are users who participate in the lottery and meet the lottery conditions corresponding to the lottery. Different lottery conditions correspond to different lottery activities. For example, some activities require players to complete specific tasks or activities. For example, some lottery activities require players to log in to the game within a specific time period. The specific settings can be made according to needs and are not limited here.

[0034] In this embodiment, by obtaining user identity information and lottery indication parameters of multiple candidate users to be drawn, when the corresponding lottery activity is drawn, a winning user can be selected from the candidate users based on the user identity information and lottery indication parameters of the candidate users.

[0035] Among them, the above-mentioned user identity information is used to indicate the identity of the candidate user, such as user account ID, user name, etc., which can be set according to needs and is not limited here.

[0036] Among them, the above-mentioned lottery indication parameters are used to indicate the parameters that affect the user's winning situation when the candidate user participates in the game lottery. The above-mentioned lottery indication parameters include but are not limited to the user server ID, the lottery timestamp when the user participates in the lottery, the user weight indication parameter, etc., which can be specifically set according to the lottery algorithm corresponding to the lottery activity, and is not limited here. For example, if the lottery algorithm is a uniform random lottery algorithm, then the lottery indication parameters may include the user server ID, the lottery timestamp when the user participates in the lottery, etc.; if the lottery algorithm is a weight-based random lottery algorithm, then the lottery indication parameters may include the user weight indication parameter.

[0037] Among them, the above-mentioned user server ID is used to indicate the ID of the server associated with the client to which the candidate user belongs; the lottery timestamp can be the time information triggered by the candidate user in the lottery activity, for example, the time when the user identity information and lottery indication parameters of the candidate user are obtained. The lottery timestamp can also be the time when the candidate user is triggered in a non-lottery activity in the game; the above-mentioned user weight indication parameter is used to indicate the basic weight configured for the candidate user, and the basic weight is used to control the winning probability of the candidate user during the lottery. The larger the basic weight, the higher the corresponding winning probability.

[0038] It is understandable that in order to increase the fun and interactivity of the game, the lottery indication parameters can be associated with the user's performance in the game. Specifically, the terminal can set multiple user attribute ranges based on the user's performance in the game, and different user attribute ranges correspond to different lottery indication parameters. The corresponding lottery indication parameters, such as the user weight indication parameters, are determined according to the user attribute ranges corresponding to the performance of different users in the game. The user attribute ranges corresponding to different user weight indication parameters are different. The above-mentioned user attribute range can be set according to the user's VIP level in the game, or according to the user's player growth level in the game, or according to the role attribute value of the game character controlled by the user in the game, etc. It can be set according to the specific needs and is not limited here.

[0039] For example, as shown in the following parameter configuration table:

[0040] User weight indication parameter User attribute range (player growth level) Base Weight 1 1-100 15 2 101-200 15 3 201-300 20 4 301-400 20 5 401-500 30

[0041] Among them, the user weight indication parameters are set to weight number 1, weight number 2, weight number 3, weight number 4 and weight number 5, and weight number 1, weight number 2, weight number 3, weight number 4 and weight number 5 correspond to different user attribute ranges respectively. For example, the user attribute range corresponding to weight number 1 is player growth level 1 to player growth level 100, the user attribute range corresponding to weight number 2 is player growth level 101 to player growth level 200, the user attribute range corresponding to weight number 3 is player growth level 201 to player growth level 300, the user attribute range corresponding to weight number 4 is player growth level 301 to player growth level 400, and the user attribute range corresponding to weight number 5 is player growth level 401 to player growth level 500.

[0042] In addition, the table also sets basic weights for each user weight indication parameter, such as the basic weight corresponding to weight number 1 is 15, the basic weight corresponding to weight number 2 is 15, the basic weight corresponding to weight number 3 is 20, the basic weight corresponding to weight number 4 is 20, and the basic weight corresponding to weight number 5 is 30, so that the basic weight can be used to indicate the winning probability corresponding to the corresponding user weight indication parameter.

[0043] In the example, the lottery indication parameters (such as user weight indication parameters) of the candidate user can be clarified based on the above table. If the player growth level of the candidate user is between player growth level 1 and player growth level 100, weight number 1 is used as the lottery indication parameter of the candidate user; if the player growth level of the candidate user is between player growth level 101 and player growth level 200, weight number 2 is used as the lottery indication parameter of the candidate user; if the player growth level of the candidate user is between player growth level 201 and player growth level 300, weight number 3 is used as the lottery indication parameter of the candidate user; if the player growth level of the candidate user is between player growth level 301 and player growth level 400, weight number 4 is used as the lottery indication parameter of the candidate user; if the player growth level of the candidate user is between player growth level 401 and player growth level 500, weight number 5 is used as the lottery indication parameter of the candidate user.

[0044] It is understandable that the above parameter configuration table can be adjusted according to demand, for example, it can be designed according to VIP level instead of player growth level, by changing the parameter configuration table in the database, such as storing the parameter configuration table in the Redis database. If the basic weight needs to be modified, it is only necessary to modify the basic weight in the parameter configuration table. In the algorithm step, it will take effect by reading the modified parameter configuration table. There is no need to modify the user data of all relevant candidate users in the Redis data, such as the user data on weights, which avoids the need to modify the amount of data when configuring a basic weight for each candidate user and associating and storing the basic weight configured for each candidate user.

[0045] It is understandable that when the lottery indication parameters of the candidate user change, the lottery indication parameters of the candidate user can be re-acquired before the lottery activity is opened.

[0046] In some embodiments, since each candidate user corresponds to a lottery indication parameter, and the lottery indication parameters corresponding to different candidate users may be the same or different, in order to better arrange the user data of the candidate users so as to quickly query the user identity information of the corresponding winning user from the arranged user data, the terminal can store the user identity information and lottery indication parameters of each candidate user based on the lottery indication parameter when storing the user identity information and lottery indication parameters of each candidate user.

[0047] Specifically, the above-mentioned lottery indication parameters can be configured with a parameter order, such as weight number 1 to weight number 5 in the above-mentioned parameter configuration table, and then, the above-mentioned user identity information of multiple above-mentioned candidate users can be arranged in order in the storage space according to the parameter order of the above-mentioned lottery indication parameters, and the user identity information corresponding to the same above-mentioned lottery indication parameters are arranged adjacently.

[0048] Exemplarily, if the lottery indication parameter is a user weight indication parameter, there is a certain order between the weight numbers corresponding to different user attribute ranges, that is, the higher the user attribute range, the larger the weight number. Then, the user identity information of the candidate users corresponding to each weight number can be arranged according to the order of the weight numbers. For example, based on the above parameter configuration table, the user identity information of the candidate user with a weight number of 1 is arranged and stored first, and then the user identity information of the candidate user with a weight number of 2 is arranged and stored, and then the user identity information of the candidate user with a weight number of 3 is arranged and stored, and then the user identity information of the candidate user with a weight number of 4 is arranged and stored, and finally, the user identity information of the candidate user with a weight number of 5 is arranged and stored.

[0049] In some embodiments, the storage space includes a zset ordered set in a Redis database, wherein the user identity information of the candidate user in the zset ordered set is a member value, and the lottery indication parameter is a score value.

[0050] Among them, the above-mentioned Redis database is an in-memory database. Different from the traditional database, the in-memory database needs to store the acquired data in the memory. The high availability of data storage can be achieved by deploying a cluster. In addition, the Redis database is used to store and read the user data of candidate users, which reduces the read and write performance pressure of the database storing the original business data. When the amount of user data in the whole server lottery is large, the performance pressure of data storage and reading can be reduced.

[0051] It can be understood that by storing the user identity information and lottery indication parameters of multiple candidate users in the zset ordered set in the form of member-score, the user identity information of multiple candidate users in the zset ordered set can be arranged and stored according to the parameter order of the lottery indication parameters, so that when necessary, user identity information within a certain range can be selected according to the range of the lottery indication parameters.

[0052] Furthermore, since there may be multiple lottery activities and / or multiple lottery cycles for the same lottery activity, that is, each time period is a lottery cycle, and a user lottery is completed within a lottery cycle to select the corresponding winning user, in order to be able to distinguish the zset ordered sets corresponding to different lottery activities and / or lottery activities in different lottery cycles in the Redis database, so as to obtain the user data of the candidate user from the correct zset ordered set, in the Redis database of this embodiment, the corresponding activity time identifier can also be associated with the zset ordered set for storage.

[0053] Among them, the above-mentioned activity time identifier is used to identify the lottery activity, or different lottery cycles of the same lottery activity. The above-mentioned activity time identifier can be obtained based on at least one information combination such as the lottery activity name, the lottery cycle, the lottery draw time in the lottery cycle, etc., such as encoding the combined information to obtain the activity time identifier, which is convenient for distinguishing different lottery draws.

[0054] Specifically, since the Redis database can store data in the form of key-value, the lottery data of each period can be stored in the Redis database by using the above activity time identifier as the key value and the above zset ordered set as the value value.

[0055] In some embodiments, since it may be necessary to monitor multiple lottery activities at the same time, as well as different lottery periods of multiple lottery activities, timers may be set for different lottery activities or different lottery periods of lottery activities, so that after the lottery opening time specified by the timer is reached, the lottery opening logic in the lottery algorithm of the corresponding lottery activity may be executed to select the corresponding winning user. Among them, the configuration opening time, the number of winners, the winning reward and other information may be obtained for each lottery through the configuration table.

[0056] In some embodiments, in order to further improve the efficiency of determining the winning users of a lottery activity, different nodes can be set to handle different tasks respectively. For example, the above-mentioned lottery method can be applied to a lottery center node, so that each step of the above-mentioned lottery method can be executed through the lottery center node, and the above-mentioned lottery center node is connected to multiple lottery sub-nodes, so that different lottery sub-nodes can upload the user identity information and lottery indication parameters of candidate users to the lottery center node, so as to reduce the time required for the lottery center node to calculate the lottery indication parameters using the user data of the candidate users.

[0057] Specifically, the above-mentioned obtaining of user identity information and lottery indication parameters of multiple candidate users to be drawn may include: obtaining, through the above-mentioned lottery center node, user identity information and lottery indication parameters of candidate users to be drawn sent by multiple lottery sub-nodes respectively, and storing the user identity information and lottery indication parameters of multiple candidate users in the storage space.

[0058] Among them, one lottery sub-node may correspond to at least one candidate user, and is used to upload user identity information and lottery indication parameters of at least one candidate user.

[0059] In some embodiments, after storing the user identity information and lottery indication parameters of multiple candidate users, the above-mentioned lottery center node can also control the deadline for obtaining the user identity information and lottery indication parameters of the candidate users, that is, the registration deadline conditions for the lottery, as well as the selection of the winning users of the lottery, the lottery opening time, the synchronization of the winning users and other operations.

[0060] Among them, the above-mentioned registration deadline conditions can be limited according to the time of the lottery activity, and can also be limited according to the number of people in the lottery activity, such as the deadline determination, the maximum number of people determination, and if the determination fails, the application of this candidate user can be rejected.

[0061] For example, Figure 2 As shown, Figure 2 The lottery center node in is set in the whole server center server, and multiple lottery sub-nodes are set in the game servers respectively, such as Figure 2In game server 1, game server 2, ... game server n, different candidate users' clients are connected to the game server, and are used to upload the user data of the candidate users, such as user identity information, game level information, etc., to the game server, so as to enable the lottery sub-node in the game server to determine the lottery indication parameters of the candidate users according to the user data of the candidate users, and to upload the lottery indication parameters and user identity information of the candidate users to the lottery center node, so that the lottery center node can store the lottery indication parameters and user identity information of the candidate users in the Redis database. Among them, the above-mentioned full-server center server and game server can both use servers.

[0062] Specifically, the implementation of the node functions in the above-mentioned lottery center node and lottery sub-node may vary according to different projects. For example, it can be deployed as a microservice, or it can be a process in which a logical entity is deployed on a game server, etc. It can be set specifically according to needs and is not limited here.

[0063] For example, some projects use microservice architecture, so the whole server lottery can be split into the whole server lottery center service and the whole server lottery sub-service. Some projects do not use microservice architecture, and the business processing logic coexists in the form of objects on a process. In this deployment, it is split into the whole server lottery center object and the whole server lottery sub-service object.

[0064] Step 102: Determine the number of candidate users corresponding to each of the above lottery indication parameters.

[0065] In this embodiment, since the lottery indication parameters of different candidate users may be the same, that is, the probability of winning is the same, the number of candidate users corresponding to each lottery indication parameter can be counted, so as to execute the corresponding lottery algorithm according to the distribution of candidate users on the lottery indication parameters to select the winning user.

[0066] Specifically, if the lottery indication parameter is set to a weight number, the number of users corresponding to each weight number can be counted, wherein the number of users corresponding to each weight number can be counted by using the zcount instruction of the zset set in the Redis database. Then, the number of users corresponding to all weight numbers is obtained through statistics to form a quantity statistics hash table, that is, in the quantity statistics hash table, the key is the weight number and the value is the number of users.

[0067] Exemplarily, the zcount instruction can be used to count the number of users corresponding to each weight number to obtain a quantity statistics hash table {1:150000, 2:100000, 3:200000, 4:100000, 5:50000}, where the number of users corresponding to weight number 1 is 150000, the number of users corresponding to weight number 2 is 100000, the number of users corresponding to weight number 3 is 200000, the number of users corresponding to weight number 4 is 100000, and the number of users corresponding to weight number 5 is 50000.

[0068] Step 103: Determine target lottery indication parameters for participating in the lottery from the above lottery indication parameters.

[0069] In this embodiment, a target lottery indication parameter for participating in the lottery is determined from the individual lottery indication parameters, so that based on the target lottery indication parameter, a winning user who is within a range corresponding to the target lottery indication parameter is selected.

[0070] It is understandable that in some extreme cases, the number of candidate users corresponding to some of the multiple lottery indication parameters may be 0. Therefore, the multiple lottery indication parameters can be screened first to filter out the lottery indication parameters with the number of candidate users being 0, and then the target lottery indication parameters for participating in the lottery can be determined from the remaining lottery indication parameters.

[0071] Specifically, the target lottery indication parameters can be obtained by using a weighted random algorithm, for example, the random.choices function in Python performs weighted random processing to obtain the target lottery indication parameters.

[0072] Specifically, the above-mentioned determination of the target lottery indication parameters for participating in the lottery from the above-mentioned lottery indication parameters includes: obtaining the basic weights corresponding to the configurations of each of the above-mentioned lottery indication parameters, and then determining the target lottery indication parameters for participating in the lottery based on the basic weights of each of the above-mentioned lottery indication parameters.

[0073] Specifically, the basic weight can also be updated based on the number of users to update the target weight of each lottery indication parameter, and the target weight is used to indicate the selection probability corresponding to each lottery indication parameter, that is, the above-mentioned determination of the target lottery indication parameters participating in the lottery from the above-mentioned lottery indication parameters can include: the basic weight corresponding to the configuration of each of the above-mentioned lottery indication parameters can be obtained, and then, based on the above-mentioned number of users and the above-mentioned basic weight of each of the above-mentioned lottery indication parameters, the target weight corresponding to each of the above-mentioned lottery indication parameters can be determined, and finally, based on the above-mentioned target weight corresponding to each of the above-mentioned lottery indication parameters, the target lottery indication parameters participating in the lottery can be determined.

[0074] It can be understood that since each of the above-mentioned lottery indication parameters is configured with the attribute range to which the candidate user belongs, and the attribute range is used to indicate the user's ability performance in the game, the corresponding basic weight can be determined according to the attribute range, that is, the higher the user's ability performance, the greater the basic weight, so that the higher the attribute value indicated by the above-mentioned attribute range, the greater the basic weight corresponding to the lottery indication parameter configured with the above-mentioned attribute range.

[0075] In some embodiments, if there are multiple lottery cycles for a lottery activity, then the above-mentioned determination of the target lottery indication parameters for participating in the lottery from the above-mentioned lottery indication parameters may include: conducting a lottery for the current round based on the target weight, determining the target lottery indication parameters for participating in the lottery from the above-mentioned lottery indication parameters, and then, after subsequently determining the winning user from the candidate users corresponding to the target lottery indication parameters, it may also include: judging the cumulative number of winning users, or the round of the lottery activity, if the cumulative number of winning users does not reach the preset winning number, or the round of the lottery activity does not reach the preset number threshold, returning to the above-mentioned step of determining the target lottery indication parameters for participating in the lottery from the above-mentioned lottery indication parameters, so as to determine the corresponding winning user again based on the newly determined target lottery indication parameters.

[0076] Step 104: based on the number of users corresponding to the target lottery indication parameter and the user identity information of each of the candidate users, determine a winning user from the candidate users corresponding to the target lottery indication parameter.

[0077] In this embodiment, after obtaining the target lottery indication parameter for participating in the lottery, the determination range of the winning users can be determined, that is, the candidate user range corresponding to the target lottery indication parameter. Then, based on the number of users corresponding to the target lottery indication parameter and the user identity information of the corresponding candidate users, the winning users can be determined from the candidate user range corresponding to the target lottery indication parameter, so as to avoid the server lag problem caused by traversing all user data for the lottery when the amount of lottery user data in the entire server is large.

[0078] In some embodiments, applied to a lottery center node, the lottery center node is connected to multiple lottery sub-nodes, and the above-mentioned determination of the number of candidate users corresponding to each of the above-mentioned lottery indication parameters may include: the number of candidate users corresponding to each of the above-mentioned lottery indication parameters can be determined separately through the above-mentioned lottery center node.

[0079] The determining of the target lottery indication parameters for participating in the lottery from the lottery indication parameters may include: determining the target lottery indication parameters for participating in the lottery from the lottery indication parameters through the lottery center node.

[0080] The determining of the winning user from the candidate users corresponding to the target lottery indication parameter based on the number of users corresponding to the target lottery indication parameter and the user identity information of each candidate user includes:

[0081] Through the lottery center node, based on the number of users corresponding to the target lottery indication parameter and the user identity information of each of the candidate users, a winning user is determined from the candidate users corresponding to the target lottery indication parameter.

[0082] In some embodiments, since the lottery indication parameter is configured with a parameter order, the user identity information of the multiple candidate users are arranged in order in the storage space according to the parameter order of the lottery indication parameter, and the user identity information corresponding to the same lottery indication parameter is arranged adjacent to each other. Therefore, the above-mentioned determination of the winning user from the candidate users corresponding to the target lottery indication parameter based on the number of users corresponding to the target lottery indication parameter and the user identity information of each of the candidate users may include: determining the total number of users of the lottery indication parameter before the target lottery indication parameter, and then determining the ranking range of the candidate user corresponding to the target lottery indication parameter among all candidate users based on the total number of users and the number of users corresponding to the target lottery indication parameter, and finally, selecting the target ranking from the ranking range, and obtaining the target user identity information at the corresponding position from the storage space based on the target ranking, to determine the winning user corresponding to the target user identity information.

[0083] Exemplarily, if based on the above parameter configuration table and the quantity statistics hash table weight_no_2_count={1:150000,2:100000,3:200000,4:100000,5:50000}, the data stored in the zset ordered set is sorted by the lottery indication parameter by default. Assuming that the target lottery indication parameter is weight number 4, the lottery indication parameters before weight number 4 are weight number 1, weight number 2 and weight number 3, and the total number of users corresponding to weight number 1, weight number 2 and weight number 3 is 150000+100000+200000=450000, and, since the number of users corresponding to weight number 4 is 100000, the ranking range of candidate users corresponding to weight number 4 is [450000,550000].

[0084] It can be understood that if the target lottery indication parameter is set to target_no, if target_no is greater than 1, the total number of users count from the starting lottery indication parameter 1 to target_no-1 is calculated, and the ranking range of the candidate user corresponding to target_no among all candidate users is [count, count+weight_no_2_count[target_no]]; and if target_no is equal to 1, the ranking range of the weighted player corresponding to target_no in zset is [0, weight_no_2_count[target_no]], where weight_no_2_count[target_no] is used to indicate the number of users corresponding to target_no.

[0085] Furthermore, since the calculated ranking range is [450000, 550000], a user with rank=450008 can be randomly selected from the ranking range, and this user is the winning user. Specifically, a rank can be randomly selected within the ranking range [a, b]. For example, Python's random.randint(a, b) can be used to obtain the rank of a winning player and add it to rank_list. Finally, the lottery rounds can be repeated to draw the corresponding number of winning users, and the ranking of the winning users can be obtained, which is recorded as rank_list.

[0086] In some embodiments, the storage space includes a zset ordered set in a Redis database, wherein the user identity information of the candidate user in the zset ordered set is a member value, and the lottery indication parameter is a score value.

[0087] In some embodiments, the above-mentioned obtaining the target user identity information of the corresponding position from the above-mentioned storage space based on the above-mentioned target ranking, and determining the winning user corresponding to the above-mentioned target user identity information may include: obtaining the activity time identifier of the current lottery activity; then, based on the above-mentioned activity time identifier and the above-mentioned target ranking, generating a query instruction corresponding to the above-mentioned target ranking, and sending the above-mentioned query instruction to the Redis database, so as to query the zset ordered set corresponding to the above-mentioned current lottery activity in the above-mentioned Redis database based on the above-mentioned query instruction, and determine the target user identity information of the corresponding position of the above-mentioned target ranking from the zset ordered set corresponding to the above-mentioned current lottery activity, and determine the winning user corresponding to the above-mentioned target user identity information.

[0088] For example, if rank_list can be set to [450008, 300002, 10009], that is, 450008, 300002, and 10009 correspond to the target ranking of a winning user respectively, for the target ranking of each winning user, a query instruction is generated, such as zrange(key, rank, rank), where key is the activity time identifier and rank is the target ranking. Then, based on the query instruction, the user identity information of the three winning users is obtained in the Redis database to obtain the final user identity information set of all winning users.

[0089] In some embodiments, the above method may also include: obtaining the number of random draws, and then, based on the above draw indication parameters, randomly selecting target user identity information that meets the above random draw number from multiple candidate users, and determining the winning user corresponding to the above target user identity information.

[0090] In this embodiment, in the process of randomly drawing the winning user, there is no need to obtain the user data of all candidate users into the memory. The random drawing can be completed through the native instructions in the Redis database to reduce the computing pressure of the game server itself, thereby avoiding the lag of the game service.

[0091] Specifically, you can use the zset random command zrandmember in the Redis database to obtain the user list of winners. This command only needs to pass in the key value corresponding to the candidate user and the number of winners to obtain the user identity information set of all the final winners.

[0092] Among them, zrandmember is a command in Redis, which is used to randomly obtain one or more elements from an ordered set.

[0093] It should be noted that the above random algorithm can be executed asynchronously. For steps consisting of multiple instructions, multiple instructions are packaged and executed through the Pipeline in the Redis database. Among them, for the uniform random algorithm, the execution efficiency is O(M), where M is the number of winning users; for the weighted random algorithm, the execution efficiency of counting different lottery indication parameters is O(log(N)), where N is the number of all candidate users, and the efficiency of obtaining the user identity information of the winning user by using the ranking of the winning user is O(Mlog(N)), where N is the number of all players and M is the number of winning players.

[0094] In some embodiments, the user identity information of all the winning users is stored in a list in the Redis database. Since the number is small, it is also cached in the memory of the central node to speed up the subsequent upload of candidate users in different lottery cycles of the same lottery activity, excluding these candidate users who have already won the lottery, and avoiding users who have already won the lottery in the same lottery activity from winning again.

[0095] In some embodiments, when the lottery draw time is up, the central node or other processors in the terminal can execute the corresponding lottery draw task based on the expiration of the pre-set timer. The Redis ordered set instruction can be used to randomly obtain the user list, and it is not necessary to load all the candidate user data into the memory. In addition, after the lottery draw, the winning user can be written into the Redis database for subsequent child nodes to pull the lottery draw information.

[0096] In addition, if a broadcast notification is needed after winning a prize, the central node will notify the prize draw result; and / or, after the prize draw time is up, the sub-node will pull the prize draw information from the central node and display it to the client. Among them, the above-mentioned broadcast notification can be a full-server notification sent by the central node through email or other forms. When the client opens the game interface, the lottery sub-node pulls the prize draw result from the central node and displays it to the client. The sub-node is responsible for pulling the prize draw information from the central node after the prize draw and displaying it to the client.

[0097] From the above content, it can be seen that by obtaining the user identity information and lottery indication parameters of multiple candidate users to be drawn, the number of candidate users corresponding to each of the above lottery indication parameters is determined, and then the target lottery indication parameters participating in the lottery are determined from the above lottery indication parameters. Finally, based on the number of users corresponding to the above target lottery indication parameters and the above user identity information of each of the above candidate users, the winning user is determined from the candidate users corresponding to the above target lottery indication parameters. Therefore, it is only necessary to determine the target lottery indication parameters participating in the lottery from multiple lottery indication parameters to select the winning user from the candidate users corresponding to the target lottery parameters, thereby avoiding the process of reading the lottery-related data of all candidate users for the lottery, and greatly reducing the performance pressure when conducting a lottery activity for the entire game server.

[0098] This embodiment also provides a lottery device, which can be integrated into a terminal device. Figure 3 As shown, the lottery device may include:

[0099] The parameter acquisition module 301 is used to obtain the user identity information and lottery indication parameters of multiple candidate users to be drawn;

[0100] A quantity determination module 302 is used to determine the number of candidate users corresponding to each of the above lottery indication parameters;

[0101] A parameter determination module 303, used to determine a target lottery indication parameter for participating in the lottery from the above lottery indication parameters;

[0102] The user determination module 304 is used to determine a winning user from the candidate users corresponding to the target lottery indication parameter based on the number of users corresponding to the target lottery indication parameter and the user identity information of each of the candidate users.

[0103] In some embodiments, the parameter determination module 303 is specifically used to:

[0104] Obtain the basic weights of the configurations corresponding to the above lottery indication parameters;

[0105] Determine the target weight corresponding to each of the lottery indication parameters based on the number of users and the basic weight of each of the lottery indication parameters;

[0106] Based on the above target weights corresponding to the above lottery indication parameters, target lottery indication parameters for participating in the lottery are determined.

[0107] In some embodiments, each of the above lottery indication parameters is configured with an attribute range to which the candidate user belongs, and the higher the attribute value indicated by the above attribute range, the greater the basic weight corresponding to the lottery indication parameter configured with the above attribute range.

[0108] In some embodiments, the lottery indication parameter is configured with a parameter order, and the user identity information of the plurality of candidate users is arranged in order in the storage space according to the parameter order of the lottery indication parameter, and the user identity information corresponding to the same lottery indication parameter is arranged adjacently;

[0109] The user determination module 304 is specifically used for:

[0110] Determine the total number of users of the lottery indication parameters that precede the target lottery indication parameter;

[0111] Determine a ranking range of candidate users corresponding to the target lottery indication parameter based on the total number of users and the number of users corresponding to the target lottery indication parameter;

[0112] A target ranking is selected from the ranking range, and based on the target ranking, target user identity information at a corresponding position is obtained from the storage space to determine a winning user corresponding to the target user identity information.

[0113] In some embodiments, the storage space includes a zset ordered set in a Redis database, wherein the user identity information of the candidate user in the zset ordered set is a member value, and the lottery indication parameter is a score value.

[0114] In some embodiments, the user determination module 304 is specifically used to:

[0115] Get the activity time identifier of the current lottery activity;

[0116] Based on the activity time identifier and the target ranking, a query instruction corresponding to the target ranking is generated;

[0117] The query instruction is sent to the Redis database, so as to query the zset ordered set corresponding to the current lottery activity in the Redis database based on the query instruction, and determine the target user identity information of the corresponding position of the target ranking from the zset ordered set corresponding to the current lottery activity, and determine the winning user corresponding to the target user identity information.

[0118] In some embodiments, the above method and the above lottery device further include a random lottery module, and the above random lottery module is specifically used to:

[0119] Get the number of random draws;

[0120] Based on the lottery indication parameters, target user identity information that meets the random lottery quantity is randomly selected from the plurality of candidate users, and a winning user corresponding to the target user identity information is determined.

[0121] In some embodiments, the parameter acquisition module 301 is applied to a lottery center node, and the lottery center node is connected to multiple lottery sub-nodes. The parameter acquisition module 301 is specifically used for:

[0122] Through the lottery center node, the user identity information and lottery indication parameters of the candidate users to be drawn are respectively obtained from the plurality of lottery sub-nodes;

[0123] The user determination module 304 is specifically used for:

[0124] Through the lottery center node, based on the number of users corresponding to the target lottery indication parameter and the user identity information of each of the candidate users, a winning user is determined from the candidate users corresponding to the target lottery indication parameter.

[0125] From the above content, it can be seen that by obtaining the user identity information and lottery indication parameters of multiple candidate users to be drawn, the number of candidate users corresponding to each of the above lottery indication parameters is determined, and then the target lottery indication parameters participating in the lottery are determined from the above lottery indication parameters. Finally, based on the number of users corresponding to the above target lottery indication parameters and the above user identity information of each of the above candidate users, the winning user is determined from the candidate users corresponding to the above target lottery indication parameters. Therefore, it is only necessary to determine the target lottery indication parameters participating in the lottery from multiple lottery indication parameters to select the winning user from the candidate users corresponding to the target lottery parameters, thereby avoiding the process of reading the lottery-related data of all candidate users for the lottery, and greatly reducing the performance pressure when conducting a lottery activity for the entire game server.

[0126] Accordingly, an embodiment of the present application further provides an electronic device, which may be a terminal, and the terminal may be a smart phone, a tablet computer, a laptop computer, a touch screen, a game console, a personal computer (PC, Personal Computer), a personal digital assistant (Personal Digital Assistant, PDA) and other terminal devices. Alternatively, the electronic device may be a server.

[0127] like Figure 4 As shown, Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device 400 includes a processor 401 having one or more processing cores, a memory 402 having one or more computer-readable storage media, and a computer program stored in the memory 402 and executable on the processor. The processor 401 is electrically connected to the memory 402. Those skilled in the art will appreciate that the electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown, or combine certain components, or arrange components differently.

[0128] The processor 401 is the control center of the electronic device 400, and uses various interfaces and lines to connect various parts of the entire electronic device 400. By running or loading software programs and / or units stored in the memory 402, and calling data stored in the memory 402, the processor 401 executes various functions of the electronic device 400 and processes data, thereby monitoring the electronic device 400 as a whole. The processor 401 can be a central processing unit CPU, a graphics processing unit GPU, a network processor (Network Processor, NP), etc., and can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application.

[0129] In the embodiment of the present application, the processor 401 in the electronic device 400 will load instructions corresponding to the processes of one or more application programs into the memory 402 according to the following steps, and the processor 401 will run the application programs stored in the memory 402 to implement various functions, such as:

[0130] Obtaining user identity information and lottery indication parameters of multiple candidate users to be drawn;

[0131] Determine the number of candidate users corresponding to each of the above lottery indication parameters;

[0132] Determining target lottery indication parameters for participating in the lottery from the above lottery indication parameters;

[0133] Based on the number of users corresponding to the target lottery indication parameter and the user identity information of each of the candidate users, a winning user is determined from the candidate users corresponding to the target lottery indication parameter.

[0134] Therefore, the electronic device 400 provided in this embodiment can bring the following technical effects: reducing the performance pressure existing when conducting a game server-wide lottery activity.

[0135] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0136] Optional, such as Figure 4 As shown, the electronic device 400 further includes: a touch screen 403, a radio frequency circuit 404, an audio circuit 405, an input unit 406, and a power supply 407. The processor 401 is electrically connected to the touch screen 403, the radio frequency circuit 404, the audio circuit 405, the input unit 406, and the power supply 407, respectively. Those skilled in the art can understand that Figure 4 The electronic device structure shown in the figure does not constitute a limitation of the electronic device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0137] The touch display screen 403 can be used to display a graphical user interface and receive operation instructions generated by the user acting on the graphical user interface. The touch display screen 403 may include a display panel and a touch panel. Among them, the display panel may be used to display information input by the user or information provided to the user and various graphical user interfaces of the electronic device, and these graphical user interfaces may be composed of graphics, text, icons, videos and any combination thereof. Optionally, the display panel may be configured in the form of a liquid crystal display (LCD, Liquid Crystal Display), an organic light-emitting diode (OLED, Organic Light-Emitting Diode) and the like. The touch panel may be used to collect the user's touch operation on or near it (such as the user using any suitable object or attachment such as a finger, a stylus, etc. on the touch panel or near the touch panel), and generate corresponding operation instructions, and the operation instructions execute corresponding programs. Optionally, the touch panel may include two parts, a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the touch point coordinates, and then sends it to the processor 401, and can receive the command sent by the processor 401 and execute it. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it is transmitted to the processor 401 to determine the type of touch event, and then the processor 401 provides a corresponding visual output on the display panel according to the type of touch event. In an embodiment of the present application, the touch panel and the display panel can be integrated into the touch display screen 403 to realize the input and output functions. However, in some embodiments, the touch panel and the touch panel can be used as two independent components to realize the input and output functions. That is, the touch display screen 403 can also be used as a part of the input unit 406 to realize the input function.

[0138] The radio frequency circuit 404 may be used to send and receive radio frequency signals, so as to establish wireless communication with a network device or other electronic devices through wireless communication, and to send and receive signals with the network device or other electronic devices.

[0139] The audio circuit 405 can be used to provide an audio interface between the user and the electronic device through a speaker and a microphone. The audio circuit 405 can transmit the electrical signal converted from the received audio data to the speaker, which is converted into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 405 and converted into audio data, and then the audio data is output to the processor 401 for processing, and then sent to another electronic device through the radio frequency circuit 404, or the audio data is output to the memory 402 for further processing. The audio circuit 405 may also include an earplug jack to provide communication between an external headset and an electronic device.

[0140] The input unit 406 may be used to receive input numbers, character information or user feature information (such as fingerprint, iris, facial information, etc.), and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.

[0141] The power supply 407 is used to supply power to various components of the electronic device 400. Optionally, the power supply 407 can be logically connected to the processor 401 through a power management system, so that the power management system can manage charging, discharging, and power consumption. The power supply 407 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0142] although Figure 4 Not shown, the electronic device 400 may also include a camera, a sensor, a wireless fidelity module, a Bluetooth module, etc., which will not be described in detail here.

[0143] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0144] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0145] To this end, an embodiment of the present application provides a computer-readable storage medium, in which a plurality of computer programs are stored, and the computer program can be loaded by a processor to execute any one of the lottery methods provided in the embodiments of the present application. The computer program can execute the following steps of the lottery method:

[0146] Obtaining user identity information and lottery indication parameters of multiple candidate users to be drawn;

[0147] Determine the number of candidate users corresponding to each of the above lottery indication parameters;

[0148] Determining target lottery indication parameters for participating in the lottery from the above lottery indication parameters;

[0149] Based on the number of users corresponding to the target lottery indication parameter and the user identity information of each of the candidate users, a winning user is determined from the candidate users corresponding to the target lottery indication parameter.

[0150] It can be seen that the computer program can be loaded by the processor to execute any one of the lottery methods provided in the embodiments of the present application, thereby bringing the following technical effects: reducing the performance pressure existing when conducting a lottery activity for the entire game server.

[0151] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0152] The computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0153] Since the computer program stored in the computer-readable storage medium can execute any one of the lottery methods provided in the embodiments of the present application, the beneficial effects that can be achieved by any one of the lottery methods provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0154] According to one aspect of the present application, a computer program product or a computer program is also provided, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device executes the methods provided in various optional implementations of the above embodiments.

[0155] In the above-mentioned lottery device, computer-readable storage medium, electronic device, and computer program product embodiments, the description of each embodiment has its own emphasis. For parts not described in detail in a certain embodiment, reference can be made to the relevant description of other embodiments. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process and beneficial effects of the lottery device, computer-readable storage medium, computer program product, electronic device and its corresponding units described above can refer to the description of the lottery method in the above embodiment, and will not be repeated here.

[0156] The above is a detailed introduction to a lottery method, device, electronic device, computer-readable storage medium and computer program product provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the ideas of the present application, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A lottery method, characterized in that: The method comprises: Obtaining user identity information and lottery indication parameters of multiple candidate users to be drawn; Determine the number of candidate users corresponding to each of the lottery indication parameters; Determining target lottery indication parameters for participating in the lottery from the lottery indication parameters; Based on the number of users corresponding to the target lottery indication parameter and the user identity information of each of the candidate users, a winning user is determined from the candidate users corresponding to the target lottery indication parameter.

2. The lottery method according to claim 1, characterized in that: The step of determining target lottery indication parameters for participating in a lottery from the lottery indication parameters includes: Obtaining the basic weights of the configurations corresponding to the lottery indication parameters; Determining a target weight corresponding to each of the lottery indication parameters based on the number of users and the basic weight of each of the lottery indication parameters; Based on the target weight corresponding to each of the lottery indication parameters, a target lottery indication parameter for participating in the lottery is determined.

3. The lottery method according to claim 2, characterized in that: Each of the lottery indication parameters is configured with an attribute range to which the candidate user belongs. The higher the attribute value indicated by the attribute range, the greater the basic weight corresponding to the lottery indication parameter configured with the attribute range.

4. The lottery method according to claim 1, characterized in that: The lottery indication parameter is configured with a parameter order, the user identity information of the plurality of candidate users is arranged in order in the storage space according to the parameter order of the lottery indication parameter, and the user identity information corresponding to the same lottery indication parameter is arranged adjacently; The determining a winning user from the candidate users corresponding to the target lottery indication parameter based on the number of users corresponding to the target lottery indication parameter and the user identity information of each candidate user includes: Determine the total number of users of lottery indication parameters that are located before the target lottery indication parameter; Determine a ranking range of candidate users corresponding to the target lottery indication parameter based on the total number of users and the number of users corresponding to the target lottery indication parameter; A target ranking is selected from the ranking range, and based on the target ranking, target user identity information at a corresponding position is obtained from the storage space to determine a winning user corresponding to the target user identity information.

5. The lottery method according to claim 4, characterized in that: The storage space includes a zset ordered set in a Redis database, wherein the user identity information of the candidate user in the zset ordered set is a member value, and the lottery indication parameter is a score value.

6. The lottery method according to claim 5, characterized in that: The step of acquiring target user identity information at a corresponding position from the storage space based on the target ranking and determining a winning user corresponding to the target user identity information includes: Get the activity time identifier of the current lottery activity; Based on the activity time identifier and the target ranking, generating a query instruction corresponding to the target ranking; The query instruction is sent to a Redis database, so as to query the zset ordered set corresponding to the current lottery activity in the Redis database based on the query instruction, and determine the target user identity information of the corresponding position of the target ranking from the zset ordered set corresponding to the current lottery activity, and determine the winning user corresponding to the target user identity information.

7. The lottery method according to claim 1, characterized in that: The method further comprises: Get the number of random draws; Based on the lottery indication parameter, target user identity information that meets the random lottery quantity is randomly selected from the plurality of candidate users, and a winning user corresponding to the target user identity information is determined.

8. The lottery method according to any one of claims 1 to 7, characterized in that: Applied to a lottery center node, the lottery center node is connected to a plurality of lottery sub-nodes, and the obtaining of user identity information and lottery indication parameters of a plurality of candidate users to be drawn includes: obtaining, through the lottery center node, user identity information and lottery indication parameters of the candidate users to be drawn sent by the plurality of lottery sub-nodes respectively; The determining a winning user from the candidate users corresponding to the target lottery indication parameter based on the number of users corresponding to the target lottery indication parameter and the user identity information of each candidate user includes: The lottery center node determines a winning user from the candidate users corresponding to the target lottery indication parameter based on the number of users corresponding to the target lottery indication parameter and the user identity information of each candidate user.

9. A lottery device, characterized in that: The device comprises: A parameter acquisition module, used to obtain user identity information and lottery indication parameters of multiple candidate users to be drawn; A quantity determination module, used to determine the number of candidate users corresponding to each of the lottery indication parameters; A parameter determination module, used to determine a target lottery indication parameter for participating in the lottery from the lottery indication parameter; The user determination module is used to determine a winning user from the candidate users corresponding to the target lottery indication parameter based on the number of users corresponding to the target lottery indication parameter and the user identity information of each candidate user.

10. An electronic device, characterized in that: The system comprises a processor and a memory, wherein the memory stores a plurality of instructions; the processor loads instructions from the memory to execute the steps of the lottery method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the steps of the lottery method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • A game lottery drawing method and device of a distributed server structure

    CN109598551A

  • Lottery drawing method and device

    CN114267113A

  • Method and system for carrying out lottery drawing by using distributed queue

    CN115204951A

  • Lottery drawing management method and device, computer equipment and storage medium

    CN115271817A

  • Method and system for improving throughput rate of lottery drawing function

    CN119205207A