Effective resource acquisition method and device, storage medium and electronic device

By obtaining the probability value and adjusting the multiple in the resource library in the lottery system, the lottery logic is simplified, solving the problems of high complexity of lottery logic and single applicable scenarios in the existing technology, and achieving more flexible resource acquisition probability settings and resources. Protect.

CN118780860APending Publication Date: 2024-10-15QINGDAO HAIER TECH +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410771247.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-14
Publication Date
2024-10-15

Smart Images

  • Figure CN118780860A_ABST
    Figure CN118780860A_ABST
Patent Text Reader

Abstract

The invention discloses an effective resource obtaining method and device, a storage medium and an electronic device, and relates to the technical field of smart home, the effective resource obtaining method comprises the following steps: obtaining preset configuration information of N effective resources, the preset configuration information being basic attributes of different types of resources configured by a resource management object in a resource library, the basic attribute at least comprises a probability value of obtaining each resource from a resource library by the target object; under the condition that the target object executes a target process of obtaining effective resources from the resource library, determining a target probability value with the maximum numerical digit of the probability value in the configuration information, and recording a target random numerical value associated with the target process; performing numerical value adjustment on the target probability values corresponding to the N effective resources according to the adjustment multiples corresponding to the target probability values to obtain N adjustment numerical values; and determining an obtaining result of the target object on the effective resources based on the target random value and the N adjustment values.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of smart home technology, and more specifically, to a method, device, storage medium and electronic device for acquiring effective resources. Background Art

[0002] Now with the development of the Internet, various platforms or application software will hold various activities to attract users in order to promote new users and stimulate daily activity. Although the styles of activities will vary, there is no doubt that lottery games are definitely the highlight. However, the logic of implementing lottery on the market is relatively simple, and most of them are achieved by generating random numbers from 0 to 100, so as to achieve winning as the core of the lottery logic. Specifically, the operator first enters all the prizes in the operation background and sets the winning probability of each prize separately. The winning probability is an integer between 0 and 100, and the sum is 100. When the user draws the lottery, the probability of each prize will be used to cooperate with the generation of random numbers to achieve the lottery. First, set the range of random number generation to 0 to 100, and then randomly generate a random number each time during the prize cycle. By comparing the size of the random number and the winning probability value of the prize, it is determined whether the prize is won. If the random number is smaller than the winning probability, it is a win, and if it is larger, it is not a win.

[0003] It can be seen that the above probability setting is too simple and limited, and cannot meet all business needs. In addition, random numbers need to be generated frequently during the calculation process, which increases the complexity of the logic to a certain extent.

[0004] Therefore, no effective solutions have been proposed for technical problems in related technologies, such as high logical complexity in determining the results (i.e., winning status) and single applicable scenarios. Summary of the invention

[0005] The embodiments of the present application provide a method, device, storage medium and electronic device for acquiring effective resources, so as to at least solve the technical problems in the related art, such as high logic complexity in determining the acquisition result (i.e., the winning situation) and single applicable scenario.

[0006] According to an embodiment of the embodiments of the present application, a method for obtaining valid resources is provided, including: obtaining preset configuration information of N valid resources, wherein the preset configuration information is the basic attributes of different types of resources configured by the resource management object in the resource library, and the basic attributes at least include: the probability value of the target object obtaining each resource from the resource library, and the resource library includes: N valid resources and M invalid resources, N and M are positive integers; when the target object executes a target process of obtaining valid resources from the resource library, determining the target probability value with the largest number of numerical digits of the probability value in the configuration information, and recording the target random value associated with the target process; numerically adjusting the target probability values ​​corresponding to the N valid resources respectively according to the adjustment multiple corresponding to the target probability value to obtain N adjusted values; and determining the acquisition result of the valid resources by the target object based on the target random value and the N adjusted values.

[0007] In an exemplary embodiment, the acquisition result of the target object for the valid resources is determined based on the target random value and the N adjustment values, including: accumulating the target adjustment values ​​determined by executing the target process on the target object to obtain the target value; determining the size relationship between the target value and the random number corresponding to the target random value; determining whether to allow the target object to acquire the valid resources in the resource library based on the size relationship, to obtain the acquisition result of the target object for the valid resources.

[0008] In an exemplary embodiment, determining whether to allow the target object to acquire valid resources in the resource library is determined based on the size relationship, including: when the size relationship indicates that the target value is less than or equal to the target random value, determining that the target object is prohibited from acquiring valid resources in the resource library; when the size relationship indicates that the target value is greater than the target random value, determining that the target object is allowed to acquire valid resources in the resource library.

[0009] In an exemplary embodiment, before determining the size relationship between the target value and the random number corresponding to the target random value, the method further includes: obtaining a random range corresponding to the target random value; adjusting the random range according to a preset matching rule to obtain an adjusted random range; and determining the random number corresponding to the target object by selecting from the adjusted random range.

