A method, device, computer equipment and storage medium for extracting virtual resources
By using normal distribution filtering and randomly drawing virtual resources in the game, the problem of excessive resource consumption caused by weighted random sampling in high-frequency rewards is solved, and the extraction efficiency and player experience are improved.
Patent Information
- Application Number
- CN202310283529.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-20
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2043-03-20
AI Technical Summary
In games that frequently pay rewards, weighted random sampling is required, which leads to excessive consumption of game processing resources, resulting in stuttering in game process and affecting player game experience.
By obtaining the number of draws to be drawn by the game player in the target game and the draw weights of each draw to be drawn, the first virtual resource is selected based on the normal distribution draw times, and randomly drawn to determine the actual draw times, and then the other virtual resources are drawn based on the remaining draw times.
It improves the efficiency of virtual resources extraction, reduces the consumption of game processing resources, avoids lag in game processes, and improves player game experience.
Smart Images

Figure CN116370968B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device, computer equipment and storage medium for extracting virtual resources. Background Art
[0002] With the development of computer technology, online games are becoming more and more popular among users. In order to reward players, most games are equipped with a reward table, which generally includes virtual resource names, item quantities, and random weights.
[0003] In the related art, when issuing game rewards to players, a weighted random sampling is performed according to the items in the reward table and their corresponding weights. However, in some games that issue rewards frequently, for example, some idle games will issue rewards in the reward table to players once a minute, so it is necessary to perform multiple weighted random sampling calculations in a short period of time, which consumes more game processing resources, causing the game process to run lagging, thereby affecting the player's gaming experience. Summary of the invention
[0004] The embodiments of the present application provide a method, apparatus, computer device and storage medium for extracting virtual resources, which can improve the efficiency of extracting virtual resources.
[0005] The present application embodiment provides a method for extracting virtual resources, including:
[0006] Get the number of pending draws obtained by the game player in the target game;
[0007] Obtaining extraction weights corresponding to each virtual resource to be extracted in the target game;
[0008] Based on each extraction weight and the number of draws to be drawn, determining at least one first virtual resource from the virtual resources to be drawn, wherein the number of draws of the first virtual resource under the number of draws to be drawn and the corresponding extraction weights follows a normal distribution;
[0009] Randomly draw the first virtual resources according to the drawing weights corresponding to the first virtual resources and the number of draws to be drawn, and determine a first actual number of draws for each of the first virtual resources;
[0010] According to the drawing weights corresponding to the other virtual resources in the to-be-drawn virtual resources except the first virtual resource, and the remaining number of draws, the other virtual resources are drawn to determine the second virtual resource drawn and the second actual number of draws of the second virtual resource, wherein the remaining number of draws is the number of draws in the to-be-drawn number except the sum of the first actual number of draws.
[0011] Accordingly, the embodiment of the present application further provides a virtual resource extraction device, including:
[0012] A first acquisition unit is used to acquire the number of pending draws obtained by the game player in the target game;
[0013] A second acquisition unit is used to acquire an extraction weight corresponding to each virtual resource to be extracted in the target game;
[0014] A first determining unit, configured to determine at least one first virtual resource from the virtual resources to be drawn based on each drawing weight and the number of draws to be drawn, wherein the number of draws of the first virtual resource under the number of draws to be drawn and the corresponding drawing weights follows a normal distribution;
[0015] A first extraction unit, configured to randomly extract the first virtual resources according to the extraction weights corresponding to the first virtual resources and the number of draws to be drawn, and determine a first actual number of draws for each of the first virtual resources;
[0016] The second drawing unit is used to draw the other virtual resources according to the drawing weights corresponding to the other virtual resources in the to-be-drawn virtual resources except the first virtual resource and the remaining number of draws, to determine the drawn second virtual resource and the second actual number of draws of the second virtual resource, wherein the remaining number of draws is the number of draws in the to-be-drawn number except the sum of the first actual number of draws.
[0017] In some embodiments, the first determining unit includes:
[0018] A sorting subunit is used to sort the extraction weights of the virtual resources to be extracted from large to small to obtain an extraction weight sequence;
[0019] The first determination subunit is used to sequentially select virtual resources to be drawn whose winning times under the number of draws to be drawn and the corresponding drawing weights obey a normal distribution based on the drawing weight sequence as the first virtual resources.
[0020] In some embodiments, the first determining subunit is specifically configured to:
[0021] Determining a maximum extraction weight from the extraction weight sequence;
[0022] Calculate, based on the maximum extraction weight and the number of draws to be drawn, a first number of draws corresponding to the maximum extraction weight and a second number of draws corresponding to the remaining extraction weights in the extraction weight sequence except the maximum extraction weight;
[0023] If the first number of draws and the second number of draws satisfy the normal distribution condition, the to-be-drawn virtual resource corresponding to the maximum draw weight is used as the first virtual resource.
[0024] In some embodiments, the first determining subunit is specifically configured to:
[0025] Calculating the ratio of the maximum extraction weight to the sum of the extraction weights in the extraction weight sequence to obtain a first weight ratio corresponding to the maximum extraction weight;
[0026] Calculate the product of the first weight proportion and the number of draws to be drawn to obtain the first number of draws corresponding to the maximum extraction weight;
[0027] Calculating the ratio of the sum of the remaining extraction weights to the sum of the extraction weights in the extraction weight sequence to obtain a second weight proportion corresponding to the remaining extraction weights;
[0028] The product of the second weight proportion and the number of draws to be drawn is calculated to obtain the second number of draws corresponding to the remaining drawing weight.
[0029] In some embodiments, the first determining subunit is specifically configured to:
[0030] The first number of draws and the second number of draws are both greater than a preset number of draws.
[0031] In some embodiments, the first determining subunit is further configured to:
[0032] Removing the maximum extraction weight from the extraction weight sequence to obtain a new extraction weight sequence;
[0033] Determine a new maximum extraction weight from the new extraction weight sequence;
[0034] Based on the new maximum extraction weight and the remaining number of draws to be drawn in the number of draws to be drawn except the actual number of draws of the virtual resource to be drawn corresponding to the maximum extraction weight, calculate a new first number of draws corresponding to the new maximum extraction weight and a new second number of draws corresponding to the new remaining extraction weights except the new maximum extraction weight in the new extraction weight sequence;
[0035] If the new first number of draws and the new second number of draws meet the conditions of normal distribution, the virtual resource to be drawn corresponding to the new maximum extraction weight will be used as the first virtual resource until the extraction weight sequence is empty or the virtual resource to be drawn corresponding to the extraction weight in the extraction weight sequence does not meet the conditions of normal distribution.
[0036] In some embodiments, the first determining subunit is further configured to:
[0037] Calculate the ratio of the new maximum extraction weight to the sum of the extraction weights in the new extraction weight sequence to obtain the third weight proportion corresponding to the new maximum extraction weight;
[0038] Calculate the product of the third weight ratio and the remaining number of draws to be drawn, and obtain a new maximum drawing weight corresponding to a new first number of draws;
[0039] Calculate the ratio of the sum of the new remaining extraction weights to the sum of the extraction weights in the new extraction weight sequence to obtain the fourth weight ratio corresponding to the new remaining extraction weights;
[0040] The product of the fourth weight proportion and the remaining number of draws to be drawn is calculated to obtain a new second number of draws corresponding to a new remaining drawing weight.
[0041] In some embodiments, the first acquisition unit may include:
[0042] A second determining subunit is used to determine the offline time of the game player in the target game;
[0043] The third determining subunit is used to calculate the number of draws obtained by the game player in the offline time period based on the offline time period to obtain the number of draws to be drawn.
[0044] In some embodiments, the apparatus further comprises:
[0045] The issuing unit is used to issue a first virtual resource to the game account of the game player based on the first actual number of draws, and to issue a second virtual resource to the game account based on the second actual number of draws.
[0046] Correspondingly, an embodiment of the present application also provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes any method for extracting virtual resources provided in any embodiment of the present application.
[0047] Correspondingly, an embodiment of the present application further provides a storage medium, which stores a plurality of instructions, and the instructions are suitable for loading by a processor to execute the above virtual resource extraction method.
[0048] The embodiment of the present application obtains the number of draws to be obtained by the game player in the target game, and the corresponding drawing weights of each virtual resource to be drawn; based on each drawing weight and the number of draws to be drawn, at least one first virtual resource is determined from the virtual resources to be drawn; according to the drawing weight corresponding to the first virtual resource and the number of draws to be drawn, the first virtual resource is randomly drawn to determine the first actual number of draws of each first virtual resource; and according to the drawing weights corresponding to other virtual resources in the virtual resources to be drawn except the first virtual resource, and the remaining number of draws, other virtual resources are drawn to determine the second virtual resource to be drawn and the second actual number of draws of the second virtual resource. In this way, the extraction efficiency of virtual resources can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] 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.
[0050] Figure 1 A flowchart of a method for extracting virtual resources provided in an embodiment of the present application.
[0051] Figure 2 A flowchart of another method for extracting virtual resources provided in an embodiment of the present application.
[0052] Figure 3 A schematic diagram of an application scenario of another method for extracting virtual resources provided in an embodiment of the present application.
[0053] Figure 4 A structural block diagram of a virtual resource extraction device provided in an embodiment of the present application.
[0054] Figure 5 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0055] 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, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0056] The embodiments of the present application provide a method, device, storage medium and computer equipment for extracting virtual resources. Specifically, the method for extracting virtual resources of the embodiments of the present application can be executed by a computer device, wherein the computer device can be a terminal or a server. The terminal can be a terminal device such as a smart phone, a tablet computer, a laptop computer, a touch screen, a personal computer (PC, Personal Computer), a personal digital assistant (Personal Digital Assistant, PDA), etc. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.
[0057] For example, the computer device may be a server, which may obtain the number of pending draws obtained by a game player in a target game; obtain the drawing weights corresponding to each virtual resource to be drawn in the target game; determine at least one first virtual resource from the virtual resources to be drawn based on each drawing weight and the number of pending draws, wherein the number of draws of the first virtual resource under the number of pending draws and the corresponding drawing weight obeys a normal distribution; randomly draw the first virtual resources according to the drawing weights corresponding to the first virtual resources and the number of pending draws, and determine the first actual number of draws of each first virtual resource; draw the other virtual resources according to the drawing weights corresponding to the other virtual resources except the first virtual resource in the virtual resources to be drawn, and the remaining number of draws, and determine the second virtual resource to be drawn and the second actual number of draws of the second virtual resource, wherein the remaining number of draws is the number of draws in the number of pending draws except the sum of the first actual number of draws.
[0058] Based on the above problems, the embodiments of the present application provide a first method, apparatus, computer device and storage medium for extracting virtual resources, which can improve the efficiency of extracting virtual resources.
[0059] It should be noted that the description order of the following embodiments is not intended to limit the preferred order of the embodiments.
[0060] An embodiment of the present application provides a method for extracting virtual resources. The method can be executed by a terminal or a server. The embodiment of the present application takes the method for extracting virtual resources executed by a server as an example for explanation.
[0061] See also Figure 1 , Figure 1 A schematic diagram of a flow chart of a method for extracting virtual resources provided in an embodiment of the present application. The specific flow of the method for extracting virtual resources may be as follows:
[0062] 101. Obtain the number of pending draws obtained by the game player in the target game.
[0063] In the embodiment of the present application, the target game may be an on-hook game, which refers to a type of game in which a game player can obtain in-game revenue by hanging up in the target game. Hanging up means that the game player is offline.
[0064] Specifically, in the target game, the idle reward can be distributed to the player through a lottery. The longer the idle time of the game player, the more idle rewards he will get, that is, the more lottery draws he will get. For example, in the target game, for the game player who is in the idle state, the idle reward can be distributed to the game player once every minute.
[0065] In some embodiments, the step of “obtaining the number of pending draws obtained by the game player in the target game” may include the following operations:
[0066] Determine the amount of time gamers spend offline in the target game;
[0067] The number of draws obtained by the game player during the offline time period is calculated based on the offline time length to obtain the number of draws to be drawn.
[0068] The offline time refers to the time between the last time the player logged into the game and the time the player logged into the game this time.
[0069] Among them, the number of pending draws refers to the number of draws obtained by the game player during the offline time.
[0070] For example, the last time a game player logged into the target game was 15:28:30 on December 28, 2022, and the offline time was 18:28:30 on December 28, 2022. The time of this login to the target game can be 15:28:30 on December 29, 2022. It can be determined that the game player's offline time period is from 18:28:30 on December 28, 2022 to 15:28:30 on December 29, 2022, and the offline duration is 21 hours.
[0071] Specifically, the number of draws obtained by the game player during the offline time period is calculated based on the offline time to obtain the number of draws to be drawn, and the number of draws obtained by the game player during the offline time period can be calculated according to the idle reward strategy set in the target game.
[0072] Among them, the idle reward strategy includes the frequency of issuing lottery draws. For example, the idle reward strategy can be to get one lottery draw for every idle minute, or one lottery draw for every idle hour, etc. Different settings can be made according to different game situations.
[0073] For example, the idle reward strategy of the target game may be: one lottery draw for every idle minute, and the idle time of the game player may be: 21 hours. Then the number of lottery draws the game player obtains during the offline time may be calculated as: 21*60=1260, and the number of pending lottery draws obtained may be determined to be: 1260 times.
[0074] 102. Obtain the extraction weight corresponding to each virtual resource to be extracted in the target game.
[0075] The virtual resources to be drawn, i.e., game rewards, refer to virtual resources drawn in the target game according to the number of draws. Specifically, a reward table is set in the target game, and the reward table includes virtual resources that can be used for draws. The virtual resources to be drawn may include multiple types, for example, the virtual resources to be drawn may include: game items, game equipment, game coins, etc.
[0076] In the embodiment of the present application, an extraction weight is set for each virtual resource to be extracted. The larger the extraction weight, the greater the probability of being selected.
[0077] For example, the virtual resources to be extracted may include: virtual resource A, virtual resource B, virtual resource C, etc. Among them, the extraction weight corresponding to virtual resource A may be: 50, the extraction weight corresponding to virtual resource B may be: 30, and the extraction weight corresponding to virtual resource C may be 20. Then, the extraction weight ratio of virtual resource A may be determined as: 50 / (50+30+20)=0.5; the extraction weight ratio of virtual resource B may be determined as: 30 / (50+30+20)=0.3; the extraction weight ratio of virtual resource C may be determined as: 20 / (50+30+20)=0.2. It can be determined that in each lottery, the probability of each virtual resource being drawn is ranked as: virtual resource A>virtual resource B>virtual resource C.
[0078] 103. Based on the extraction weights and the number of draws to be made, determine at least one first virtual resource from the virtual resources to be extracted.
[0079] In the prior art, after determining the number of draws to be made, a weighted random draw of the number of draws to be made will be performed according to the drawing weights of each virtual resource to be drawn. For example, if the number of draws to be made is n, then n weighted random draws will be performed according to all virtual resources to be drawn, thereby obtaining the draw results corresponding to each draw, and then awarding prizes to game players based on the draw results. Undoubtedly, the time overhead of the above calculation process is related to n, that is, the time complexity is O(n). For example, if the number of draws to be made is tens of thousands, then tens of thousands of weighted random draws will need to be performed, which will be time-consuming and may cause game freezes in some single-threaded game processes.
[0080] In order to solve the above problem, this solution considers the dimension of the number of virtual resources to be extracted. When we perform n weighted random sampling, the corresponding number m of virtual resources to be extracted is relatively small. Generally speaking, in the idle reward table of the target game, the number of entries m in the reward table will be in a smaller range, generally not exceeding 100. It can be considered that m<=100 is a relatively common phenomenon. Therefore, when performing n weighted random extractions, we can expect to get a final result, that is, how many times these m entries will be randomly extracted. The final space of this result is only related to m, that is, the space complexity is O(m).
[0081] The number of times the first virtual resource is drawn under the number of draws to be drawn and the corresponding drawing weight follows a normal distribution.
[0082] Specifically, the normal distribution is a probability distribution. The normal distribution is the distribution of a continuous random variable with two parameters, μ and σ^2. The first parameter μ is the mean of the random variable that follows the normal distribution, and the second parameter σ^2 is the variance of the random variable, so the normal distribution is recorded as N(μ, σ^2). The probability law of a random variable that follows the normal distribution is that the probability of taking a value close to μ is large, and the probability of taking a value farther from μ is small; the smaller σ is, the more concentrated the distribution is near μ, and the larger σ is, the more dispersed the distribution is.
[0083] In some embodiments, in order to improve the efficiency of lottery drawing, the step of "determining at least one first virtual resource from the virtual resources to be drawn based on each drawing weight and the number of draws to be drawn" may include the following process:
[0084] Sort the extraction weights of the virtual resources to be extracted from large to small to obtain an extraction weight sequence;
[0085] Based on the extraction weight sequence, virtual resources to be extracted whose winning times under the number of draws to be drawn and the corresponding extraction weights obey the normal distribution are selected in turn as the first virtual resources.
[0086] For example, the virtual resources to be extracted may include: virtual resource A, virtual resource B, virtual resource C, and virtual resource D, etc. Among them, the extraction weight of virtual resource A may be: 40, the extraction weight of virtual resource B may be: 30, the extraction weight of virtual resource C may be: 20, and the extraction weight of virtual resource C may be: 10. Then, the extraction weights are sorted from large to small according to the extraction weight, and the extraction weight sequence may be: 40, 30, 20, 10.
[0087] Furthermore, the virtual resources to be drawn whose winning times under the times to be drawn and the corresponding drawing weights follow a normal distribution can be selected from the virtual resources to be drawn in turn according to the drawing weight sequence as the first virtual resource.
[0088] In some embodiments, in order to further improve the efficiency of lottery drawing, the step of "selecting virtual resources to be drawn whose draw times under the draw times and corresponding draw weights follow a normal distribution based on the draw weight sequence, as the first virtual resource" may include the following operations:
[0089] Determine the maximum extraction weight from the extraction weight sequence;
[0090] Calculate the first number of draws corresponding to the maximum extraction weight and the number of draws to be drawn based on the maximum extraction weight and the second number of draws corresponding to the remaining extraction weights in the extraction weight sequence except the maximum extraction weight;
[0091] If the first number of draws and the second number of draws satisfy the normal distribution condition, the to-be-drawn virtual resource corresponding to the maximum draw weight is used as the first virtual resource.
[0092] Among them, the maximum extraction weight refers to the extraction weight with the largest value in the extraction weight sequence.
[0093] In some embodiments, the step of “calculating the first number of draws corresponding to the maximum draw weight and the second number of draws corresponding to the remaining draw weights in the draw weight sequence except the maximum draw weight based on the maximum draw weight and the number of draws to be drawn” may include the following operations:
[0094] Calculate the ratio of the maximum extraction weight to the sum of the extraction weights in the extraction weight sequence to obtain the first weight ratio corresponding to the maximum extraction weight;
[0095] Calculate the product of the first weight ratio and the number of draws to be drawn, and obtain the first number of draws corresponding to the maximum draw weight;
[0096] Calculate the ratio of the sum of the remaining extraction weights to the sum of the extraction weights in the extraction weight sequence to obtain the second weight ratio corresponding to the remaining extraction weights;
[0097] Calculate the product of the second weight proportion and the number of draws to be drawn to obtain the number of second draws corresponding to the remaining draw weight.
[0098] In an embodiment of the present application, the first number of draws of the virtual resource to be drawn corresponding to the maximum extraction weight is calculated by n1*p1, and the second number of draws of the virtual resource to be drawn corresponding to the remaining extraction weight is calculated by n1*(1-p1).
[0099] Among them, n1 represents the number of draws to be made, p1 represents the first weight proportion corresponding to the maximum extraction weight, and (1-p1) represents the second weight proportion corresponding to the remaining extraction weights.
[0100] For example, the number of draws to be drawn can be 1260. Then the ratio of the maximum extraction weight to the sum of the extraction weights in the extraction weight sequence can be calculated as: 40 / (40+30+20+10)=0.4, and the first weight proportion corresponding to the maximum extraction weight can be determined as: 0.4. Then the product of the first weight proportion and the number of draws to be drawn can be calculated as: 0.4*1260=504, and the first number of draws corresponding to the maximum extraction weight can be: 504.
[0101] Specifically, the ratio of the sum of the remaining extraction weights to the sum of the extraction weights in the extraction weight sequence can be calculated as: 1-0.4=0.6, and the second weight ratio corresponding to the remaining extraction weight can be determined to be: 0.6. Then the product of the second weight ratio and the number of draws to be drawn is calculated as: 0.6*1260=756, and the second number of draws corresponding to the remaining extraction weight can be: 756.
[0102] Further, it is determined whether the first number of draws and the second number of draws satisfy the condition of normal distribution.
[0103] In some embodiments, the first number of draws and the second number of draws satisfy the condition of normal distribution, which may include: the first number of draws and the second number of draws are both greater than a preset number of draws.
[0104] In the embodiment of the present application, the preset number of draws may be 10. Then the condition that the first number of draws and the second number of draws satisfy the normal distribution means that both the first number of draws and the second number of draws are greater than 10.
[0105] For example, the first number of draws corresponding to the maximum draw weight may be: 504; the second number of draws corresponding to the remaining draw weight may be: 756. By comparing the first number of draws and the second number of draws with the preset number of draws respectively, it is determined that the first number of draws and the second number of draws are both greater than the preset number of draws, which means that the first number of draws and the second number of draws meet the normal distribution condition, and the virtual resource A corresponding to the maximum draw weight can be used as the first virtual resource.
[0106] In some embodiments, in order to accurately screen out all virtual resources to be extracted that meet the normal distribution condition according to the extraction weight sequence, the following operations may also be included:
[0107] Remove the maximum extraction weight from the extraction weight sequence to obtain a new extraction weight sequence;
[0108] Determine a new maximum extraction weight from the new extraction weight sequence;
[0109] Based on the new maximum extraction weight and the remaining number of draws to be drawn except the actual number of draws of the virtual resource to be drawn corresponding to the maximum extraction weight, calculate the new first number of draws corresponding to the new maximum extraction weight and the new second number of draws corresponding to the new remaining extraction weights except the new maximum extraction weight in the new extraction weight sequence;
[0110] If the new first number of draws and the new second number of draws meet the conditions of normal distribution, the virtual resource to be drawn corresponding to the new maximum extraction weight will be used as the first virtual resource until the extraction weight sequence is empty or the virtual resource to be drawn corresponding to the extraction weight in the extraction weight sequence does not meet the conditions of normal distribution.
[0111] For example, the extraction weight sequence is: 40, 30, 20, 10. After the virtual resources to be extracted corresponding to the maximum extraction weight of 40 calculated through the above steps satisfy the condition that the number of draws to be drawn and the number of draws under the corresponding extraction weight obey the normal distribution, the maximum extraction weight can be removed from the extraction weight sequence, and the new extraction weight sequence is: 30, 20, 10.
[0112] The new maximum extraction weight refers to the extraction weight with the largest value in the new extraction weight sequence. For example, in the new extraction weight sequence: 30, 20, 10, the new maximum extraction weight may be: 30.
[0113] In some embodiments, the step of "calculating a new first draw number corresponding to the new maximum draw weight and a new second draw number corresponding to the new remaining draw weight in the new draw weight sequence except the new maximum draw weight based on the new maximum draw weight and the remaining draw number in the draw number except the actual draw number of the virtual resource to be drawn corresponding to the maximum draw weight" may include the following operations:
[0114] Calculate the ratio of the new maximum extraction weight to the sum of the extraction weights in the new extraction weight sequence to obtain the third weight ratio corresponding to the new maximum extraction weight;
[0115] Calculate the product of the third weight ratio and the remaining number of draws to be drawn, and obtain the new maximum draw weight corresponding to the new first draw number;
[0116] Calculate the ratio of the sum of the new remaining extraction weights to the sum of the extraction weights in the new extraction weight sequence to obtain the fourth weight ratio corresponding to the new remaining extraction weights;
[0117] The product of the fourth weight proportion and the remaining number of draws to be drawn is calculated to obtain a new second number of draws corresponding to the new remaining drawing weight.
[0118] In an embodiment of the present application, the new first number of draws of the virtual resource to be drawn corresponding to the new maximum extraction weight is calculated by n2*p2, and the new second number of draws of the virtual resource to be drawn corresponding to the new remaining extraction weight is calculated by n2*(1-p2).
[0119] Among them, n2 represents the number of draws to be drawn except the actual number of draws corresponding to the virtual resources to be drawn corresponding to the maximum drawing weight, p2 represents the third weight proportion corresponding to the new maximum drawing weight, and (1-p2) represents the fourth weight proportion corresponding to the new remaining drawing weight.
[0120] For example, the number of draws to be drawn can be 1260, and the actual number of draws corresponding to the virtual resources to be drawn corresponding to the maximum extraction weight can be 800, then n2 can be: 1260-800=460. Then the ratio of the new maximum extraction weight to the sum of the extraction weights in the extraction weight sequence can be calculated as: 30 / (30+20+10)=0.5, and the third weight proportion corresponding to the new maximum extraction weight can be determined as: 0.5. Then the product of the third weight proportion and the number of draws to be drawn is calculated as: 0.5*460=230, and the new first number of draws corresponding to the new maximum extraction weight can be: 230.
[0121] Specifically, the ratio of the sum of the new remaining extraction weights to the sum of the extraction weights in the extraction weight sequence can be calculated as: 1-0.5=0.5, and the fourth weight ratio corresponding to the new remaining extraction weight can be determined to be: 0.5. Then the product of the fourth weight ratio and the number of draws to be drawn is calculated as: 0.5*460=230, and the new second number of draws corresponding to the new remaining extraction weight can be: 230.
[0122] Further, it is determined whether the new first number of draws and the new second number of draws meet the condition of normal distribution.
[0123] For example, the new first number of draws corresponding to the new maximum extraction weight can be: 230; the new second number of draws corresponding to the new remaining extraction weight can be: 230. By comparing the new first number of draws and the new second number of draws with the preset number of draws respectively, it is determined that the new first number of draws and the new second number of draws are both greater than the preset number of draws, which means that the new first number of draws and the new second number of draws meet the conditions of normal distribution, and the virtual resource B corresponding to the new maximum extraction weight can be used as the first virtual resource. The calculation is repeated in this way until the new extraction weight sequence is empty or the virtual resources to be drawn corresponding to the extraction weights in the new extraction weight sequence do not meet the conditions of normal distribution, then the calculation is stopped, and all virtual resources to be drawn whose numbers of draws under the number of draws to be drawn and the corresponding extraction weights obey the normal distribution are obtained as the first virtual resources.
[0124] 104. Randomly draw the first virtual resources according to the drawing weights corresponding to the first virtual resources and the number of draws to be drawn, and determine the first actual number of draws for each first virtual resource.
[0125] In an embodiment of the present application, after determining the first virtual resource, the first virtual resource can be randomly drawn using a Zhengtai distribution according to the drawing weight corresponding to the first virtual resource and the number of draws to be drawn, to simulate the number of times the first virtual resource is drawn in the number of draws to be drawn, that is, the first actual number of draws.
[0126] In some embodiments, when there are two reward items issued in the target game, for example, the reward items include gold coins and diamonds. The probabilities of issuing gold coins and diamonds may be 0.7 and 0.3 respectively. Then the number of times X of issuing gold coins corresponding to n times of issuing gold coins follows a binomial distribution, that is, X~B(n, p).
[0127] Among them, n refers to the number of times the coins are issued, and p corresponds to the probability of issuing coins. When n is large enough, according to the central limit theorem, under appropriate conditions, the means of a large number of independent random variables will converge to the standard normal distribution after normal distribution. That is, when n is large enough, the binomial distribution of B(n, p) will approach the normal distribution N(μ, σ2), where μ and σ2 are the expectation and variance of the binomial distribution, that is, μ is np and σ2 is np(1-p), so when n is large enough, it can be approximated by N(np, np(1-p)).
[0128] For example, when n=10000, the weighted random draw can be directly obtained through the normal distribution such as N(np, np(1-p))=N(7000, 2100). In other words, the result of 10000 binomial distribution random draws can be approximated by 1 normal distribution random draw. Among them, if the binomial distribution is to be approximated by the normal distribution, it will require n*p>10 and n*(1-p)>10. The 10 here can be used to control the confidence of such approximation.
[0129] In some embodiments, when the number of bonus items issued in the target game is more than 2, the problem can be viewed as a combination of binomial distributions.
[0130] For example, the reward items may include diamonds, empty items, and gold coins. Diamonds and (empty items, gold coins) can be considered as two types of items. The extraction weight corresponding to diamonds can be: 30, the extraction weight corresponding to empty items can be: 20, and the extraction weight corresponding to gold coins can be: 10. Assuming that the number of draws to be drawn n = 10000, then the probability of diamonds p = 30 / (10+20+30) = 1 / 2, then according to the above conclusion, it can be simulated by random extraction from the normal distribution of N(np, np(1-p)). For example, the simulation here is 4960, which means that in the 10000 results, 4960 times diamonds were issued, and the remaining 5040 times (empty items, gold coins) were issued.
[0131] Furthermore, for the remaining n=5040, the corresponding reward items are empty and gold coins, and the number of empty items issued is p=10 / (10+20)=1 / 3, so the simulation of N(np, np(1-p)) yields 1711, so the number of empty items issued is 1711, and the corresponding number of gold coins issued is 3329. In these 10,000 random draws, only 2 normal distribution random draws were performed to complete all the draws, which greatly improved the efficiency of the draw.
[0132] The simulation by random sampling of normal distribution of N(np, np(1-p)) may be the result of simulation calculated according to the equivalent formula of normal distribution. In order to show randomness, each simulation may be different.
[0133] 105. According to the extraction weights corresponding to the other virtual resources except the first virtual resource in the virtual resources to be extracted and the remaining number of draws, the other virtual resources are extracted to determine the second virtual resource to be extracted and the second actual number of draws for the second virtual resource.
[0134] The remaining number of draws is the number of draws to be drawn except the sum of the first actual number of draws.
[0135] Among them, other virtual resources refer to virtual resources to be drawn whose number of draws under the number of draws to be drawn and the corresponding drawing weights does not obey the normal distribution.
[0136] Specifically, for the remaining number of draws, the remaining number of draws can be drawn according to the conventional weighted random drawing method. According to the result of the weighted random drawing, the virtual resources drawn among other virtual resources and the number of draws of each drawn virtual resource, that is, the second virtual resource and the second actual number of draws of the second virtual resource, can be obtained.
[0137] In some embodiments, in order to complete the issuance of idle rewards to game players, the method may further include the following steps:
[0138] A first virtual resource is issued to a game account of a game player based on a first actual number of winning draws, and a second virtual resource is issued to the game account based on a second actual number of winning draws.
[0139] Specifically, a first distribution quantity of the first virtual resource is determined according to a first actual winning number corresponding to the first virtual resource, and a second distribution quantity corresponding to the second virtual resource is determined according to a second actual winning number corresponding to the second virtual resource, and then the first distribution quantity of the first virtual resource and the second distribution quantity of the second virtual resource are distributed to the game account of the game player. In this way, the distribution of rewards corresponding to the lottery results is completed.
[0140] The embodiment of the present application discloses a method for extracting virtual resources, which includes: obtaining the number of draws to be obtained by a game player in a target game; obtaining the extraction weights corresponding to each virtual resource to be extracted in the target game; determining at least one first virtual resource from the virtual resources to be extracted based on each extraction weight and the number of draws to be extracted, wherein the number of draws of the first virtual resource under the number of draws to be extracted and the corresponding extraction weight obeys a normal distribution; randomly extracting the first virtual resource according to the extraction weight corresponding to the first virtual resource and the number of draws to be extracted, and determining the first actual number of draws of each first virtual resource; extracting the other virtual resources according to the extraction weights corresponding to the other virtual resources except the first virtual resource in the virtual resources to be extracted, and the remaining number of draws, and determining the second virtual resource to be extracted and the second actual number of draws of the second virtual resource, wherein the remaining number of draws is the number of draws in the number of draws to be extracted except the sum of the first actual number of draws. In this way, the extraction efficiency of virtual resources can be improved, thereby improving the game experience of players.
[0141] Based on the above introduction, the following example will be used to further illustrate the method for extracting virtual resources in this application. Figure 2 , Figure 2A schematic diagram of a flow chart of another method for extracting virtual resources provided in an embodiment of the present application, the specific flow chart may be as follows:
[0142] 201. Obtain the total number of draws and the reward table.
[0143] In the embodiment of the present application, the total number of draws may refer to the number of draws obtained by the game player during the idle time period. For example, the total number of draws may be 10,000.
[0144] The reward table includes multiple reward items for lottery and the weight corresponding to each reward item.
[0145] For example, see Figure 3 , Figure 3 A schematic diagram of an application scenario of a method for extracting virtual resources provided in an embodiment of the present application. Figure 3 , multiple reward items in the reward table are shown, including: 1001, 1002, 1003, 1004, 1005, 1006 and 1007. Among them, the weight corresponding to 1001 can be: 600; the weight corresponding to 1002 can be: 200; the weight corresponding to 1003 can be: 100; the weight corresponding to 1004 can be: 50; the weight corresponding to 1005 can be: 25; the weight corresponding to 1006 can be: 24; the weight corresponding to 1007 can be: 1.
[0146] 202. Sort the items in the reward table based on the weight corresponding to each item in the reward table to obtain a sorted reward table.
[0147] Specifically, for each reward item in the reward table, all reward items are sorted in descending order of weight, and a sorted reward table can be obtained.
[0148] 203. Select candidate items that meet preset conditions from the sorted reward table in turn, and calculate the actual number of draws corresponding to each candidate item in turn.
[0149] After determining the sorted reward table, candidate items can be selected from the sorted reward table. Specifically, select a suitable split point d from the left in the sorted reward table. This split point can satisfy the requirement that the percentage p of the weight of the items before the split point meets the normal distribution requirement, that is, both np and n(1-p) are greater than 10. If so, a normal distribution random sampling is performed to obtain the result of weighted random sampling. For example, if x is obtained, the left half of the sorted reward table at the split point d can be sampled x times according to the above logic, and the right half of the reward table at the split point can be randomly sampled (nx) times. If a suitable split point cannot be found, a regular n-time alias sampling will be performed on the entire reward table.
[0150] In the embodiment of the present application, fast_weighted_sample(L,n) is defined as sampling the sorted reward table L n times, and the final pseudo code can be as follows:
[0151] fast_weighted_sample(L,n);
[0152] Sort L by weight from large to small;
[0153] If L has only 1 entry, return {L[0]:n};
[0154] If n == 0 return {};
[0155] Enumerate the split points d of L from left to right, so that the weight proportion p of L before (including) the split point d satisfies n*p>10 and n*p(1-p)>10;
[0156] Find the split point d that meets the conditions:
[0157] x = weighted random sampling result of normal distribution N(np,np(1-p));
[0158] Left result = fast_weighted_sample (left of L split point, x);
[0159] Right result = fast_weighted_sample (L right of split point, nx);
[0160] Returns the union of the left result and the right result;
[0161] No matching split points found:
[0162] Result = alias sampling L n times;
[0163] Returns the result.
[0164] Specifically, the split point can be found from left to right in the sorted reward table so that the weight proportion p on the left side of the split point satisfies np>10 and n(1-p)>10.
[0165] For example, see Figure 3, we can see that if the first item 1001 is used as the split point, both np and n(1-p) meet the conditions, so we can perform a normal random sampling to calculate. The normal distribution here satisfies N(np, np(1-p)), that is, N(6000,2400). Then we can perform a normal random sampling of the 1001 items, and the value obtained is 6056, which means that 6056 times will fall into the left half of 1001, and the remaining 10000-6056=3944 times will fall into the right. At this time, since there is only one item in the left half, the number of times 1001 is randomly selected is: 6056 times. Next, we only need to sample the remaining items in the right half 3944 times.
[0166] Furthermore, we search for the split point in the weight table items 1002-1007. First, we calculate p=200 / (200+100+50+25+24+1)=0.5 for item 1002. For item 1002, the calculated np and n(1-p) are both greater than 10. Therefore, we perform another normal distribution random sampling, and the result is 2000, which means that the final number of random draws for item 1002 is 2000. Then we can randomly draw 1944 times for the remaining items 1003-1007.
[0167] Specifically, for the following items 1003-1005, np and n(1-p)>10 can all be satisfied according to the above process, so the sampling results can be seen as follows. At this time, items 1001-1005 can all satisfy np and n(1-p)>10, and then through normal distribution random sampling, the final number of random draws for 1003 can be: 988 times, the final number of random draws for 1004 can be: 492 times, and the final number of random draws for 1005 can be: 230 times. Next, the remaining 1006-1007 can be randomly drawn 234 times.
[0168] When calculating np and n(1-p) for the remaining 1006-1007, n(1-p)=9.36<10, which does not meet the conditions for normal distribution approximation. If normal distribution approximation is still performed at this time, there will be a large error. Since there is only one item left, the last 1006 and 1007 can only be sampled using normal weighted random sampling.
[0169] In the embodiment of the present application, when degenerating to the traditional sampling, a faster weighted random sampling method alias sampling can be selected. For example, 234 conventional weighted samplings are performed, and the items 1006 and 10076 are sampled 223 times and 11 times respectively. That is, the number of times 1006 is finally randomly selected can be: 223 times, and the number of times 1007 is finally randomly selected can be: 11 times.
[0170] In the entire random lottery process, a total of 5 normal random distribution samplings and 234 conventional weighted random samplings were performed, which greatly reduced the actual amount of calculations compared to the original 10,000 conventional random samplings. As a result, the random lottery time can be accelerated.
[0171] In the embodiment of the present application, a normal distribution random sampling is used instead of multiple weighted random sampling. Among them, by performing a normal distribution sampling once, corresponding to multiple random number generation, taking the Box-Muller normal distribution sampling method as an example, each time a normal distribution sampling is performed, it is generally necessary to perform two random number generation, as well as some sine and cosine function logarithmic number root operations, and using the alias table sampling method, performing a weighted random sampling once requires generating two random numbers and some simple table lookup comparison functions. It can be seen that the number of random numbers generated is the same, although the normal distribution will require more complex operations, but it is not a big problem under today's high-performance algorithms and computer computing speeds. Generally speaking, one normal distribution random sampling can save a considerable amount of calculation.
[0172] The embodiment of the present application discloses a method for extracting virtual resources, which includes: obtaining the total number of draws and a reward table, sorting the items in the reward table based on the weights corresponding to the items in the reward table to obtain a sorted reward table, selecting candidate items that meet preset conditions from the sorted reward table in turn, and calculating the actual number of draws corresponding to each candidate item in turn. In this way, the efficiency of multiple draws can be improved.
[0173] In order to better implement the virtual resource extraction method provided in the embodiment of the present application, the embodiment of the present application also provides a virtual resource extraction device based on the virtual resource extraction method. The meanings of the terms are the same as those in the virtual resource extraction method, and the specific implementation details can refer to the description in the method embodiment.
[0174] See also Figure 4 , Figure 4 A structural block diagram of a virtual resource extraction device provided in an embodiment of the present application, the device comprising:
[0175] The first acquisition unit 301 is used to acquire the number of pending draws obtained by the game player in the target game;
[0176] The second acquisition unit 302 is used to acquire the extraction weight corresponding to each virtual resource to be extracted in the target game;
[0177] A first determining unit 303 is used to determine at least one first virtual resource from the virtual resources to be drawn based on each drawing weight and the number of draws to be drawn, wherein the number of draws of the first virtual resource under the number of draws to be drawn and the corresponding drawing weight follows a normal distribution;
[0178] A first extraction unit 304 is used to randomly extract the first virtual resources according to the extraction weights corresponding to the first virtual resources and the number of draws to be drawn, and determine a first actual number of draws for each of the first virtual resources;
[0179] The second drawing unit 305 is used to draw the other virtual resources according to the drawing weights corresponding to the other virtual resources in the to-be-drawn virtual resources except the first virtual resource and the remaining number of draws, to determine the drawn second virtual resource and the second actual number of draws of the second virtual resource, wherein the remaining number of draws is the number of draws in the to-be-drawn number except the sum of the first actual number of draws.
[0180] In some embodiments, the first determining unit 303 may include:
[0181] A sorting subunit is used to sort the extraction weights of the virtual resources to be extracted from large to small to obtain an extraction weight sequence;
[0182] The first determination subunit is used to sequentially select virtual resources to be drawn whose winning times under the number of draws to be drawn and the corresponding drawing weights obey a normal distribution based on the drawing weight sequence as the first virtual resources.
[0183] In some embodiments, the first determining subunit may be specifically used for:
[0184] Determining a maximum extraction weight from the extraction weight sequence;
[0185] Calculate, based on the maximum extraction weight and the number of draws to be drawn, a first number of draws corresponding to the maximum extraction weight and a second number of draws corresponding to the remaining extraction weights in the extraction weight sequence except the maximum extraction weight;
[0186] If the first number of draws and the second number of draws satisfy the normal distribution condition, the to-be-drawn virtual resource corresponding to the maximum draw weight is used as the first virtual resource.
[0187] In some embodiments, the first determining subunit may be specifically used for:
[0188] Calculating the ratio of the maximum extraction weight to the sum of the extraction weights in the extraction weight sequence to obtain a first weight ratio corresponding to the maximum extraction weight;
[0189] Calculate the product of the first weight proportion and the number of draws to be drawn to obtain the first number of draws corresponding to the maximum extraction weight;
[0190] Calculating the ratio of the sum of the remaining extraction weights to the sum of the extraction weights in the extraction weight sequence to obtain a second weight proportion corresponding to the remaining extraction weights;
[0191] The product of the second weight proportion and the number of draws to be drawn is calculated to obtain the second number of draws corresponding to the remaining drawing weight.
[0192] In some embodiments, the first determining subunit may be specifically used for:
[0193] The first number of draws and the second number of draws are both greater than a preset number of draws.
[0194] In some embodiments, the first determining subunit may be specifically further used for:
[0195] Removing the maximum extraction weight from the extraction weight sequence to obtain a new extraction weight sequence;
[0196] Determine a new maximum extraction weight from the new extraction weight sequence;
[0197] Based on the new maximum extraction weight and the remaining number of draws to be drawn in the number of draws to be drawn except the actual number of draws of the virtual resource to be drawn corresponding to the maximum extraction weight, calculate a new first number of draws corresponding to the new maximum extraction weight and a new second number of draws corresponding to the new remaining extraction weights except the new maximum extraction weight in the new extraction weight sequence;
[0198] If the new first number of draws and the new second number of draws meet the conditions of normal distribution, the virtual resource to be drawn corresponding to the new maximum extraction weight will be used as the first virtual resource until the extraction weight sequence is empty or the virtual resource to be drawn corresponding to the extraction weight in the extraction weight sequence does not meet the conditions of normal distribution.
[0199] In some embodiments, the first determining subunit may be specifically further used for:
[0200] Calculate the ratio of the new maximum extraction weight to the sum of the extraction weights in the new extraction weight sequence to obtain the third weight proportion corresponding to the new maximum extraction weight;
[0201] Calculate the product of the third weight ratio and the remaining number of draws to be drawn, and obtain a new maximum drawing weight corresponding to a new first number of draws;
[0202] Calculate the ratio of the sum of the new remaining extraction weights to the sum of the extraction weights in the new extraction weight sequence to obtain the fourth weight ratio corresponding to the new remaining extraction weights;
[0203] The product of the fourth weight proportion and the remaining number of draws to be drawn is calculated to obtain a new second number of draws corresponding to a new remaining drawing weight.
[0204] In some embodiments, the first acquisition unit 301 may include:
[0205] A second determining subunit is used to determine the offline time of the game player in the target game;
[0206] The third determining subunit is used to calculate the number of draws obtained by the game player in the offline time period based on the offline time period to obtain the number of draws to be drawn.
[0207] In some embodiments, the apparatus may further include:
[0208] The issuing unit is used to issue a first virtual resource to the game account of the game player based on the first actual number of draws, and to issue a second virtual resource to the game account based on the second actual number of draws.
[0209] The embodiment of the present application discloses a device for extracting virtual resources, wherein a first acquisition unit 301 acquires the number of pending draws obtained by a game player in a target game; a second acquisition unit 302 acquires the extraction weights corresponding to each pending virtual resource in the target game; a first determination unit 303 determines at least one first virtual resource from the pending virtual resources based on each extraction weight and the pending draw number, wherein the number of draws of the first virtual resource under the pending draw number and the corresponding extraction weight obeys a normal distribution; a first extraction unit 304 randomly extracts the first virtual resources according to the extraction weights corresponding to the first virtual resources and the pending draw number, and determines the first actual number of draws of each first virtual resource; a second extraction unit 305 extracts the other virtual resources according to the extraction weights corresponding to the other virtual resources in the pending draw except the first virtual resource, and the remaining number of draws, and determines the second virtual resource to be drawn and the second actual number of draws of the second virtual resource, wherein the remaining number of draws is the number of draws in the pending draw number except the sum of the first actual number of draws. In this way, the extraction efficiency of virtual resources can be improved.
[0210] Accordingly, the embodiment of the present application also provides a computer device, which may be a server. Figure 5 As shown, Figure 5A schematic diagram of the structure of a computer device provided in an embodiment of the present application. The computer device 500 includes a processor 501 having one or more processing cores, a memory 502 having one or more computer-readable storage media, and a computer program stored in the memory 502 and executable on the processor. The processor 501 is electrically connected to the memory 502. It will be understood by those skilled in the art that the computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0211] The processor 501 is the control center of the computer device 500. It uses various interfaces and lines to connect the various parts of the entire computer device 500, executes various functions of the computer device 500 and processes data by running or loading software programs and / or modules stored in the memory 502, and calling data stored in the memory 502, thereby monitoring the computer device 500 as a whole.
[0212] In the embodiment of the present application, the processor 501 in the computer device 500 will load instructions corresponding to the processes of one or more application programs into the memory 502 according to the following steps, and the processor 501 will run the application programs stored in the memory 502 to implement various functions:
[0213] Get the number of pending draws obtained by the game player in the target game;
[0214] Obtain the extraction weight corresponding to each virtual resource to be extracted in the target game;
[0215] Based on each extraction weight and the number of draws to be drawn, determining at least one first virtual resource from the virtual resources to be drawn, wherein the number of draws of the first virtual resource under the number of draws to be drawn and the corresponding extraction weights follows a normal distribution;
[0216] According to the extraction weights corresponding to the first virtual resources and the number of draws to be drawn, the first virtual resources are randomly extracted to determine the first actual number of draws for each first virtual resource;
[0217] According to the drawing weights corresponding to the other virtual resources except the first virtual resource in the virtual resources to be drawn, and the remaining number of draws, the other virtual resources are drawn to determine the second virtual resource drawn and the second actual number of draws for the second virtual resource, wherein the remaining number of draws is the number of draws in the number of draws to be drawn except the sum of the first actual number of draws.
[0218] In some embodiments, based on each extraction weight and the number of draws to be drawn, determining at least one first virtual resource from the virtual resources to be extracted includes:
[0219] Sort the extraction weights of the virtual resources to be extracted from large to small to obtain an extraction weight sequence;
[0220] Based on the extraction weight sequence, virtual resources to be extracted whose winning times under the number of draws to be drawn and the corresponding extraction weights obey the normal distribution are selected in turn as the first virtual resources.
[0221] In some embodiments, based on the extraction weight sequence, virtual resources to be extracted whose draw times under the draw times to be drawn and corresponding extraction weights obey the normal distribution are sequentially screened out as the first virtual resources, including:
[0222] Determine the maximum extraction weight from the extraction weight sequence;
[0223] Calculate the first number of draws corresponding to the maximum extraction weight and the number of draws to be drawn based on the maximum extraction weight and the second number of draws corresponding to the remaining extraction weights in the extraction weight sequence except the maximum extraction weight;
[0224] If the first number of draws and the second number of draws satisfy the normal distribution condition, the to-be-drawn virtual resource corresponding to the maximum draw weight is used as the first virtual resource.
[0225] In some embodiments, based on the maximum extraction weight and the number of draws to be drawn, the first number of draws corresponding to the maximum extraction weight and the second number of draws corresponding to the remaining extraction weights in the extraction weight sequence except the maximum extraction weight are calculated, including:
[0226] Calculate the ratio of the maximum extraction weight to the sum of the extraction weights in the extraction weight sequence to obtain the first weight ratio corresponding to the maximum extraction weight;
[0227] Calculate the product of the first weight ratio and the number of draws to be drawn, and obtain the first number of draws corresponding to the maximum draw weight;
[0228] Calculate the ratio of the sum of the remaining extraction weights to the sum of the extraction weights in the extraction weight sequence to obtain the second weight ratio corresponding to the remaining extraction weights;
[0229] Calculate the product of the second weight proportion and the number of draws to be drawn to obtain the number of second draws corresponding to the remaining draw weight.
[0230] In some embodiments, the first number of draws and the second number of draws satisfy a normal distribution condition, including:
[0231] The first winning number and the second winning number are both greater than the preset winning number.
[0232] In some embodiments, it also includes:
[0233] Remove the maximum extraction weight from the extraction weight sequence to obtain a new extraction weight sequence;
[0234] Determine a new maximum extraction weight from the new extraction weight sequence;
[0235] Based on the new maximum extraction weight and the remaining number of draws to be drawn except the actual number of draws of the virtual resource to be drawn corresponding to the maximum extraction weight, calculate the new first number of draws corresponding to the new maximum extraction weight and the new second number of draws corresponding to the new remaining extraction weights except the new maximum extraction weight in the new extraction weight sequence;
[0236] If the new first number of draws and the new second number of draws meet the conditions of normal distribution, the virtual resource to be drawn corresponding to the new maximum extraction weight will be used as the first virtual resource until the extraction weight sequence is empty or the virtual resource to be drawn corresponding to the extraction weight in the extraction weight sequence does not meet the conditions of normal distribution.
[0237] In some embodiments, based on the new maximum extraction weight and the remaining number of draws to be drawn except the actual number of draws of the virtual resource to be drawn corresponding to the maximum extraction weight, calculating the new first number of draws corresponding to the new maximum extraction weight and the new second number of draws corresponding to the new remaining extraction weights except the new maximum extraction weight in the new extraction weight sequence includes:
[0238] Calculate the ratio of the new maximum extraction weight to the sum of the extraction weights in the new extraction weight sequence to obtain the third weight ratio corresponding to the new maximum extraction weight;
[0239] Calculate the product of the third weight ratio and the remaining number of draws to be drawn, and obtain the new maximum draw weight corresponding to the new first draw number;
[0240] Calculate the ratio of the sum of the new remaining extraction weights to the sum of the extraction weights in the new extraction weight sequence to obtain the fourth weight ratio corresponding to the new remaining extraction weights;
[0241] The product of the fourth weight proportion and the remaining number of draws to be drawn is calculated to obtain a new second number of draws corresponding to the new remaining drawing weight.
[0242] In some embodiments, obtaining the number of pending draws obtained by the game player in the target game includes:
[0243] Determine the amount of time gamers spend offline in the target game;
[0244] The number of draws obtained by the game player during the offline time period is calculated based on the offline time length to obtain the number of draws to be drawn.
[0245] In some embodiments, the method further comprises:
[0246] A first virtual resource is issued to a game account of a game player based on a first actual number of winning draws, and a second virtual resource is issued to the game account based on a second actual number of winning draws.
[0247] The embodiment of the present application obtains the number of draws to be obtained by the game player in the target game, and the corresponding drawing weights of each virtual resource to be drawn; based on each drawing weight and the number of draws to be drawn, at least one first virtual resource is determined from the virtual resources to be drawn; according to the drawing weight corresponding to the first virtual resource and the number of draws to be drawn, the first virtual resource is randomly drawn to determine the first actual number of draws of each first virtual resource; and according to the drawing weights corresponding to other virtual resources in the virtual resources to be drawn except the first virtual resource, and the remaining number of draws, other virtual resources are drawn to determine the second virtual resource to be drawn and the second actual number of draws of the second virtual resource. In this way, the extraction efficiency of virtual resources can be improved.
[0248] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0249] Optional, such as Figure 5 As shown, the computer device 500 further includes: a touch screen 503, a radio frequency circuit 504, an audio circuit 505, an input unit 506, and a power supply 507. The processor 501 is electrically connected to the touch screen 503, the radio frequency circuit 504, the audio circuit 505, the input unit 506, and the power supply 507, respectively. Those skilled in the art can understand that Figure 5 The computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0250] The touch display screen 503 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 503 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 computer device, and these graphical user interfaces may be composed of graphics, guide information, 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 501, and can receive the command sent by the processor 501 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 501 to determine the type of touch event, and then the processor 501 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 503 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 503 can also be used as a part of the input unit 506 to realize the input function.
[0251] The radio frequency circuit 504 may be used to send and receive radio frequency signals, so as to establish wireless communication with a network device or other computer devices through wireless communication, and to send and receive signals between the network device or other computer devices.
[0252] The audio circuit 505 can be used to provide an audio interface between the user and the computer device through a speaker and a microphone. The audio circuit 505 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 505 and converted into audio data, and then the audio data is output to the processor 501 for processing, and then sent to another computer device through the radio frequency circuit 504, or the audio data is output to the memory 502 for further processing. The audio circuit 505 may also include an earphone jack to provide communication between an external headset and the computer device.
[0253] The input unit 506 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.
[0254] The power supply 507 is used to supply power to various components of the computer device 500. Optionally, the power supply 507 can be logically connected to the processor 501 through a power management system, so that the power management system can manage charging, discharging, and power consumption. The power supply 507 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.
[0255] although Figure 5 Not shown, the computer device 500 may also include a camera, a sensor, a wireless fidelity module, a Bluetooth module, etc., which will not be described in detail here.
[0256] 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.
[0257] As can be seen from the above, the computer device provided by this embodiment obtains the number of pending draws obtained by the game player in the target game; obtains the drawing weights corresponding to each virtual resource to be drawn in the target game; based on each drawing weight and the number of pending draws, determines at least one first virtual resource from the virtual resources to be drawn, wherein the number of draws of the first virtual resource under the number of pending draws and the corresponding drawing weight obeys a normal distribution; according to the drawing weights corresponding to the first virtual resources and the number of pending draws, randomly draws the first virtual resources to determine the first actual number of draws of each first virtual resource; according to the drawing weights corresponding to other virtual resources except the first virtual resource in the virtual resources to be drawn, and the remaining number of draws, draws other virtual resources to determine the drawn second virtual resource and the second actual number of draws of the second virtual resource, wherein the remaining number of draws is the number of draws in the number of pending draws except the sum of the first actual number of draws.
[0258] 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.
[0259] To this end, an embodiment of the present application provides a computer-readable storage medium, in which multiple computer programs are stored, and the computer program can be loaded by a processor to execute the steps in any virtual resource extraction method provided in the embodiment of the present application. For example, the computer program can execute the following steps:
[0260] Get the number of pending draws obtained by the game player in the target game;
[0261] Obtain the extraction weight corresponding to each virtual resource to be extracted in the target game;
[0262] Based on each extraction weight and the number of draws to be drawn, determining at least one first virtual resource from the virtual resources to be drawn, wherein the number of draws of the first virtual resource under the number of draws to be drawn and the corresponding extraction weights follows a normal distribution;
[0263] According to the extraction weights corresponding to the first virtual resources and the number of draws to be drawn, the first virtual resources are randomly extracted to determine the first actual number of draws for each first virtual resource;
[0264] According to the drawing weights corresponding to the other virtual resources except the first virtual resource in the virtual resources to be drawn, and the remaining number of draws, the other virtual resources are drawn to determine the second virtual resource drawn and the second actual number of draws for the second virtual resource, wherein the remaining number of draws is the number of draws in the number of draws to be drawn except the sum of the first actual number of draws.
[0265] In some embodiments, based on each extraction weight and the number of draws to be drawn, determining at least one first virtual resource from the virtual resources to be extracted includes:
[0266] Sort the extraction weights of the virtual resources to be extracted from large to small to obtain an extraction weight sequence;
[0267] Based on the extraction weight sequence, virtual resources to be extracted whose winning times under the number of draws to be drawn and the corresponding extraction weights obey the normal distribution are selected in turn as the first virtual resources.
[0268] In some embodiments, based on the extraction weight sequence, virtual resources to be extracted whose draw times under the draw times to be drawn and corresponding extraction weights obey the normal distribution are sequentially screened out as the first virtual resources, including:
[0269] Determine the maximum extraction weight from the extraction weight sequence;
[0270] Calculate the first number of draws corresponding to the maximum extraction weight and the number of draws to be drawn based on the maximum extraction weight and the second number of draws corresponding to the remaining extraction weights in the extraction weight sequence except the maximum extraction weight;
[0271] If the first number of draws and the second number of draws satisfy the normal distribution condition, the to-be-drawn virtual resource corresponding to the maximum draw weight is used as the first virtual resource.
[0272] In some embodiments, based on the maximum extraction weight and the number of draws to be drawn, the first number of draws corresponding to the maximum extraction weight and the second number of draws corresponding to the remaining extraction weights in the extraction weight sequence except the maximum extraction weight are calculated, including:
[0273] Calculate the ratio of the maximum extraction weight to the sum of the extraction weights in the extraction weight sequence to obtain the first weight ratio corresponding to the maximum extraction weight;
[0274] Calculate the product of the first weight ratio and the number of draws to be drawn, and obtain the first number of draws corresponding to the maximum draw weight;
[0275] Calculate the ratio of the sum of the remaining extraction weights to the sum of the extraction weights in the extraction weight sequence to obtain the second weight ratio corresponding to the remaining extraction weights;
[0276] Calculate the product of the second weight proportion and the number of draws to be drawn to obtain the number of second draws corresponding to the remaining draw weight.
[0277] In some embodiments, the first number of draws and the second number of draws satisfy a normal distribution condition, including:
[0278] The first winning number and the second winning number are both greater than the preset winning number.
[0279] In some embodiments, it also includes:
[0280] Remove the maximum extraction weight from the extraction weight sequence to obtain a new extraction weight sequence;
[0281] Determine a new maximum extraction weight from the new extraction weight sequence;
[0282] Based on the new maximum extraction weight and the remaining number of draws to be drawn except the actual number of draws of the virtual resource to be drawn corresponding to the maximum extraction weight, calculate the new first number of draws corresponding to the new maximum extraction weight and the new second number of draws corresponding to the new remaining extraction weights except the new maximum extraction weight in the new extraction weight sequence;
[0283] If the new first number of draws and the new second number of draws meet the conditions of normal distribution, the virtual resource to be drawn corresponding to the new maximum extraction weight will be used as the first virtual resource until the extraction weight sequence is empty or the virtual resource to be drawn corresponding to the extraction weight in the extraction weight sequence does not meet the conditions of normal distribution.
[0284] In some embodiments, based on the new maximum extraction weight and the remaining number of draws to be drawn except the actual number of draws of the virtual resource to be drawn corresponding to the maximum extraction weight, calculating the new first number of draws corresponding to the new maximum extraction weight and the new second number of draws corresponding to the new remaining extraction weights except the new maximum extraction weight in the new extraction weight sequence includes:
[0285] Calculate the ratio of the new maximum extraction weight to the sum of the extraction weights in the new extraction weight sequence to obtain the third weight ratio corresponding to the new maximum extraction weight;
[0286] Calculate the product of the third weight ratio and the remaining number of draws to be drawn, and obtain the new maximum draw weight corresponding to the new first draw number;
[0287] Calculate the ratio of the sum of the new remaining extraction weights to the sum of the extraction weights in the new extraction weight sequence to obtain the fourth weight ratio corresponding to the new remaining extraction weights;
[0288] The product of the fourth weight proportion and the remaining number of draws to be drawn is calculated to obtain a new second number of draws corresponding to the new remaining drawing weight.
[0289] In some embodiments, obtaining the number of pending draws obtained by the game player in the target game includes:
[0290] Determine the amount of time gamers spend offline in the target game;
[0291] The number of draws obtained by the game player during the offline time period is calculated based on the offline time length to obtain the number of draws to be drawn.
[0292] In some embodiments, the method further comprises:
[0293] A first virtual resource is issued to a game account of a game player based on a first actual number of winning draws, and a second virtual resource is issued to the game account based on a second actual number of winning draws.
[0294] The embodiment of the present application obtains the number of draws to be obtained by the game player in the target game, and the corresponding drawing weights of each virtual resource to be drawn; based on each drawing weight and the number of draws to be drawn, at least one first virtual resource is determined from the virtual resources to be drawn; according to the drawing weight corresponding to the first virtual resource and the number of draws to be drawn, the first virtual resource is randomly drawn to determine the first actual number of draws of each first virtual resource; and according to the drawing weights corresponding to other virtual resources in the virtual resources to be drawn except the first virtual resource, and the remaining number of draws, other virtual resources are drawn to determine the second virtual resource to be drawn and the second actual number of draws of the second virtual resource. In this way, the extraction efficiency of virtual resources can be improved.
[0295] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0296] The storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0297] Since the computer program stored in the storage medium can execute the steps in any method for extracting virtual resources provided in the embodiments of the present application, the beneficial effects that can be achieved by any method for extracting virtual resources 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.
[0298] The above is a detailed introduction to a method, device, storage medium and computer equipment for extracting virtual resources provided in an embodiment 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 idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A method for extracting virtual resources, characterized in that: The method comprises: Get the number of pending draws obtained by the game player in the target game; Obtaining extraction weights corresponding to each virtual resource to be extracted in the target game; Based on each extraction weight and the number of draws to be drawn, determining at least one first virtual resource from the virtual resources to be drawn, including: sorting the extraction weights of the virtual resources to be drawn from large to small to obtain an extraction weight sequence; based on the extraction weight sequence, sequentially selecting virtual resources to be drawn whose number of draws under the number of draws to be drawn and the corresponding extraction weights obeys a normal distribution as the first virtual resource; Randomly draw the first virtual resources according to the drawing weights corresponding to the first virtual resources and the number of draws to be drawn, and determine a first actual number of draws for each of the first virtual resources; According to the drawing weights corresponding to the other virtual resources in the to-be-drawn virtual resources except the first virtual resource, and the remaining number of draws, the other virtual resources are drawn to determine the second virtual resource drawn and the second actual number of draws of the second virtual resource, wherein the remaining number of draws is the number of draws in the to-be-drawn number except the sum of the first actual number of draws.
2. The method according to claim 1, characterized in that: The method of sequentially selecting virtual resources to be drawn whose winning times under the number of draws to be drawn and the corresponding drawing weights obey a normal distribution based on the drawing weight sequence as the first virtual resources includes: Determining a maximum extraction weight from the extraction weight sequence; Calculate, based on the maximum extraction weight and the number of draws to be drawn, a first number of draws corresponding to the maximum extraction weight and a second number of draws corresponding to the remaining extraction weights in the extraction weight sequence except the maximum extraction weight; If the first number of draws and the second number of draws satisfy the normal distribution condition, the to-be-drawn virtual resource corresponding to the maximum draw weight is used as the first virtual resource.
3. The method according to claim 2, characterized in that The calculating, based on the maximum extraction weight and the number of draws to be drawn, a first number of draws corresponding to the maximum extraction weight, and a second number of draws corresponding to remaining extraction weights in the extraction weight sequence except the maximum extraction weight, comprises: Calculating the ratio of the maximum extraction weight to the sum of the extraction weights in the extraction weight sequence to obtain a first weight ratio corresponding to the maximum extraction weight; Calculate the product of the first weight proportion and the number of draws to be drawn to obtain the first number of draws corresponding to the maximum extraction weight; Calculating the ratio of the sum of the remaining extraction weights to the sum of the extraction weights in the extraction weight sequence to obtain a second weight proportion corresponding to the remaining extraction weights; The product of the second weight proportion and the number of draws to be drawn is calculated to obtain the second number of draws corresponding to the remaining drawing weight.
4. The method according to claim 2, characterized in that: The first number of draws and the second number of draws satisfy a normal distribution condition, including: The first number of draws and the second number of draws are both greater than a preset number of draws.
5. The method according to claim 2, characterized in that: Also includes: Removing the maximum extraction weight from the extraction weight sequence to obtain a new extraction weight sequence; Determine a new maximum extraction weight from the new extraction weight sequence; Based on the new maximum extraction weight and the remaining number of draws to be drawn in the number of draws to be drawn except the actual number of draws of the virtual resource to be drawn corresponding to the maximum extraction weight, calculate a new first number of draws corresponding to the new maximum extraction weight and a new second number of draws corresponding to the new remaining extraction weights except the new maximum extraction weight in the new extraction weight sequence; If the new first number of draws and the new second number of draws meet the conditions of normal distribution, the virtual resource to be drawn corresponding to the new maximum extraction weight will be used as the first virtual resource until the extraction weight sequence is empty or the virtual resource to be drawn corresponding to the extraction weight in the extraction weight sequence does not meet the conditions of normal distribution.
6. The method according to claim 5, characterized in that The calculating, based on the new maximum extraction weight and the remaining number of draws to be drawn except the actual number of draws of the virtual resource to be drawn corresponding to the maximum extraction weight, a new first number of draws corresponding to the new maximum extraction weight and a new second number of draws corresponding to the new remaining extraction weights except the new maximum extraction weight in the new extraction weight sequence, includes: Calculate the ratio of the new maximum extraction weight to the sum of the extraction weights in the new extraction weight sequence to obtain the third weight proportion corresponding to the new maximum extraction weight; Calculate the product of the third weight ratio and the remaining number of draws to be drawn, and obtain a new maximum drawing weight corresponding to a new first number of draws; Calculate the ratio of the sum of the new remaining extraction weights to the sum of the extraction weights in the new extraction weight sequence to obtain the fourth weight ratio corresponding to the new remaining extraction weights; The product of the fourth weight proportion and the remaining number of draws to be drawn is calculated to obtain a new second number of draws corresponding to a new remaining drawing weight.
7. The method according to claim 1, characterized in that The method of obtaining the number of pending draws obtained by the game player in the target game includes: Determining the offline time of the game player in the target game; The number of draws obtained by the game player during the offline time period is calculated based on the offline time period to obtain the number of draws to be drawn.
8. The method according to any one of claims 1 to 7, characterized in that: The method further comprises: A first virtual resource is issued to the game account of the game player based on the first actual number of winning draws, and a second virtual resource is issued to the game account based on the second actual number of winning draws.
9. A virtual resource extraction device, characterized in that: The device comprises: A first acquisition unit is used to acquire the number of pending draws obtained by the game player in the target game; A second acquisition unit is used to acquire an extraction weight corresponding to each virtual resource to be extracted in the target game; The first determining unit is used to determine at least one first virtual resource from the virtual resources to be drawn based on each extraction weight and the number of draws to be drawn, including: sorting the extraction weights of the virtual resources to be drawn from large to small to obtain an extraction weight sequence; based on the extraction weight sequence, sequentially selecting the virtual resources to be drawn whose number of draws under the number of draws to be drawn and the corresponding extraction weights follows a normal distribution as the first virtual resource; A first extraction unit, configured to randomly extract the first virtual resources according to the extraction weights corresponding to the first virtual resources and the number of draws to be drawn, and determine a first actual number of draws for each of the first virtual resources; The second drawing unit is used to draw the other virtual resources according to the drawing weights corresponding to the other virtual resources in the to-be-drawn virtual resources except the first virtual resource and the remaining number of draws, to determine the drawn second virtual resource and the second actual number of draws of the second virtual resource, wherein the remaining number of draws is the number of draws in the to-be-drawn number except the sum of the first actual number of draws.
10. A computer device comprising a memory, a processor and a computer program stored in the memory and running on the processor, wherein: When the processor executes the program, the method for extracting virtual resources according to any one of claims 1 to 8 is implemented.
11. A storage medium, characterized in that: The storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the method for extracting virtual resources according to any one of claims 1 to 8.
Citation Information
Patent Citations
Virtual prize issuing control method and device and electronic device
CN109663364A
Game machine
JP2015112190A