Resource allocation method and device, equipment and medium
By introducing action conversion logic and target probability models into the resource allocation system, business logic and implementation logic are decoupled, and the problem of large workload in the code development of resource allocation system in the existing technology is solved, and more flexible and efficient resource allocation management is achieved.
Patent Information
- Application Number
- CN202411745466.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-05-06
AI Technical Summary
In the prior art, the high degree of coupling between the business logic and the implementation logic of the resource allocation system is caused by the need to update the implementation logic of the resource allocation system when the business logic changes, which increases the workload of code development.
By introducing action conversion logic and target probability models into the resource allocation system, the business logic and resource allocation system realize logic. The specific steps include: determining the number of resource allocation based on the action conversion logic and object properties, finding the target probability model, running the model to determine the resource allocation probability, and allocating resources within the probability range.
The decoupling of the business logic and the resource allocation system is realized, reducing the code development workload of the resource allocation system, so that when the business scenario changes, you only need to change the incoming parameters of the action conversion logic and the probability model.
Smart Images

Figure CN119945991A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a resource allocation method, apparatus, device and medium. Background Art
[0002] In many business scenarios, the issue of resource allocation is involved. Resource allocation means randomly allocating resources to one or more target objects according to the specified business logic. Usually, the business logic for allocating resources to target objects is different in different business scenarios.
[0003] At present, in some technologies, there is a high degree of coupling between the business logic used for resource allocation and the implementation logic of the resource allocation system. When the business logic changes, the implementation logic of the resource allocation system also needs to be updated at the same time, which greatly increases the code development workload of the resource allocation system. Summary of the invention
[0004] In view of this, the present disclosure provides a resource allocation method, a resource allocation device, an electronic device and a computer-readable storage medium, which can decouple business logic and resource allocation system implementation logic, thereby reducing the code development workload of the resource allocation system.
[0005] In a first aspect, the present disclosure provides a resource allocation method, the method comprising:
[0006] In response to a target object executing a target action, and the target action being in a pre-configured resource allocation trigger action, determining a resource allocation count for the target object based on an action conversion logic matching the target action and an object attribute of the target object;
[0007] In response to the target object initiating a resource allocation request, searching for a target probability model for determining a resource allocation probability, where different probability models are used to determine the resource allocation probability according to different logics;
[0008] Running the target probability model to determine the target probability of allocating resources to the target object;
[0009] If the target probability is within a preset probability range, the designated resources in the resource pool are allocated to the target object, and the resource allocation times of the target object are updated.
[0010] In a second aspect, the present disclosure provides a resource allocation device, the device comprising:
[0011] An action response module, configured to respond to a target object executing a target action, wherein the target action is in a pre-configured resource allocation trigger action, and determine a resource allocation count for the target object based on an action conversion logic matching the target action and an object attribute of the target object;
[0012] A request response module, configured to respond to the resource allocation request initiated by the target object and search for a target probability model for determining the resource allocation probability, wherein different probability models are used to determine the resource allocation probability according to different logics;
[0013] A probability determination module, used to run the target probability model to determine the target probability of allocating resources to the target object;
[0014] The resource allocation module is used to allocate the specified resources in the resource pool to the target object if the target probability is within a preset probability range, and update the resource allocation times of the target object.
[0015] In a third aspect, the present disclosure provides an electronic device, comprising: a memory and a processor, wherein the memory and the processor are communicatively connected to each other, computer instructions are stored in the memory, and the processor executes the above method by executing the computer instructions.
[0016] In a fourth aspect, the present disclosure provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the above method.
[0017] In the technical solutions of some embodiments of the present disclosure, when the target object performs a target action, the number of resource allocations of the target object can be determined based on the action conversion logic matching the target action and the object attributes of the target object, and when the target object initiates a resource allocation request, the target probability model for determining the probability of resource allocation can be found, and the target probability model can be run to determine the target probability of allocating resources to the target object, and resources can be allocated to the target object based on the target probability. Through this implementation process, it can be seen that the scheme of the present disclosure is based on the modularization of program code to perform different functions of resource allocation, for example, the action conversion logic and the probability model are program code modules that are separately set, and the input parameters of these program code modules can be configurable, so that when the business scenario changes, it is only necessary to change the input parameters of these program code modules, without modifying the implementation logic of each program code module based on the business logic, thereby decoupling the business logic and the implementation logic of the resource allocation system, and greatly reducing the code development workload of the resource allocation system. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the specific embodiments of the present disclosure or the technical solutions in the related technologies, the drawings required for use in the specific embodiments or the related technical descriptions will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0019] Figure 1 is a module diagram of a resource allocation system provided by an embodiment of the present disclosure;
[0020] Figure 2 is a flowchart of a resource allocation method provided by an embodiment of the present disclosure;
[0021] Figure 3 is a schematic diagram of module interaction of a resource allocation method provided by an embodiment of the present disclosure;
[0022] Figure 4 is a module schematic diagram of a resource allocation device provided by an embodiment of the present disclosure;
[0023] Figure 5 It is a schematic diagram of the structure of an electronic device provided by some embodiments of the present disclosure. DETAILED DESCRIPTION
[0024] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.
[0025] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments set forth herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0026] In the description of the embodiments of the present disclosure, the term "including" and similar terms should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "based at least in part on". The term "some embodiments" or "the embodiment" should be understood as "at least some embodiments". The term "some embodiments" should be understood as "at least some embodiments". Other explicit and implicit definitions may also be included below.
[0027] Herein, unless explicitly stated, executing a step “in response to A” does not mean executing the step immediately after “A” but may include one or more intermediate steps.
[0028] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition, use, storage or deletion of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.
[0029] It is understandable that before using the technical solutions disclosed in the various embodiments of the present disclosure, the types, scopes of use, usage scenarios, etc. of the information involved in the present disclosure should be informed to relevant users and their authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations. The relevant users may include any type of right holders, such as individuals, enterprises, and groups.
[0030] For example, in response to receiving an active request from a user, a prompt message is sent to the relevant user to clearly prompt the relevant user that the operation requested to be performed will require obtaining and using the information of the relevant user, so that the relevant user can independently choose whether to provide information to software or hardware such as an electronic device, application, server or storage medium that executes the operation of the technical solution of the present disclosure based on the prompt message.
[0031] As an optional but non-limiting implementation, in response to receiving an active request from a relevant user, a prompt message is sent to the relevant user, for example, in the form of a pop-up window, in which the prompt message may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to select "agree" or "disagree" to provide information to the electronic device.
[0032] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0033] Resource allocation in business scenarios is to put the item information of an item into a resource pool, and randomly establish the association between the item information and the target object according to the specified business logic, so as to allocate one or more items to one or more target objects that meet specific conditions. The items here can include virtual items and physical items. Virtual items can include but are not limited to bandwidth, traffic, shopping vouchers, coupons, etc. Physical items can include but are not limited to mobile phones, computers, cars, etc. Target objects can be people, animals, objects (such as servers), etc.
[0034] Generally speaking, a system that performs resource allocation can be called a resource allocation system. In different business scenarios, the business logic of resource allocation system to allocate resources to target objects can be different. For example, in some business scenarios, it is necessary to select a target group of people aged 30 to 50 from the population in area A, and randomly allocate a mobile phone to some people in the target group. For example, in other business scenarios, it is necessary to randomly allocate a specified bandwidth size to the target server that performs a specified operation.
[0035] At present, in some technologies, there is a high degree of coupling between the business logic used for resource allocation and the implementation logic of the resource allocation system. When the business logic changes, the implementation logic of the resource allocation system also needs to be updated at the same time, which greatly increases the code development workload of the resource allocation system.
[0036] To solve the above problems, the present disclosure first provides a resource allocation system. Figure 1 , which is a module diagram of a resource allocation system provided by an embodiment of the present disclosure. Figure 1 In the unified configuration platform, the resource allocation system includes a unified configuration platform, an underlying engine, and a data statistics display layer. In the unified configuration platform, system maintenance personnel can perform action-related logic configuration, resource allocation-related logic configuration, resource pool configuration, metadata definition, and monitoring feedback configuration. The following describes the above-mentioned types of configuration.
[0037] 1) Action-related logic configuration
[0038] The action-related logic configuration may exemplarily include the conversion logic configuration between the action and the triggering of resource allocation, the conversion logic configuration between the action and the number of resource allocations, and the conversion selection logic configuration. Among them, the conversion logic between the action and the triggering of resource allocation is used to specify the action of the object triggering resource allocation and the conditions that the action must meet. For example, the user clicks the "Download" button 3 times in the specified page to trigger resource allocation. Here, the action of clicking the "Download" button can be the action of the object triggering resource allocation, and clicking the "Download" button 3 times can be the condition that the action must meet. For another example, the server reports alarm M within a preset time period, and the number of alarms M reaches 5, which can trigger resource allocation. Here, the action of reporting alarm M on the server can be the action of the object triggering resource allocation, and the number of alarms M reaches 5, which can be the action of the object triggering resource allocation.
[0039] The conversion logic between actions and resource allocation times is used to specify the logic for determining the resource allocation times in combination with the object attributes when the object performs an action that meets the conditions and triggers resource allocation. Among them, the resource allocation times represent the total number of times that resources are allowed to be allocated to the object. The object attributes can include not only the object's own attributes (such as height, weight, and region), but also related attributes when the object performs an action (such as the total number of times and time when the object performs the action). For example, after user A clicks the "Download" button 3 times on the specified page, if the file downloaded by user A is file a, the resource allocation times corresponding to user A can be 5 times (that is, user A is allowed to be allocated resources 5 times). For another example, after user B clicks the "Download" button 3 times on the specified page, if user B is a user located in region b, the resource allocation times corresponding to user B can be 10 times (that is, user A is allowed to be allocated resources 10 times).
[0040] Conversion selection logic refers to how to select the best conversion logic among multiple conversion logics when the action of an object corresponds to multiple conversion logics of the same type. For example, suppose the system maintenance personnel configure the following conversion logics in the unified configuration platform:
[0041] A1. After the user clicks the "Download" button three times on the specified page, if the file downloaded by the user is file a, the number of resource allocations corresponding to the user can be 5 times;
[0042] A2. After the user clicks the "Download" button three times on the specified page, if the user is in area b, the number of resource allocations corresponding to the user can be 10 times;
[0043] A3. After the user clicks the "Download" button three times on the specified page, if the user's age is between 10 and 20 years old, the number of resource allocations corresponding to the user can be 15 times.
[0044] If user A clicks the "Download" button three times on the specified page, the file downloaded by user A is file a, the user is in area b, and the age range of user A is between 10 and 20 years old, then the above three conversion logics can all be used to determine the number of resource allocations for user A. In this case, the maintenance personnel can configure the conversion selection logic in the unified configuration platform to resolve this conflict. For example, the conversion selection logic can be: the conversion logic with the largest number of resource allocations is used as the optimal conversion logic. Based on this conversion selection logic, the above conversion logic A3 can be used as the optimal conversion logic. For another example, the conversion selection logic can be: the conversion logic with the smallest number of resource allocations is used as the optimal conversion logic. Based on this conversion selection logic, the above conversion logic A1 can be used as the optimal conversion logic.
[0045] Based on the above description, the object can trigger the object to obtain the right to be allocated resources and the corresponding resource allocation times by executing actions. After the object obtains the right to be allocated resources, it can trigger the resource allocation system to randomly allocate resources to it according to a certain probability by initiating a resource allocation request in the resource allocation system.
[0046] 2) Logical configuration related to resource allocation
[0047] The logical configuration related to resource allocation may exemplarily include time window configuration, dynamic probability configuration, dynamic switching configuration and fairness configuration. Among them, the time window can be used to specify the time period for executing resource allocation. For example, if the time window is from 10 o'clock to 12 o'clock every night, it means that the operation of resource allocation can only be triggered between 10 o'clock and 12 o'clock every night.
[0048] Dynamic probability configuration can be used to specify the change logic of resource allocation probability. For example, if user A clicks the "Download" button 3 times on a specified page, the probability of allocating resources to user A is 0.2; if user A clicks the "Download" button 5 times on a specified page, the probability of allocating resources to user A is 0.3; if user A clicks the "Download" button 100 times on a specified page, the probability of allocating resources to user A is 0.8. In this way, the number of times a user performs an action can be proportional to the probability of resource allocation. That is, the probability of allocating resources to user A changes dynamically with the number of times user A performs an action.
[0049] Dynamic switching configuration refers to how to switch the probability calculation logic among multiple different preset probability calculation logics. Among them, the probability calculation logic can be provided by the underlying engine of the resource allocation system. The underlying engine can include multiple probability models, and different probability models can determine the resource allocation probability according to different logics. For example, probability model B1 can determine the resource allocation probability based on the number of resources in the resource pool and the number of actions that the object has executed. For another example, probability model B2 can determine the resource allocation probability based on the resource weights of each resource in the object resource pool and the time point when the object initiates a resource allocation request. For another example, probability model B3 can use the fixed probability configured by the maintenance personnel in the unified configuration platform as the resource allocation probability. When the same object initiates a resource allocation request at different stages, the probability model used can be different. Through dynamic switching configuration, the switching logic between different probability models can be specified. For example, when user A initiates a resource acquisition request for the first time, probability model B1 can be used to calculate the probability of allocating resources to user A. When user B initiates a resource acquisition request for the second time, probability model B2 can be used to calculate the probability of allocating resources to user A. In this way, when user A initiates a resource acquisition request at different stages, the corresponding probability calculation logic is different.
[0050] Fairness configuration is used to ensure that resources can be fairly and randomly allocated to each object. For example, fairness configuration can be as follows: within a preset time, a single object cannot initiate resource allocation requests more than 3 times. Another example is that the number of resources allocated to a single object that exceeds the price threshold cannot exceed 2.
[0051] 3) Resource pool configuration
[0052] Resource pool configuration can include resource weight configuration, resource configuration, and resource attribute configuration. Among them, the resource weight is used to represent the probability of the resource being assigned to the object. For example, if the weight of resource C1 is 0.5 and the weight of resource C2 is 0.8, it means that the probability of resource C1 being assigned to the object is 50%, and the probability of resource C2 being assigned to the object is 80%.
[0053] Resource configuration is used to specify the resource types included in the resource pool, the quantity of each type of resource, etc. For example, a resource pool may include 3 computers, 2 mobile phones, and 50 kettles.
[0054] Resource attribute configuration is used to specify the attributes of each resource in the resource pool, such as the weight of each resource.
[0055] 4) Metadata Definition
[0056] Metadata definitions are used to specify the data that the resource allocation system needs to use during the resource allocation process, such as the action that triggers resource allocation, the region where the object is located, etc.
[0057] So far, it's done Figure 1 It is understandable that Figure 1 This is just an example. In actual applications, the content configured in the unified configuration platform can be selected according to actual needs. For example, in some embodiments, the global resource allocation probability can also be configured in the unified configuration platform to control the overall resource allocation probability of the object. For example, the resource allocation probability calculated by the probability model shall not exceed the global resource allocation probability configured in the unified configuration platform.
[0058] In addition, some logic configured in the unified configuration platform can also be solidified in the underlying engine of the resource allocation system, for example, the dynamic switching logic of the probability calculation logic can be solidified in the underlying logic. The present disclosure does not limit the configuration content in the unified configuration platform.
[0059] Continue to read Figure 1The underlying engine of the resource allocation system can mainly include an action engine and a resource allocation engine. Among them, when an object performs an action, the action engine can determine whether the object action can trigger resource allocation and the number of resource allocations, etc., based on the logic configuration related to the action. When the object obtains the right to be allocated resources and initiates a resource acquisition request, the resource allocation engine can control the object's resource allocation probability, resource allocation number, etc., based on the logic configuration related to resource allocation.
[0060] In some embodiments, the resource allocation system may further include a data statistics display layer. In the data statistics display layer, the resource allocation system may display statistical data during the resource allocation process.
[0061] based on Figure 1 The resource allocation system shown in the present disclosure provides a resource allocation method. The resource allocation method can be applied to the resource allocation system, or to an electronic device running the resource allocation system. The electronic device can include but is not limited to a server, a tablet computer, a laptop computer, a desktop computer, a mobile phone, etc. Figure 2 , which is a flow chart of a resource allocation method provided in one embodiment of the present disclosure. Figure 2 In the method, the resource allocation method comprises the following steps:
[0062] Step S201, in response to a target object executing a target action, and the target action is in a pre-configured resource allocation trigger action, determining the number of resource allocations for the target object based on an action conversion logic matching the target action and an object property of the target object.
[0063] Specifically, the resource allocation trigger action is an action configured in the unified configuration platform that can trigger resource allocation. For example, clicking the "Download" button on a specified page. The action conversion logic can be Figure 1 "Action-related logic configuration" in. Based on the action conversion logic and the object attributes of the target object, it can be determined whether the target object meets the conditions for being allocated resources and the corresponding number of resource allocations. The object attributes of the target object may include but are not limited to the region where the target object is located, age, time and number of times the target object performs the target action, etc. By substituting the object attributes of the target object into the action conversion logic that matches the target action, it can be determined whether the target object has the right to be allocated resources, and when it has the right to be allocated resources, the corresponding number of resource allocations.
[0064] Further, such as Figure 1In the case where there are multiple matching action conversion logics for the target action, the corresponding resource allocation times can be determined based on each action conversion logic respectively; and among the determined resource allocation times, the target resource allocation times that meet the second preset condition are selected as the resource allocation times of the target object. In this way, the problem of determining multiple different resource allocation times based on different action conversion logics can be avoided.
[0065] In this embodiment, the second preset condition may be: taking the maximum resource allocation times as the target resource allocation times. In practical applications, the second preset condition may be set according to actual needs, and the present disclosure does not limit this.
[0066] Step S202: in response to a resource allocation request initiated by a target object, a target probability model for determining a resource allocation probability is searched, and different probability models are used to determine the resource allocation probability according to different logics.
[0067] Specifically, Figure 1 As described above, after obtaining the right to be allocated resources and the corresponding number of resource allocations, the target object can initiate a resource allocation request in the resource allocation system.
[0068] Each probability model may have its own corresponding model calling logic, which is set according to the conditional factors, and the conditional factors may include one or more of the object attributes, resource allocation request attributes, and resource allocation trigger action attributes. Among them, the resource allocation request attributes may include but are not limited to the time when the object initiates the resource allocation request, the historical characteristic information of the resources allocated to the object, the number of resource allocation requests allowed to be initiated by the object, etc. The historical characteristic information of the resources allocated to the object may include but are not limited to the time period of the resource allocation request initiated by the object in history, the historical resource allocation probability, the historical resources allocated, etc. The historical characteristic information of the resources allocated to the object and the object attributes of the object can constitute the behavior feature library of the object. The resource allocation trigger action attributes may include but are not limited to the time point corresponding to the time when the object executes the action that triggers resource allocation, the number of times the action is executed, etc.
[0069] In summary, according to the object attributes of the target object, the action attributes of the target action executed by the target object, and the request attributes of the resource allocation request initiated by the target object, the target model call logic matching these attributes can be found, and then the probability model corresponding to the target model call logic can be used as the target probability model. For example, assuming:
[0070] The model call logic L1 corresponding to resource model A is: the object performs the action 50 times, the area where the object is located is area C, and the age range of the object is between 20 and 30 years old.
[0071] The model call logic L2 corresponding to the resource model B is: the object performs actions between 30 and 50 times, the area where the object is located is area D, and the age range of the object is between 30 and 50 years old.
[0072] Assuming that the target object performs the target action 35 times, is in area D, and is 38 years old, it can be determined that the model call logic L2 is the target model call logic that matches the object attributes, resource allocation request attributes, and resource allocation trigger action attributes of the target object, and then the resource model B corresponding to the model call logic L2 can be used as the target resource model.
[0073] Furthermore, when multiple target probability models are found, each target probability model can be run separately to obtain the probability of allocating resources to the target object determined by each target probability model, and among the probabilities determined by each target probability model, the probability that meets the first preset condition is selected as the target probability.
[0074] Specifically, the first preset condition may be: among the obtained probabilities, the maximum probability is used as the target probability. Of course, in practical applications, the first preset condition may be set according to actual needs, and the present disclosure does not limit this. By selecting the probability that meets the first preset condition as the target probability, it is possible to prevent a plurality of different target probabilities from being obtained based on a plurality of target probability models, thereby causing a problem of target probability conflict.
[0075] Step S203: Run the target probability model to determine the target probability of allocating resources to the target object.
[0076] Step S204: if the target probability is within a preset probability range, the designated resources in the resource pool are allocated to the target object, and the resource allocation times of the target object are updated.
[0077] For example, if the target probability is greater than the probability threshold of 0.8, the specified resource in the resource pool can be allocated to the target object, and the number of resource allocations is reduced by 1. The preset probability range can be set according to actual needs.
[0078] In this embodiment, the specified resource to be allocated to the target object can be determined based on the weight of each resource in the resource pool, wherein the higher the weight of the resource, the higher the probability of being allocated to the target object; and the lower the weight of the resource, the lower the probability of being allocated to the target object.
[0079] In summary, in the technical solutions of some embodiments of the present disclosure, when the target object performs the target action, the number of resource allocations of the target object can be determined based on the action conversion logic matching the target action and the object attributes of the target object, and when the target object initiates a resource allocation request, the target probability model for determining the probability of resource allocation can be found, and the target probability model is run to determine the target probability of allocating resources to the target object, and resources are allocated to the target object based on the target probability. Through this implementation process, it can be seen that the scheme of the present disclosure is based on the modularization of program code to perform different functions of resource allocation, for example, the action conversion logic and the probability model are program code modules that are separately set, and the input parameters of these program code modules can be configurable, so that when the business scenario changes, it is only necessary to change the input parameters of these program code modules, without modifying the implementation logic of each program code module based on the business logic, thereby decoupling the business logic and the implementation logic of the resource allocation system, and greatly reducing the code development workload of the resource allocation system.
[0080] In some embodiments, when the target object initiates multiple resource allocation requests, the method of the present disclosure may further include:
[0081] According to the change of the preset target factor, at least when responding to some different resource allocation requests, the target probability model used is different and / or the target probability determined is different, wherein the target factor includes one or more of the following factors:
[0082] The number of resources in the resource pool, the weight of each resource in the resource pool, the object attributes of the target object, the request attributes of the resource allocation request initiated by the target object, and the action attributes of the target action.
[0083] Specifically, this process is related to Figure 1 The contents corresponding to the dynamic probability configuration and the dynamic switching configuration and the related principles are not repeated here.
[0084] By dynamically changing the target probability model or resource allocation probability, business adaptability is improved and the problem of resource allocation probability being solidified can be avoided.
[0085] In some embodiments, after the target object initiates a resource allocation request, the method of the present disclosure may further include:
[0086] Obtaining a pre-configured response time period for a resource allocation request;
[0087] If the current time when the target object initiates the resource allocation request is within the response time period, the resource allocation request is responded to; if the current time when the target object initiates the resource allocation request is not within the response time period, the resource allocation request is rejected.
[0088] For example, suppose that resource allocation requests are only allowed to be initiated between 10 pm and 12 am. If a resource allocation request is received from a target user at 12 pm, the resource allocation request will be rejected; if a resource allocation request is received from a target user at 11 pm, the resource allocation request can be responded to normally.
[0089] In some embodiments, when there are multiple target objects, the method of the present disclosure may further include:
[0090] Comparing the probability difference of the target probabilities corresponding to the multiple target objects, and generating a first alarm when the probability difference is greater than a difference threshold, the first alarm is used to prompt to modify the logic in the target probability model; and / or
[0091] Address identifiers corresponding to multiple target objects are counted, and when the overlap of the address identifiers exceeds an overlap threshold, a second alarm is generated, where the second alarm is used to prompt a detection of the validity of the resource allocation request.
[0092] In this way, the fairness of resource allocation can be guaranteed.
[0093] Specifically, when the probability difference is greater than the difference threshold, by modifying the logic in the target probability model, the resource allocation probabilities generated for each target object can be made similar, thereby ensuring that each target object has the same chance of being allocated resources.
[0094] Specifically, the address identifier can be the IP address of the device used by the target object to initiate a resource allocation request. When the overlap of the address identifiers exceeds the overlap threshold, it is possible that one or more target objects in the same area frequently initiate resource requests through different devices. In this case, most of the resources in the resource pool may be allocated to the target objects in the area. Obviously, this is unfair to the target objects in other areas. Therefore, by detecting the validity of the resource allocation request, the resource allocation requests initiated by some target objects in the same area can be rejected, thereby ensuring the rights and interests of target objects in other areas.
[0095] In some embodiments, when there are multiple target objects, the method of the present disclosure may further include:
[0096] The time points at which multiple target objects initiate resource allocation requests are counted, and corresponding time point distribution is generated. The time point distribution is used to optimize the response time period of the resource allocation request.
[0097] For example, assuming that the current response time period for resource allocation requests is from 3pm to 6pm, but through analysis of time point distribution, it is found that there are more target objects initiating resource allocation requests between 10pm and 12am, and fewer target objects initiating resource allocation requests between 3pm and 6pm, then the response time period for resource allocation requests can be adjusted to 10pm to 12am, so as to ensure that more target objects can participate in resource allocation.
[0098] Combined with reference Figure 3 , which is a schematic diagram of module interaction of a resource allocation method provided in one embodiment of the present disclosure. Figure 3 In the method, the resource allocation method comprises the following steps:
[0099] Step S301: the target object executes the target behavior through the terminal device.
[0100] Step S302: The terminal device triggers the action engine in the resource allocation system to perform action conversion.
[0101] Step S303: the action engine generates a resource allocation count based on the action conversion logic matching the target action and the object attributes of the target object.
[0102] Step S304: the target object initiates a resource allocation request to the resource allocation engine through the terminal device.
[0103] Step S305: the resource allocation engine searches for and runs the target probability model to obtain the target probability.
[0104] Step S306: the resource allocation engine updates the resource allocation times.
[0105] Step S307: The resource allocation engine determines whether to allocate resources based on the target probability.
[0106] Step S308: the resource allocation engine returns the resource allocation result.
[0107] Combined with reference Figure 4 , which is a module diagram of a resource allocation device provided in one embodiment of the present disclosure. Figure 4 In the method, the resource allocation device comprises:
[0108] An action response module 401 is used to determine the number of resource allocations for a target object in response to a target object executing a target action, where the target action is in a pre-configured resource allocation trigger action, based on an action conversion logic matching the target action and an object attribute of the target object;
[0109] The request response module 402 is used to respond to the resource allocation request initiated by the target object and find the target probability model used to determine the resource allocation probability. Different probability models are used to determine the resource allocation probability according to different logics.
[0110] The probability determination module 403 is used to run the target probability model to determine the target probability of allocating resources to the target object;
[0111] The resource allocation module 404 is configured to allocate the specified resources in the resource pool to the target object if the target probability is within a preset probability range, and update the resource allocation times of the target object.
[0112] In some embodiments, each probability model has its own corresponding model calling logic, and the model calling logic is set according to the condition factor, and the condition factor includes one or more of the object attribute, the resource allocation request attribute and the resource allocation trigger action attribute; the request response module 402 is specifically used to:
[0113] Finding a matching target model calling logic according to the object attributes of the target object, the action attributes of the target action executed by the target object, and the request attributes of the resource allocation request initiated by the target object;
[0114] The probability model corresponding to the target model call logic is used as the target probability model.
[0115] In some embodiments, when multiple target probability models are found, the probability determination module 403 is specifically used to:
[0116] Run each target probability model separately to obtain the probability of allocating resources to the target object determined by each target probability model;
[0117] Among the probabilities determined by the various target probability models, the probability that meets the first preset condition is selected as the target probability.
[0118] In some embodiments, when the target object initiates multiple resource allocation requests, the request response module 402 is further configured to:
[0119] According to the change of the preset target factor, at least when responding to some different resource allocation requests, the target probability model used is different and / or the target probability determined is different, wherein the target factor includes one or more of the following factors:
[0120] The number of resources in the resource pool, the weight of each resource in the resource pool, the object attributes of the target object, the request attributes of the resource allocation request initiated by the target object, and the action attributes of the target action.
[0121] In some embodiments, after the target object initiates a resource allocation request, the request response module 402 is further configured to:
[0122] Obtaining a pre-configured response time period for a resource allocation request;
[0123] If the current time when the target object initiates the resource allocation request is within the response time period, the resource allocation request is responded to; if the current time when the target object initiates the resource allocation request is not within the response time period, the resource allocation request is rejected.
[0124] In some embodiments, when there are multiple matching action conversion logics for the target action, the action response module 401 is further configured to:
[0125] Determine the corresponding resource allocation times based on each action conversion logic;
[0126] Among the determined resource allocation times, a target resource allocation time that meets the second preset condition is selected as the resource allocation time of the target object.
[0127] In some embodiments, when there are multiple target objects, the resource allocation module 404 is further configured to:
[0128] Comparing the probability difference of the target probabilities corresponding to the multiple target objects, and generating a first alarm when the probability difference is greater than a difference threshold, the first alarm is used to prompt to modify the logic in the target probability model; and / or
[0129] Counting the time points at which multiple target objects initiate resource allocation requests, and generating corresponding time point distributions, where the time point distributions are used to optimize the response time period of the resource allocation requests; and / or
[0130] Address identifiers corresponding to multiple target objects are counted, and when the overlap of the address identifiers exceeds an overlap threshold, a second alarm is generated, where the second alarm is used to prompt a detection of the validity of the resource allocation request.
[0131] The resource allocation device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0132] The resource allocation device disclosed in the present invention has the same beneficial effects as the above-mentioned resource allocation method, which will not be described in detail here.
[0133] The present disclosure also provides an electronic device having the above Figure 4 The resource allocation device shown.
[0134] Combined with reference Figure 5 , is a schematic diagram of the structure of an electronic device provided by some embodiments of the present disclosure. Figure 5 As shown, the electronic device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the electronic device, including instructions stored in or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple electronic devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 5 A processor 10 is taken as an example.
[0135] The processor 10 may be a first PCIe device, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0136] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0137] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0138] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0139] The electronic device further comprises a communication interface 30 for the electronic device to communicate with other devices or a communication network.
[0140] The embodiments of the present disclosure also provide a computer-readable storage medium. The above-mentioned method according to the embodiments of the present disclosure can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium and downloaded through a network, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state drive, etc.; further, the storage medium can also include a combination of the above-mentioned types of memory. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0141] A part of the present disclosure may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present disclosure through the operation of the computer. Those skilled in the art should understand that the existence of computer program instructions in computer-readable media includes, but is not limited to, source files, executable files, installation package files, etc., and accordingly, the way in which computer program instructions are executed by a computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to the computer.
[0142] Although the embodiments of the present disclosure have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present disclosure, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A resource allocation method, characterized in that: The method comprises: In response to a target object executing a target action, and the target action being in a pre-configured resource allocation trigger action, determining a resource allocation count for the target object based on an action conversion logic matching the target action and an object attribute of the target object; In response to the target object initiating a resource allocation request, searching for a target probability model for determining a resource allocation probability, where different probability models are used to determine the resource allocation probability according to different logics; Running the target probability model to determine the target probability of allocating resources to the target object; If the target probability is within a preset probability range, the designated resources in the resource pool are allocated to the target object, and the resource allocation times of the target object are updated.
2. The method according to claim 1, characterized in that Each of the probability models has a corresponding model calling logic, and the model calling logic is set according to a condition factor, and the condition factor includes one or more of an object attribute, a resource allocation request attribute, and a resource allocation trigger action attribute; The step of searching, in response to the target object initiating a resource allocation request, a target probability model for determining a resource allocation probability comprises: Finding a matching target model calling logic according to the object attribute of the target object, the action attribute of the target action executed by the target object, and the request attribute of the resource allocation request initiated by the target object; The probability model corresponding to the logic of the target model call is used as the target probability model.
3. The method according to claim 2, characterized in that In the case where multiple target probability models are found, the step of running the target probability model to determine the target probability of allocating resources to the target object includes: Running each of the target probability models respectively to obtain the probability of allocating resources to the target object determined by each of the target probability models; Among the probabilities determined by the target probability models, a probability that meets the first preset condition is selected as the target probability.
4. The method according to claim 1, characterized in that: In the case where the target object initiates multiple resource allocation requests, the method further includes: According to the change of the preset target factor, at least when responding to some different resource allocation requests, the target probability model used is different and / or the target probability determined is different, wherein the target factor includes one or more of the following factors: The number of resources in the resource pool, the weight of each resource in the resource pool, the object attributes of the target object, the request attributes of the resource allocation request initiated by the target object, and the action attributes of the target action.
5. The method according to claim 1, characterized in that After the target object initiates the resource allocation request, the method further includes: Obtaining a preconfigured response time period for the resource allocation request; If the current time when the target object initiates the resource allocation request is within the response time period, the resource allocation request is responded to; if the current time when the target object initiates the resource allocation request is not within the response time period, the resource allocation request is rejected.
6. The method according to claim 1, characterized in that In the case where the target action has multiple matching action conversion logics, the method further includes: Determine the corresponding resource allocation times based on each of the action conversion logics; Among the determined resource allocation times, a target resource allocation time that meets the second preset condition is selected as the resource allocation time of the target object.
7. The method according to claim 1, characterized in that In the case where there are multiple target objects, the method further includes: comparing the probability differences of the target probabilities corresponding to the multiple target objects, and generating a first alarm when the probability difference is greater than a difference threshold, wherein the first alarm is used to prompt modification of the logic in the target probability model; and / or Counting the time points at which the multiple target objects initiate resource allocation requests, and generating corresponding time point distributions, wherein the time point distributions are used to optimize the response time period of the resource allocation requests; and / or The address identifiers corresponding to the multiple target objects are counted, and when the overlap of the address identifiers exceeds an overlap threshold, a second alarm is generated, wherein the second alarm is used to prompt a detection of the validity of the resource allocation request.
8. A resource allocation device, characterized in that: The device comprises: An action response module, configured to respond to a target object executing a target action, wherein the target action is in a pre-configured resource allocation trigger action, and determine a resource allocation count for the target object based on an action conversion logic matching the target action and an object attribute of the target object; A request response module, configured to respond to the resource allocation request initiated by the target object and search for a target probability model for determining the resource allocation probability, wherein different probability models are used to determine the resource allocation probability according to different logics; A probability determination module, used to run the target probability model to determine the target probability of allocating resources to the target object; The resource allocation module is used to allocate the specified resources in the resource pool to the target object if the target probability is within a preset probability range, and update the resource allocation times of the target object.
9. An electronic device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the resource allocation method according to any one of claims 1 to 7 by executing the computer instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the resource allocation method according to any one of claims 1 to 7.