[0010] In an exemplary embodiment, the random range is adjusted according to a preset matching rule to obtain an adjusted random range, including: determining a maximum random value and a minimum random value corresponding to the random range; determining a first adjustment multiple corresponding to the maximum random value according to the preset matching rule, and determining a second adjustment multiple corresponding to the minimum random value according to the preset matching rule; determining a maximum value of the adjusted random range according to the product of the maximum random value and the first adjustment multiple; determining a minimum value of the adjusted random range according to the product of the minimum random value and the second adjustment multiple; and determining the adjusted random range based on the maximum value and the minimum value.

[0011] In an exemplary embodiment, the target probability values ​​respectively corresponding to the N valid resources are numerically adjusted according to the adjustment multiples corresponding to the target probability values ​​to obtain N adjustment values, including: identifying a first value P corresponding to the number of numerical digits corresponding to the target probability value; determining the adjustment multiple corresponding to the first value P according to a preset matching rule, wherein the preset matching rule at least includes: determining a second value corresponding to a value 10 raised to the Pth power, determining the second value as the adjustment multiple, and P is a positive integer; and multiplying the target probability value by the adjustment multiples respectively to obtain N adjustment values.

[0012] In an exemplary embodiment, after determining the acquisition result of the target object for the valid resource based on the target random value and the N adjustment values, the above method also includes: when the acquisition result indicates that the target object has acquired any valid resource in the resource library, determining the resource content corresponding to the any valid resource; sending a prompt message carrying the resource content to the target object, and stopping the target object from continuously executing the target process according to the prompt message.

[0013] According to another embodiment of the embodiments of the present application, there is also provided a device for acquiring effective resources, including: an acquisition module, used to acquire preset configuration information of N effective resources, wherein the preset configuration information is the basic attributes of different types of resources configured by the resource management object in the resource library, and the basic attributes at least include: a probability value of the target object acquiring each resource from the resource library, and the resource library includes: N effective resources and M invalid resources, N and M are positive integers; a first determination module, used to determine the target probability value with the largest number of numerical digits of the probability value in the configuration information when the target object executes a target process of acquiring effective resources from the resource library, and record the target random value associated with the target process; an adjustment module, used to numerically adjust the target probability values ​​corresponding to the N effective resources respectively according to the adjustment multiple corresponding to the target probability value, to obtain N adjusted values; a second determination module, used to determine the acquisition result of the effective resource by the target object based on the target random value and the N adjustment values.

[0014] According to another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned method for acquiring valid resources when running.

[0015] According to another embodiment of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the method for acquiring effective resources through the computer program.

[0016] According to another embodiment of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in any of the above-mentioned methods for acquiring effective resources are implemented.

[0017] In an embodiment of the present application, preset configuration information of N valid resources is obtained, wherein the preset configuration information is the basic attributes of different types of resources configured by the resource management object in the resource library, and the basic attributes include at least: the probability value of the target object obtaining each resource from the resource library, the probability value of the target object obtaining N valid resources at the same time is 1, and the resource library includes: N valid resources and M invalid resources; when the target object executes the target process of obtaining valid resources from the resource library, the target probability value with the largest number of numerical digits of the probability value in the configuration information is determined, and the target random value associated with the target process is recorded; the target probability values ​​corresponding to the N valid resources are numerically adjusted according to the adjustment multiples corresponding to the target probability values ​​to obtain N adjusted values; the acquisition result of the target object for the valid resources is determined based on the target random value and the N adjusted values; that is, by expanding the probability value in the process of obtaining valid resources (i.e., prizes), the lottery can be applied to more scenarios. Moreover, by adding up the expanded probability values, the logic only needs to generate a random number of 0-100 times an integer multiple (for example, 1000000) for the target object once, so the overall implementation logic is simpler and clearer. The above technical solution solves the technical problems of high logic complexity in determining the results (i.e., winning) and single applicable scenarios, and can set the probability of obtaining different valid resources to any decimal place, thereby improving the protection of precious valid resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0019] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0020] Figure 1 It is a hardware environment diagram of a method for acquiring effective resources according to an embodiment of the present application;

[0021] Figure 2 is a flowchart of a method for acquiring effective resources according to an embodiment of the present application;

[0022] Figure 3 is a flow chart of a user lottery process according to an embodiment of the present application;

[0023] Figure 4 is a structural block diagram of a device for acquiring effective resources according to an embodiment of the present application;

[0024] Figure 5 is a block diagram of a computer system structure of an electronic device according to an embodiment of the present application;

[0025] Figure 6 An electronic device is provided for implementing a method for acquiring effective resources according to an embodiment of the present application. DETAILED DESCRIPTION

[0026] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings 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 ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0028] According to one aspect of an embodiment of the present application, a method for obtaining effective resources is provided. The method for obtaining effective resources is widely used in smart home (Smart Home), smart home, smart home device ecology, smart residential (Intelligence House) ecology and other whole-house intelligent digital control application scenarios. Optionally, in this embodiment, the above-mentioned method for obtaining effective resources can be applied to Figure 1 In the hardware environment composed of the terminal device 102 and the server 104 shown in FIG. Figure 1 As shown, the server 104 is connected to the terminal device 102 via a network, and can be used to provide services (such as application services, etc.) for the terminal or a client installed on the terminal. A database can be set on the server or independently of the server to provide data storage services for the server 104. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data computing services for the server 104.

[0029] The network may include but is not limited to at least one of the following: wired network, wireless network. The wired network may include but is not limited to at least one of the following: wide area network, metropolitan area network, local area network, and the wireless network may include but is not limited to at least one of the following: WIFI (Wireless Fidelity), Bluetooth. The terminal device 102 may be but is not limited to a PC, a mobile phone, a tablet computer, a smart air conditioner, a smart range hood, a smart refrigerator, a smart oven, a smart stove, a smart washing machine, a smart water heater, a smart washing device, a smart dishwasher, a smart projection device, a smart TV, a smart clothes drying rack, a smart curtain, a smart audio and video, a smart socket, a smart speaker, a smart fresh air device, a smart kitchen and bathroom device, a smart bathroom device, a smart sweeping robot, a smart window cleaning robot, a smart mopping robot, a smart air purification device, a smart steamer, a smart microwave oven, a smart kitchen treasure, a smart purifier, a smart water dispenser, a smart door lock, etc.

[0030] In this embodiment, a method for obtaining effective resources is provided, which can be applied to a computer terminal or an Internet of Things cloud. Figure 2 : is a flowchart of a method for obtaining effective resources according to an embodiment of the present application, and the process includes the following steps:

[0031] Step S202, obtaining preset configuration information of N valid resources, wherein the preset configuration information is basic attributes of different types of resources configured by the resource management object in the resource library, and the basic attributes at least include: a probability value of the target object obtaining each resource from the resource library, and the resource library includes: N valid resources and M invalid resources, where N and M are positive integers;

[0032] It is understandable that in the actual application process, the resource library can be regarded as an activity prize pool, valid resources can be regarded as prizes entered into the activity prize pool, and invalid resources can be encouragement prizes or blessing prizes obtained during the lottery process. The number of valid resources in the prize pool is fixed, while invalid resources can be updated in real time according to the lottery process, with no quantity limit.

[0033] Step S204, when the target object executes the target process of obtaining valid resources from the resource library, determining the target probability value with the largest number of digits of the probability value in the configuration information, and recording the target random value associated with the target process;

[0034] In simple terms, when the target object starts the target process of obtaining valid resources, a corresponding random value will be assigned to the current target object. The random value is confirmation information for determining whether the target object meets the requirements of valid resources.

[0035] For example, the target random value may be a lottery number generated for the target object, and then whether the target object wins the prize is determined by determining the relationship between the lottery result and the lottery number.

[0036] Step S206, adjusting the target probability values ​​corresponding to the N valid resources respectively according to the adjustment multiples corresponding to the target probability values ​​to obtain N adjustment values;

[0037] In other words, since the probability values ​​corresponding to the above-mentioned effective resources will be flexibly adjusted by the operating objects according to the values ​​of different effective resources, in order to expand the application scenarios, probability values ​​of arbitrary decimal places will often appear, making it more difficult to obtain effective resources with high value. However, in order to improve the logical operation efficiency of determining the final acquisition result of the effective resources, when the probability value is a decimal probability value, it is converted into an integer value by amplifying the corresponding integer multiple of the probability value, and at the same time, the target random value associated with the target process is also amplified by the corresponding multiple; the amplified values ​​are compared to determine the acquisition result of the target object, and the same target object can also be cyclically acquired without changing the target random value, which greatly reduces the complexity of the target process cycle.

[0038] Step S208: determining the acquisition result of the target object for the valid resource based on the target random value and the N adjustment values.

[0039] Through the above steps, the preset configuration information of N valid resources is obtained, wherein the preset configuration information is the basic attributes of different types of resources configured by the resource management object in the resource library, and the basic attributes at least include: the probability value of the target object obtaining each resource from the resource library, the probability value of the target object obtaining N valid resources at the same time is 1, and the resource library includes: N valid resources and M invalid resources; when the target object executes the target process of obtaining valid resources from the resource library, the target probability value with the largest numerical digit of the probability value in the configuration information is determined, and the target random value associated with the target process is recorded; the target probability values ​​corresponding to the N valid resources are numerically adjusted according to the adjustment multiple corresponding to the target probability value to obtain N adjustment values; the target object determines the acquisition result of the valid resource based on the target random value and the N adjustment values; that is, by expanding the probability value in the process of obtaining valid resources (i.e. prizes), the lottery can be applied to more scenarios. And by the effect of accumulating the expanded probability value, the logic only needs to generate a random number of 0-100 times an integer multiple (such as: 1000000) for the target object once, so that the overall implementation logic is simpler and clearer. The above technical solution solves technical problems such as high logic complexity and single applicable scenario in determining the acquisition result (i.e. winning situation). As a result, the acquisition probability of different valid resources can be set to any decimal place, thereby improving the protection of precious valid resources.

[0040] In an exemplary embodiment, the acquisition result of the target object for the valid resources is determined based on the target random value and the N adjustment values, including: accumulating the target adjustment values ​​determined by executing the target process on the target object to obtain the target value; determining the size relationship between the target value and the random number corresponding to the target random value; determining whether to allow the target object to acquire the valid resources in the resource library based on the size relationship, to obtain the acquisition result of the target object for the valid resources.

[0041] In an exemplary embodiment, determining whether to allow the target object to acquire valid resources in the resource library is determined based on the size relationship, including: when the size relationship indicates that the target value is less than or equal to the target random value, determining that the target object is prohibited from acquiring valid resources in the resource library; when the size relationship indicates that the target value is greater than the target random value, determining that the target object is allowed to acquire valid resources in the resource library.

[0042] Optionally, assuming that the above N is 4, the adjustment values ​​are: 2223 corresponding to the probability value of 0.2223; 4461 corresponding to the probability value of 0.4461; 2210 corresponding to the probability value of 0.2210, and 1106 corresponding to the probability value of 0.1106; wherein, 0.2223+0.4461+0.2210+0.1106=1, if the target random value corresponding to the target object is 45, the range of the random value is 0-100, and after the corresponding adjustment, the target random value is updated to any random number in the new range, such as 4586, and the range is: 0-1000000, and each time the target object executes the target process twice, the probability values ​​of hitting are respectively 0.2223 corresponding to the valid resources and 0.2210 corresponding to the valid resources. At this time, according to the size relationship between 2210+2223=4433 and 4586, 4433 is less than 4586, and it is determined that the current target object cannot obtain valid resources after executing the target process twice. That is, when the cumulative sum is less than or equal to the random number, it means that the current prize has not been drawn. When the cumulative sum is greater than the random number, it means that the current prize has been drawn.

[0043] In an exemplary embodiment, before determining the size relationship between the target value and the random number corresponding to the target random value, the method further includes: obtaining a random range corresponding to the target random value; adjusting the random range according to a preset matching rule to obtain an adjusted random range; and determining the random number corresponding to the target object by selecting from the adjusted random range.

[0044] In an exemplary embodiment, the random range is adjusted according to a preset matching rule to obtain an adjusted random range, including: determining a maximum random value and a minimum random value corresponding to the random range; determining a first adjustment multiple corresponding to the maximum random value according to the preset matching rule, and determining a second adjustment multiple corresponding to the minimum random value according to the preset matching rule; determining a maximum value of the adjusted random range according to the product of the maximum random value and the first adjustment multiple; determining a minimum value of the adjusted random range according to the product of the minimum random value and the second adjustment multiple; and determining the adjusted random range based on the maximum value and the minimum value.

[0045] In an exemplary embodiment, the target probability values ​​respectively corresponding to the N valid resources are numerically adjusted according to the adjustment multiples corresponding to the target probability values ​​to obtain N adjustment values, including: identifying a first value P corresponding to the number of numerical digits corresponding to the target probability value; determining the adjustment multiple corresponding to the first value P according to a preset matching rule, wherein the preset matching rule at least includes: determining a second value corresponding to a value 10 raised to the Pth power, determining the second value as the adjustment multiple, and P is a positive integer; and multiplying the target probability value by the adjustment multiples respectively to obtain N adjustment values.

[0046] For example, when a user starts to participate in a lottery. The system will query the lottery list from the database, which contains all the prize information including the probability of winning. The system obtains the probability with the most decimal places, gets the number of digits, and obtains the integer that matches 10 times (for example, if the number of decimal places is 4, the integer obtained is 10000). Then loop the prize list and multiply the probability by the multiple. Get a random number between 0-100 and an integer multiple (such as: 1000000). Sort the lottery prizes by probability from large to small. Loop through the lottery prizes, and accumulate the multiplied probability values ​​during the loop, but compare the accumulated sum with the random number obtained each time. When the accumulated sum is less than or equal to the random number, it means that the current prize has not been drawn. When the accumulated sum is greater than the random number, it means that the current prize has been drawn, and finally jump out of the loop directly to perform the award logic.

[0047] In an exemplary embodiment, after determining the acquisition result of the target object for the valid resource based on the target random value and the N adjustment values, the above method also includes: when the acquisition result indicates that the target object has acquired any valid resource in the resource library, determining the resource content corresponding to the any valid resource; sending a prompt message carrying the resource content to the target object, and stopping the target object from continuously executing the target process according to the prompt message.

[0048] In order to better understand the process of the above-mentioned method for obtaining effective resources, the implementation method flow of the above-mentioned method for obtaining effective resources is described below in combination with an optional embodiment, but it is not used to limit the technical solution of the embodiment of the present application.

[0049] The current probability lottery is done by entering an integer from 0 to 100 as the probability. The probability setting is too simple and limited, and cannot meet all business needs. In addition, random numbers need to be generated frequently during the calculation process, which increases the complexity of the logic to a certain extent.

[0050] The optional embodiment of the present application proposes a method for realizing random draw and winning calculation with decimal probability. Specifically, in the related art, different random numbers need to be generated according to each prize in the prize cycle process, and the generation frequency is frequent, which increases the complexity. In order to solve the problem that the probability can only be an integer and the above-mentioned loop logic is complicated. First, the operator can enter decimals of different digits as needed when entering the prize probability. This can be greatly applicable to different business scenarios. For example, if a prize is very valuable, the probability of winning can be set to be extremely low (for example: 0.0001). And in the process of calculation of the present invention, the system only needs to generate a random number, so that developers can more easily understand the implementation logic, and finally provide users with more scenario applications through the decimal winning probability.

[0051] Optional, Figure 3 : is a flow chart of the user lottery process according to an embodiment of the present application. The overall process of the above technical solution is as follows, including the following steps:

[0052] Step 1: First, the operator (equivalent to the operator in the above embodiment) needs to configure the prizes for the lottery, and the probability of winning the prize can be a decimal. However, the sum of the probability of winning is 100. During this process, the system will save the prize data into the database. When the user (equivalent to the target object in the above embodiment) starts to participate in the lottery, the system will query the lottery list from the database, which contains all the prize information including the probability of winning.

[0053] Step 2: Check whether the lottery prizes are empty. If they are empty, end the current lottery process directly.

[0054] Step 3: When the lottery prizes are not empty, loop the prize list to obtain the digit with the maximum probability.

[0055] Step 4: Determine the maximum expansion multiple based on the maximum probability digit.

[0056] Step 5: Loop through all the probabilities and multiply them by the expansion factor in step 4 to get an integer.

[0057] Step 6: Get a random number between 0-100 and an integer multiple (such as 1000000).

[0058] Step 7: Sort the lottery list by probability from highest to lowest.

[0059] Step 8: Loop through the prize list and add up the integer probabilities.

[0060] Step 9: Compare whether the cumulative sum is greater than the random number. If the cumulative sum is less than the random number, continue to loop the process of step 8.

[0061] Step 10: When the cumulative sum is greater than the random number, the current prize is determined as the winning prize and distributed.

[0062] For example, sort the prizes of the lottery from high to low by probability. Loop through the prizes of the lottery, and accumulate the multiplied probability values ​​during the loop, but compare the accumulated sum with the random number each time. When the accumulated sum is less than or equal to the random number, it means that the current prize has not been drawn. When the accumulated sum is greater than the random number, it means that the current prize has been drawn.

[0063] Step 11: Finally, directly jump out of the loop, end the lottery process (equivalent to the target process in the above embodiment), and perform the awarding logic.

[0064] It should be noted that the probability of winning each prize can be a decimal of any digit. During the lottery process, the probability is magnified into an integer. The magnification process is to use the probability of each prize multiplied by the integer multiple of 10 with the most decimal places. (For example, if the maximum number of decimal places is 4, then each probability is multiplied by 10000, and the random number generated is randomly selected from 0-100*10000). In the cyclic lottery process, only one random number needs to be generated. Then the magnified probability value of each prize is added cyclically. When the cumulative sum is greater than the random number, it means that the current prize is the winning prize.

[0065] That is, when the probability is a value of any decimal place, the lottery can be executed. And through the prize cycle, the expanded probability value is added and compared with the unique random number to complete the lottery process.

[0066] The above solution avoids the problem that the probability numbers used in the previous solution are all integers. After adjustment, the probability can be set to a decimal of any digit. By expanding the probability value, the lottery can be applied to more scenarios. And by accumulating the expanded probability value, the logic only needs to generate a random number of 0-100 times an integer multiple (such as 1000000) once. The logic implemented in this way is simpler and clearer.

[0067] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.

[0068] Figure 4 is a structural block diagram of a device for acquiring effective resources according to an embodiment of the present application; Figure 4 As shown, including:

[0069] The acquisition module 42 is used to acquire preset configuration information of N valid resources, wherein the preset configuration information is the basic attributes of different types of resources configured by the resource management object in the resource library, and the basic attributes at least include: the probability value of the target object acquiring each resource from the resource library, and the resource library includes: N valid resources and M invalid resources, where N and M are positive integers;

[0070] A first determination module 44 is used to determine the target probability value with the largest number of digits of the probability value in the configuration information when the target object executes the target process of obtaining valid resources from the resource library, and record the target random value associated with the target process;

[0071] An adjustment module 46, configured to numerically adjust the target probability values ​​respectively corresponding to the N valid resources according to the adjustment multiples corresponding to the target probability values, to obtain N adjustment values;

[0072] The second determination module 48 is used to determine the acquisition result of the target object for the valid resource based on the target random value and the N adjustment values.

[0073] Through the above device, the preset configuration information of N valid resources is obtained, wherein the preset configuration information is the basic attributes of different types of resources configured by the resource management object in the resource library, and the basic attributes at least include: the probability value of the target object obtaining each resource from the resource library, the probability value of the target object obtaining N valid resources at the same time is 1, and the resource library includes: N valid resources and M invalid resources; when the target object executes the target process of obtaining valid resources from the resource library, the target probability value with the largest numerical digit of the probability value in the configuration information is determined, and the target random value associated with the target process is recorded; the target probability values ​​corresponding to the N valid resources are numerically adjusted according to the adjustment multiple corresponding to the target probability value to obtain N adjustment values; the target object determines the acquisition result of the valid resource based on the target random value and the N adjustment values; that is, by expanding the probability value in the process of obtaining valid resources (i.e. prizes), the lottery can be applied to more scenarios. And by the effect of accumulating the expanded probability value, the logic only needs to generate a random number of 0-100 times an integer multiple (such as: 1000000) for the target object once, so that the overall implementation logic is simpler and clearer. The above technical solution solves technical problems such as high logic complexity and single applicable scenario in determining the acquisition result (i.e. winning situation). As a result, the acquisition probability of different valid resources can be set to any decimal place, thereby improving the protection of precious valid resources.

[0074] In an exemplary embodiment, the second determination module 48 is further used to accumulate the target adjustment value determined by executing the target process on the target object to obtain the target value; determine the size relationship between the target value and the random number corresponding to the target random value; determine whether to allow the target object to obtain valid resources in the resource library based on the size relationship, and obtain the acquisition result of the target object for the valid resources.

[0075] In an exemplary embodiment, the above-mentioned second determination module is also used to determine that the target object is prohibited from acquiring valid resources in the resource library when the size relationship indicates that the target value is less than or equal to the target random value; and to determine that the target object is allowed to acquire valid resources in the resource library when the size relationship indicates that the target value is greater than the target random value.

[0076] In an exemplary embodiment, the above-mentioned device also includes: a third determination module, which is used to obtain a random range corresponding to the target random value before determining the size relationship between the target value and the random number corresponding to the target random value; adjust the random range according to a preset matching rule to obtain an adjusted random range; and determine the random number corresponding to the target object by selecting from the adjusted random range.

[0077] In an exemplary embodiment, the above-mentioned third determination module is also used to determine the maximum random value and the minimum random value corresponding to the random range; determine the first adjustment multiple corresponding to the maximum random value according to a preset matching rule, and determine the second adjustment multiple corresponding to the minimum random value according to a preset matching rule; determine the maximum value of the adjusted random range according to the product of the maximum random value and the first adjustment multiple; determine the minimum value of the adjusted random range according to the product of the minimum random value and the second adjustment multiple; determine the adjusted random range based on the maximum value and the minimum value.

[0078] In an exemplary embodiment, the above-mentioned adjustment module is also used to identify a first value P corresponding to the number of numerical digits corresponding to the target probability value; determine an adjustment multiple corresponding to the first value P according to a preset matching rule, wherein the preset matching rule at least includes: determining a second value corresponding to the value 10 to the power of P, determining the second value as the adjustment multiple, and P is a positive integer; and multiplying the target probability value by the adjustment multiple respectively to obtain N adjustment values.

[0079] In an exemplary embodiment, the above-mentioned device also includes: a message module, which is used to determine the acquisition result of the target object for the valid resource based on the target random value and the N adjustment values, and when the acquisition result indicates that the target object has acquired any valid resource in the resource library, determine the resource content corresponding to the any valid resource; send a prompt message carrying the resource content to the target object, and stop the target object from continuously executing the target process according to the prompt message.

[0080] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.

[0081] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described order of actions, because according to the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.

[0082] An embodiment of the present application further provides a storage medium, which includes a stored program, wherein the program executes any of the above methods when it is run.

[0083] Optionally, in this embodiment, the storage medium may be configured to store program codes for executing the following steps:

[0084] S1, obtaining preset configuration information of N valid resources, wherein the preset configuration information is the basic attributes of different types of resources configured by the resource management object in the resource library, and the basic attributes at least include: the probability value of the target object obtaining each resource from the resource library, and the resource library includes: N valid resources and M invalid resources, where N and M are positive integers;

[0085] S2, when the target object executes a target process of acquiring valid resources from the resource library, determining a target probability value having the largest number of digits of the probability value in the configuration information, and recording a target random value associated with the target process;

[0086] S3, numerically adjusting the target probability values ​​corresponding to the N valid resources respectively according to the adjustment multiples corresponding to the target probability values, to obtain N adjustment values;

[0087] S4: Determine the acquisition result of the target object for the valid resource based on the target random value and the N adjustment values.

[0088] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0089] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0090] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:

[0091] S1, obtaining preset configuration information of N valid resources, wherein the preset configuration information is the basic attributes of different types of resources configured by the resource management object in the resource library, and the basic attributes at least include: the probability value of the target object obtaining each resource from the resource library, and the resource library includes: N valid resources and M invalid resources, where N and M are positive integers;

[0092] S2, when the target object executes a target process of acquiring valid resources from the resource library, determining a target probability value having the largest number of digits of the probability value in the configuration information, and recording a target random value associated with the target process;

[0093] S3, numerically adjusting the target probability values ​​corresponding to the N valid resources respectively according to the adjustment multiples corresponding to the target probability values, to obtain N adjustment values;

[0094] S4: Determine the acquisition result of the target object for the valid resource based on the target random value and the N adjustment values.

[0095] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store program codes.

[0096] Figure 5 The computer system structure block diagram for implementing the electronic device of the embodiment of the present application is schematically shown. It should be noted that: Figure 5 The computer system 500 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application. Figure 5As shown, the computer system 500 includes a central processing unit 501 (CPU), which can perform various appropriate actions and processes according to the program stored in the read-only memory 502 (ROM) or the program loaded from the storage part 508 to the random access memory 503 (RAM). Various programs and data required for system operation are also stored in the random access memory 503. The central processing unit 501, the read-only memory 502 and the random access memory 503 are connected to each other through a bus 504. The input / output interface 505 (Input / Output interface, i.e., I / O interface) is also connected to the bus 504.

[0097] The following components are connected to the input / output interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a local area network card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the input / output interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed so that a computer program read therefrom is installed into the storage section 508 as needed.

[0098] In particular, according to an embodiment of the present application, the process described in each method flow chart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer readable medium, and the computer program contains a program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 509, and / or installed from the removable medium 511. When the computer program is executed by the central processor 501, various functions defined in the system of the present application are executed.

[0099] According to another aspect of the embodiment of the present application, an electronic device for implementing the acquisition of the above-mentioned effective resources is also provided. Figure 6 As shown, the electronic device includes a memory 602 and a processor 604. The memory 602 stores a computer program, and the processor 604 is configured to execute the steps in any of the above method embodiments through the computer program.

[0100] Optionally, in this embodiment, the electronic device may be located in at least one of a plurality of network devices of a computer network. A person skilled in the art may understand that Figure 6 The structure shown is for illustration only, and the electronic device may also be a device including the above-mentioned flash memory. Figure 6 The structure of the electronic device is not limited. Figure 6 More or fewer components (such as network interfaces, etc.) as shown in, or with Figure 6 Different configurations shown.

[0101] Among them, the memory 602 can be used to store software programs and modules, such as the acquisition of effective resources in the embodiments of the present application and the corresponding program instructions / modules of the device. The processor 604 executes various functional applications and data processing by running the software programs and modules stored in the memory 602, that is, to achieve the acquisition of the above-mentioned effective resources. The memory 602 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 602 may further include a memory remotely located relative to the processor 604, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. Among them, the memory 602 can specifically be, but is not limited to, used for information such as logs containing modeling data. As an example, such as Figure 6 As shown, the memory 602 may include but is not limited to the modules in the effective resource acquisition device. In addition, it may also include but is not limited to other module units in the effective resource acquisition device, which will not be described in detail in this example.

[0102] Optionally, the transmission device 606 is used to receive or send data via a network. Specific examples of the network may include a wired network and a wireless network. In one example, the transmission device 606 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers via a network cable so as to communicate with the Internet or a local area network. In one example, the transmission device 606 is a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0103] In addition, the electronic device further includes: a display 608; and a connection bus 610, which is used to connect various module components in the electronic device.

[0104] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any one of the above method embodiments are implemented.

[0105] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.

[0106] The embodiments of the present application also provide a computer program, which includes computer instructions, which are stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps of any one of the above method embodiments.

[0107] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.

[0108] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.

[0109] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A method for acquiring effective resources, characterized in that: include: Obtaining preset configuration information of N valid resources, wherein the preset configuration information is basic attributes of different types of resources configured by the resource management object in the resource library, and the basic attributes at least include: a probability value of the target object obtaining each resource from the resource library, and the resource library includes: N valid resources and M invalid resources, where N and M are positive integers; In the case where the target object executes a target process of acquiring valid resources from the resource library, determining a target probability value having the largest number of digits of the probability value in the configuration information, and recording a target random value associated with the target process; According to the adjustment multiple corresponding to the target probability value, the target probability values ​​corresponding to the N valid resources are numerically adjusted to obtain N adjustment values; The acquisition result of the target object for the valid resource is determined based on the target random value and the N adjustment values.

2. The method for obtaining effective resources according to claim 1, characterized in that: Determining, based on the target random value and the N adjustment values, a result of obtaining the valid resource by the target object, comprising: Accumulate the target adjustment values ​​determined by executing the target process on the target object to obtain the target value; Determine the magnitude relationship between the target value and the random number corresponding to the target random value; Whether to allow the target object to acquire the valid resources in the resource library is determined according to the size relationship, and an acquisition result of the target object for the valid resources is obtained.

3. The method for obtaining effective resources according to claim 2, characterized in that: Determining whether to allow the target object to obtain valid resources in the resource library according to the size relationship includes: When the size relationship indicates that the target value is less than or equal to the target random value, determining to prohibit the target object from acquiring valid resources in the resource library; In a case where the size relationship indicates that the target value is greater than the target random value, it is determined that the target object is allowed to acquire valid resources in the resource library.

4. The method for obtaining effective resources according to claim 2, characterized in that: Before determining the magnitude relationship between the target value and the random number corresponding to the target random value, the method further includes: Obtaining a random range corresponding to the target random value; Adjusting the random range according to a preset matching rule to obtain an adjusted random range; A random number corresponding to the target object is determined from the adjusted random range by selection.

5. The method for acquiring effective resources according to claim 4, characterized in that: The random range is adjusted according to a preset matching rule to obtain an adjusted random range, including: Determine the maximum random value and the minimum random value corresponding to the random range; Determine a first adjustment multiple corresponding to the maximum random value according to a preset matching rule, and determine a second adjustment multiple corresponding to the minimum random value according to a preset matching rule; Determine the maximum value of the adjusted random range according to the product of the maximum random value and the first adjustment multiple; Determine the minimum value of the adjusted random range according to the product of the minimum random value and the second adjustment multiple; The adjustment random range is determined based on the maximum value and the minimum value.

6. The method for acquiring effective resources according to claim 1, characterized in that: According to the adjustment multiple corresponding to the target probability value, the target probability values ​​corresponding to the N valid resources are numerically adjusted to obtain N adjustment values, including: Identify a first value P corresponding to the number of digits corresponding to the target probability value; Determine an adjustment multiple corresponding to the first value P according to a preset matching rule, wherein the preset matching rule at least includes: determining a second value corresponding to a value 10 raised to the power of P, determining the second value as the adjustment multiple, and P is a positive integer; The adjustment multiples are respectively multiplied by the target probability value to obtain N adjustment values.

7. The method for acquiring effective resources according to claim 4, characterized in that: After determining the acquisition result of the target object for the valid resource based on the target random value and the N adjustment values, the method further includes: In a case where the acquisition result indicates that the target object has acquired any valid resource in the resource library, determining resource content corresponding to the any valid resource; A prompt message carrying the resource content is sent to the target object, and the target object stops continuous execution of the target process according to the prompt message.

8. An effective resource acquisition device, characterized in that: include: An acquisition module is used to acquire preset configuration information of N valid resources, wherein the preset configuration information is the basic attributes of different types of resources configured by the resource management object in the resource library, and the basic attributes at least include: a probability value of the target object acquiring each resource from the resource library, and the resource library includes: N valid resources and M invalid resources, where N and M are positive integers; A first determination module is used to determine the target probability value with the largest number of numerical digits of the probability value in the configuration information when the target object executes the target process of obtaining valid resources from the resource library, and record the target random value associated with the target process; An adjustment module, configured to numerically adjust the target probability values ​​respectively corresponding to the N valid resources according to the adjustment multiples corresponding to the target probability values, to obtain N adjustment values; The second determination module is used to determine the acquisition result of the target object for the valid resource based on the target random value and the N adjustment values.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method described in any one of claims 1 to 7 when executed.

10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 7 through the computer program.