Resource allocation processing method and device, medium and program product
By constructing a resource allocation tree and determining the resource value to be allocated for each node based on node attributes and order resource values, the problem of low flexibility in resource allocation scenarios is solved and efficient resource allocation processing is achieved.
Patent Information
- Application Number
- CN202510692103.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-27
- Publication Date
- 2025-09-19
AI Technical Summary
In the prior art, when the resource allocation ratio or relationship in a resource allocation scenario changes, the code needs to be rewritten, resulting in low flexibility.
By constructing a resource allocation tree, which includes multiple resource allocation nodes, each node has pre-set attributes, and the resource value to be allocated of each node is determined according to the node attributes and the resource value of the order to be allocated, resource allocation processing is realized.
It improves the flexibility and efficiency of resource allocation, clearly presents the resource allocation relationship between nodes, and eliminates the need for frequent rewriting of code.
Smart Images

Figure CN120672027A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data processing technology, and in particular to a resource allocation processing method, device, medium, and program product. Background Art
[0002] In order scenarios, resource allocation is a common scenario requirement. For example, in a house buying and selling scenario, the relevant payment resources for the order are allocated.
[0003] In the related art, multiple resource allocators for each order are determined in advance, the resource allocation relationship and resource allocation ratio of the multiple resource allocators are determined, resource allocation code is written based on the resource allocation relationship and resource allocation ratio, and resources are allocated and processed based on the written resource allocation code.
[0004] However, the above-mentioned method of allocating resources by writing code cannot meet the scenario changes in resource allocation scenarios. For example, when the resource allocation ratio or resource allocation relationship in the resource allocation scenario changes, the resource allocation code needs to be rewritten, resulting in low flexibility in resource allocation. Summary of the Invention
[0005] In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides a resource allocation processing method, device, medium and program product.
[0006] An embodiment of the present disclosure provides a resource allocation processing method, which includes the following steps: in response to obtaining a resource allocation instruction for a target order, determining the order resource value to be allocated corresponding to the resource allocation instruction; obtaining a pre-generated resource allocation tree corresponding to the target order, wherein the resource allocation tree includes multiple resource allocation nodes, and each resource allocation node is pre-set with corresponding node attributes; determining the node resource value to be allocated of each resource allocation node based on the node attributes of each resource allocation node and the order resource value to be allocated; and performing resource allocation processing on each resource allocation node based on the node resource value to be allocated of each resource allocation node.
[0007] An embodiment of the present disclosure also provides a resource allocation processing device, which includes: a first determination module, used to determine the order resource value to be allocated corresponding to the resource allocation instruction in response to obtaining the resource allocation instruction for the target order; an acquisition module, used to obtain a pre-generated resource allocation tree corresponding to the target order, wherein the resource allocation tree includes multiple resource allocation nodes, and each resource allocation node is pre-set with corresponding node attributes; a second determination module, used to determine the node resource value to be allocated of each resource allocation node based on the node attributes of each resource allocation node and the order resource value to be allocated; an allocation processing module, used to perform resource allocation processing on each resource allocation node based on the node resource value to be allocated of each resource allocation node.
[0008] An embodiment of the present disclosure also provides an electronic device, comprising: a processor; a memory for storing instructions executable by the processor; the processor is configured to read the executable instructions from the memory and execute the instructions to implement the resource allocation processing method provided in the embodiment of the present disclosure.
[0009] An embodiment of the present disclosure further provides a computer-readable storage medium, wherein the storage medium stores a computer program, and the computer program is used to execute the resource allocation processing method provided in the embodiment of the present disclosure.
[0010] An embodiment of the present disclosure further provides a computer program product, including a computer program, which implements the above-mentioned resource allocation processing method when executed by a processor.
[0011] The technical solution provided by the embodiments of the present disclosure has the following advantages over the prior art:
[0012] The resource allocation processing scheme provided by the embodiment of the present disclosure is responsive to obtaining a resource allocation instruction for a target order, determining the resource value of the order to be allocated corresponding to the resource allocation instruction, and obtaining a pre-generated resource allocation tree corresponding to the target order, wherein the resource allocation tree contains a plurality of resource allocation nodes, each resource allocation node is pre-set with corresponding node attributes, and then, based on the node attributes of each resource allocation node and the resource value of the order to be allocated, the node resource value to be allocated of each resource allocation node is determined, and resource allocation processing is performed on each resource allocation node based on the node resource value to be allocated of each resource allocation node. In this technical solution, resource allocation is performed in the form of a resource allocation tree that can flexibly adjust node attributes and resource allocation nodes, thereby improving the flexibility of resource allocation, and the resource allocation tree clearly presents the resource allocation relationship between each resource allocation node, thereby improving the efficiency of resource allocation. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] The above and other features, advantages, and aspects of the various embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that the originals and elements are not necessarily drawn to scale.
[0014] Figure 1 A flowchart of a resource allocation processing method provided by an embodiment of the present disclosure;
[0015] Figure 2 A schematic diagram of a resource allocation tree provided in an embodiment of the present disclosure;
[0016] Figure 3 A schematic diagram of another resource allocation tree provided in an embodiment of the present disclosure;
[0017] Figure 4 A flowchart of another resource allocation processing method provided by an embodiment of the present disclosure;
[0018] Figure 5 A schematic diagram of another resource allocation tree provided in an embodiment of the present disclosure;
[0019] Figure 6 A flowchart of another resource allocation processing method provided by an embodiment of the present disclosure;
[0020] Figure 7 A schematic diagram of the structure of a resource allocation processing device provided in an embodiment of the present disclosure;
[0021] Figure 8 A schematic structural diagram of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0022] The following describes embodiments of the present disclosure in more detail 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 limited to the embodiments described herein. Rather, 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 for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure.
[0023] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0024] As used herein, the term "including" and its variations are open-ended, i.e., "including but not limited to." The term "based on" means "based, at least in part, on." The term "one embodiment" means "at least one embodiment," the term "another embodiment" means "at least one additional embodiment," and the term "some embodiments" means "at least some embodiments." Other terms are defined in the following description.
[0025] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0026] It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, they should be understood as "one or more".
[0027] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0028] In order to solve the above problems, an embodiment of the present disclosure provides a resource allocation processing method, in which multiple resource allocators included in each target order are determined, each resource allocator is regarded as a resource allocation node, and a resource allocation tree is constructed based on the resource allocation relationship between the resource allocation nodes. The resource allocation tree restores the resource allocation relationship between the various resource allocation nodes of the order, and the resource allocation tree can flexibly add and delete resource allocation nodes, and the node attributes can also be flexibly adjusted, which meets various changes in resource allocation scenarios and improves the flexibility of resource allocation.
[0029] The method is described below with reference to specific embodiments.
[0030] Figure 1 This is a flow chart of a resource allocation processing method provided by an embodiment of the present disclosure. The method can be executed by a resource allocation processing device, wherein the device can be implemented using software and / or hardware and can generally be integrated into an electronic device, wherein the electronic device can be a device installed on any resource allocation platform. Figure 1 As shown, the method includes:
[0031] Step 101: In response to obtaining a resource allocation instruction for a target order, determine a resource value of the order to be allocated corresponding to the resource allocation instruction.
[0032] In one embodiment of the present disclosure, a resource allocation instruction for a target order is obtained, wherein the method of generating the target resource allocation instruction may vary according to different scenarios: for example, it may be generated when the received order resource value is obtained, or it may be generated after monitoring that the target order meets the resource allocation trigger condition, wherein the resource allocation trigger condition may include: the generation time of the target order reaches a preset time threshold, the current order stage of the target order has reached a preset stage, etc. The specific resource allocation trigger condition may be pre-defined in the resource allocation scenario.
[0033] In response to obtaining the resource allocation instruction for the target order, the to-be-allocated order resource value corresponding to the resource allocation instruction is determined, wherein the resources corresponding to the to-be-allocated order resource value include any form of resources such as payment amount, payment virtual currency, etc., which are not listed here one by one.
[0034] Among them, if the resource allocation of the same target order is divided into multiple times (for example, multiple payment scenarios for a house transaction order), the order resource value to be allocated can be the currently obtained payment resource value. Of course, if the currently obtained payment resource value is greater than the remaining to-be-paid resource value of the target order, the remaining to-be-paid resource value can be used as the order resource value to be allocated corresponding to the resource allocation instruction.
[0035] It should be emphasized that the target order in the embodiment of the present disclosure can be one or more. When the resource allocation relationships corresponding to multiple target orders are the same, the resource allocation method of the resource allocation tree in the following embodiment can be used to achieve the combined resource allocation of multiple target orders. Whether multiple target orders are combined for resource allocation, or one target order is allocated separately, the corresponding resource allocation tree is the same, only the corresponding to-be-allocated order resource value may be the to-be-allocated order resource value of a target order, or the total to-be-allocated order resource value after the multiple target orders are combined.
[0036] Step 102: Obtain a pre-generated resource allocation tree corresponding to the target order, wherein the resource allocation tree includes a plurality of resource allocation nodes, and each resource allocation node is pre-set with a corresponding node attribute.
[0037] In an embodiment of the present disclosure, multiple resource allocation nodes corresponding to a target order are obtained, where each resource allocation node corresponds to a resource allocator. The resource allocation relationship among the multiple resource allocation nodes is determined, and node attributes of each resource allocation node are determined. The node attributes are related to the resource allocation scenario and include, but are not limited to, at least one of a resource allocation ratio and a node resource allocation threshold. The node resource allocation threshold may be the total resource value that the resource node needs to obtain for the target order. The node attributes of each node can be set based on the resource allocation scenario.
[0038] Furthermore, multiple resource allocation nodes are connected according to the resource allocation relationship, and node attributes of each resource node are set to generate a resource allocation tree.
[0039] For example, when the resource allocation nodes of the target order include: A, B, C, and D, when A obtains the resource value of the order to be allocated, for example, the resource value of the order to be allocated is 1,000 yuan, then A should pay B 800 yuan for item A, and A should pay C 200 yuan for item B. After B receives 800 yuan, it should pay C 50 yuan for item C and D 33 yuan for item D. The resource allocation tree generated based on the resource allocation relationship between the above resource allocation nodes can be as follows: Figure 2 shown.
[0040] In this embodiment, if each resource allocation node also allocates relevant resources to itself (for example, in a house buying and selling scenario, when the intermediary node receives the payment resources from the buyer, in addition to allocating payment resources to the seller node, it also needs to extract a portion of the commission payment resources), then according to the resource allocation scenario, the next-level resource allocation node of some resource allocation nodes also includes the resource allocation node itself. For example, when A obtains the value of the order resources to be allocated, for example, a value of 1,000 yuan of order resources to be allocated, then A should pay A and B 400 yuan for item A and item B respectively, and A should pay C 200 yuan for item B. After B receives 800 yuan, it should pay C 50 yuan for item C, 33 yuan for item D to D, and 300 yuan to B. The resource allocation tree generated according to the resource allocation relationship between the above resource allocation nodes can be as follows: Figure 3 shown.
[0041] When the resource allocation relationship between resource allocation nodes is reflected in the resource allocation tree, the resource allocation nodes can be flexibly added or deleted according to the needs of the scenario, thereby eliminating the need to rebuild the resource allocation each time, greatly improving the flexibility of resource allocation.
[0042] In one embodiment of the present disclosure, in response to obtaining a deletion instruction for the first resource allocation node in the resource allocation tree, the first resource allocation node in the resource allocation tree is deleted, wherein the deletion instruction can be automatically triggered after detecting that the resource allocation node of the target order is reduced, or can be actively triggered by relevant personnel at the resource allocation node, etc.
[0043] In one embodiment of the present disclosure, in response to obtaining an instruction to add a second resource allocation node to a resource allocation tree, obtaining the node attributes of the second resource allocation node, adding the second resource allocation node to the resource allocation tree, and setting the node attributes of the second resource allocation node, the resource allocation relationship between the second resource allocation node and other existing resource allocation nodes can be determined in the resource allocation scenario, the specific position in the resource allocation tree can be determined based on the resource allocation relationship, and the second resource allocation node can be added to the specific position. The addition instruction can be automatically triggered after detecting the addition of a resource allocation node for a target order, or can be actively triggered by relevant personnel at the resource allocation node, etc.
[0044] Therefore, in this embodiment, the addition and deletion operations of resource allocation nodes in the resource allocation scenario are supported without rebuilding the resource allocation tree, thereby improving the resource allocation efficiency while meeting the flexible changes of resource allocation nodes in the resource allocation scenario.
[0045] During actual implementation, the need for flexible adjustment of resource allocation attributes in resource allocation scenarios can also be met. In one embodiment of the present disclosure, in response to obtaining a node attribute modification instruction for a third resource allocation node in a resource allocation tree, node attribute modification information corresponding to the node attribute modification instruction is obtained, wherein the node attribute modification information is determined based on the resource allocation scenario (for example, it can be determined based on a resource allocation contract, etc.), and then the node attribute of the third resource allocation node is modified based on the node attribute modification information. In this embodiment, the node attribute information of the resource allocation node can be flexibly modified without changing the structure of the resource allocation tree.
[0046] Step 103 : determining the node resource value to be allocated of each resource allocation node according to the node attribute of each resource allocation node and the value of the order resource to be allocated.
[0047] Step 104 : performing resource allocation processing on each resource allocation node according to the node resource value to be allocated of each resource allocation node.
[0048] In this embodiment, the node resource value to be allocated of each resource allocation node can be determined based on the node attributes of each resource allocation node and the resource value of the order to be allocated, and then, resource allocation processing can be performed on each resource allocation node based on the node resource value to be allocated of each resource allocation node. Thus, resource allocation can be achieved through the resource allocation tree without writing code, and in the above embodiment, whether the target order is allocated resources once or multiple times, it can be satisfied. Compared with the way of writing code, it is necessary to determine in advance whether the resource allocation is once or multiple times. Furthermore, if it is multiple times, since the proportion and other values of each resource allocation are different, it is necessary to write corresponding resource allocation code for each resource allocation. The embodiment provided by the present disclosure can meet the demand for resource allocation more efficiently.
[0049] It should be noted that in different application scenarios, the resource allocation processing method for each resource allocation node is different according to the node resource value to be allocated of each resource allocation node. Examples are as follows:
[0050] In some possible examples, if payment is made level by level along the resource allocation path in the resource allocation tree, the corresponding order resource value to be allocated can be sent to the resource allocation node at the first level, and the nodes at the first level can be notified to send the corresponding node resource value to be allocated to the resource allocation node at the second level. The resource allocation node at the third level can then be notified to send the corresponding node resource value to be allocated to the resource allocation node at the fourth level.
[0051] In some possible instances, if payment is not made step by step according to the resource allocation path in the above-mentioned resource allocation tree, the corresponding node resource values to be allocated are directly allocated by the resource allocation nodes of the first level. The corresponding order resource values to be allocated can be sent to the resource allocation nodes of the first level, the sum of the node resource values to be allocated of each resource allocation node can be calculated, and the nodes of the first level can be notified to allocate the corresponding sum of the node resource values to be allocated to each resource allocation node.
[0052] In summary, the resource allocation processing method of the embodiment of the present disclosure, in response to obtaining a resource allocation instruction for a target order, determines the resource value of the order to be allocated corresponding to the resource allocation instruction, obtains a pre-generated resource allocation tree corresponding to the target order, wherein the resource allocation tree contains multiple resource allocation nodes, each resource allocation node is pre-set with corresponding node attributes, and then, based on the node attributes of each resource allocation node and the resource value of the order to be allocated, determines the node resource value to be allocated of each resource allocation node, and performs resource allocation processing on each resource allocation node based on the node resource value to be allocated of each resource allocation node. In this technical solution, resource allocation is performed in the form of a resource allocation tree in which node attributes and resource allocation nodes can be flexibly adjusted, thereby improving the flexibility of resource allocation, and the resource allocation tree clearly presents the resource allocation relationship between each resource allocation node, thereby improving the efficiency of resource allocation.
[0053] The following describes how to determine the node resource value to be allocated of each resource allocation node based on the node attributes of each resource allocation node and the value of the order resource to be allocated, with reference to a specific embodiment:
[0054] In one embodiment of the present disclosure, the node attributes include: resource allocation ratio, wherein the sum of the resource allocation ratios between all resource allocation nodes at the same level can be 1 or less than 1. The specific resource allocation ratio can be set according to the resource allocation scenario.
[0055] In this embodiment, if Figure 4 As shown, according to the node attributes of each resource allocation node and the value of the order resources to be allocated, the node resource value to be allocated of each resource allocation node is determined, including:
[0056] Step 401: determine whether the target order meets the preset allocation end condition based on the resource value of the order to be allocated, wherein the preset allocation end condition is used to verify whether the target order completes the resource allocation event after completing the allocation of the resource value of the order to be allocated.
[0057] The preset allocation end condition verifies whether the target order has completed resource allocation after the allocation of the pending order's resource value has been completed. In other words, the preset allocation end condition verifies that all resource allocations to the target order have been completed after the pending order's resource value has been allocated. For example, in a property payment scenario, the preset allocation end condition verifies whether all payment items for the property have been completed after the pending order's resource value has been allocated.
[0058] In some possible embodiments, an order resource allocation threshold corresponding to the target order can be obtained. The order resource allocation threshold is the total value of all resources to be allocated for the pre-agreed target order. For example, in a housing order payment scenario, if the agreed payment is 1 million, then 1 million is the order resource allocation threshold.
[0059] In this embodiment, the allocated order resource value corresponding to the target order is determined, wherein the allocated order resource value can be updated and stored after each allocation of the order resource value to be allocated, and the second difference between the order resource allocation threshold and the allocated order resource value is calculated to determine whether the order resource value to be allocated is greater than or equal to the second difference, wherein, when it is greater than or equal to the second difference, it is determined that the target order meets the preset allocation end condition, that is, when the order resource value to be allocated is greater than or equal to the second difference, it indicates that the order resource value to be allocated is sufficient to cover the remaining order resource value to be allocated of the target order, thereby determining that the target order meets the preset allocation end condition.
[0060] Of course, in other possible embodiments, the preset allocation end condition may also include other content, and the specific preset allocation end condition may be set according to the needs of the resource allocation scenario.
[0061] In this embodiment, whether the target order meets the preset allocation end condition is determined according to the resource value of the order to be allocated, that is, whether the resource value of the order to be allocated is the last resource allocation for the target order is determined.
[0062] Step 402 : In response to not meeting the preset allocation termination condition, determining the node resource value to be allocated of each resource allocation node in the resource allocation tree according to the resource allocation ratio of each resource allocation node and the resource value of the order to be allocated.
[0063] In response to the preset allocation end condition not being met, the node resource value to be allocated of each resource allocation node in the resource allocation tree is determined based on the resource allocation ratio and the order resource value to be allocated of each resource allocation node, wherein the product value of the resource allocation ratio and the total node resource value allocated by the node of the previous level can be calculated to obtain the node resource value to be allocated of each resource allocation node.
[0064] For example, the resource allocation tree corresponding to the target order includes resource allocation nodes E, F, G, and H, where the resource allocation trees corresponding to E, F, G, and H are as follows: Figure 5As shown, the resource allocation ratios corresponding to the second-level resource allocation nodes E, F, and G are 30%, 50%, and 20%, respectively; the resource allocation ratios corresponding to the third-level resource allocation nodes F and H are 30% and 70%, respectively. If the first-level resource allocation node E obtains 100 yuan, the node resource values to be allocated corresponding to the second-level resource allocation nodes E, F, and G are 30%*100 yuan, 50%*100 yuan, and 20%*100 yuan, respectively; the node resource values to be allocated corresponding to the third-level resource allocation nodes F and H are 50%*100*30% and 50%*100*70%, respectively.
[0065] In some possible embodiments, when the node attributes further include a node resource allocation threshold, continue to refer to the above Figure 4 , the method further comprises:
[0066] Step 403: In response to the preset allocation end condition being met, the allocated node resource value of each resource allocation node is obtained.
[0067] In this embodiment, in response to meeting the preset allocation end condition, that is, the order resource value to be allocated is the last resource allocation for the target order, in order to ensure the accurate allocation of resource values, the allocated node resource value of each resource allocation node is obtained.
[0068] Step 404: Calculate a first difference between the node resource allocation threshold and the allocated node resource value.
[0069] Step 405: Determine the first difference as the node resource value to be allocated for each resource allocation node.
[0070] In this embodiment, a first difference between the node resource allocation threshold and the allocated node resource value is calculated, and the first difference is determined as the node resource value to be allocated for each resource allocation node. That is, during the final allocation, the node resource value to be allocated for each resource allocation node is determined directly by taking the difference, thereby avoiding the problem of misalignment between the actual allocated resource value and the allocated resource value (especially in reconciliation scenarios, where this misalignment is of great concern).
[0071] Continue with the above Figure 5 Taking the scenario shown as an example, the resource allocation tree corresponding to the target order includes resource allocation nodes E, F, G, and H, and their corresponding node resource allocation thresholds are 1,000 yuan, 500 yuan, 200 yuan, and 100 yuan, respectively. If the allocated node resource values of E, F, G, and H are 980 yuan, 480 yuan, 180 yuan, and 60 yuan, respectively, then the calculated node resource values to be allocated corresponding to the resource allocation nodes E, F, G, and H are: 1,000-980=20 yuan, 500-480=20 yuan, 200-180=20 yuan, and 100-60=40 yuan, respectively.
[0072] It should be emphasized that when allocating resources for the target order for the last time, the Figure 5 The tree structure shown is not used to determine the value of the node resources to be allocated, but the tail difference (the difference between the total node resource allocation threshold that needs to be allocated and the allocated node resource value) is directly used to determine the value of the node resources to be allocated. The method of determining the value of the node resources to be allocated is independent of the tree structure.
[0073] In one embodiment of the present disclosure, considering that in some resource allocation scenarios, the preset value conditions of the node resource value to be allocated will be fixed, for example, the preset value conditions include: the number of decimal places is not greater than the preset number of decimal places, for example, the number of decimal places is not greater than 0 (that is, it can only be rounded), and for example, the preset value conditions include: the value cannot be an odd number, etc., then in order to meet the scenario requirements, after the node resource value to be allocated is calculated, the node resource value to be allocated is subjected to data processing to ensure that the node resource value to be allocated after the data processing is completed meets the preset data conversion conditions.
[0074] In this embodiment, the resource allocation tree also includes a fourth resource allocation node, and the next layer of resource allocation nodes connected to the fourth resource allocation node includes a corresponding fourth resource allocation node, that is, the structure of the resource allocation tree refers to Figure 3 , the resource allocation nodes of the next level of the fourth resource allocation nodes A and B also include the fourth resource allocation node itself, then Figure 6 As shown, after determining the node resource value to be allocated of each resource allocation node according to the node attribute of each resource allocation node and the value of the order resource to be allocated, the method further includes:
[0075] Step 601: Determine the sum of all to-be-allocated node resource values corresponding to the next layer of resource allocation nodes to obtain the sum of reference node resources.
[0076] In this embodiment, the sum of all to-be-allocated node resource values corresponding to the next layer of resource allocation nodes connected to the fourth resource allocation node is determined to obtain the sum of the reference node resources. Figure 3 In the example, A will allocate the sum of all the node resource values to be allocated corresponding to the second-layer resource allocation nodes A, B, and C.
[0077] Step 602: Identify whether the node resource value to be allocated of each resource allocation node except the fourth resource allocation node in the next layer of resource allocation nodes meets a preset value condition.
[0078] In an embodiment of the present disclosure, it is identified whether the to-be-allocated node resource value of each other resource allocation node in the next layer of resource allocation nodes except the fourth resource allocation node meets the preset value conditions, for example, it is identified that the number of decimal places of the to-be-allocated node resource values corresponding to B and C is not greater than the preset number of decimal places.
[0079] Step 603 : performing data processing on the resource values of the nodes to be allocated that do not meet the preset value conditions, wherein the resource values of the nodes to be allocated after the data processing meet the preset value conditions.
[0080] In this embodiment, data processing is performed on the node resource values to be allocated that do not meet the preset value conditions, wherein the node resource values to be allocated after data processing meet the preset value conditions. For example, among the node resource values to be allocated that are greater than the preset number of decimal places, the values after the preset number of decimal places are deleted. For example, the node resource value to be allocated corresponding to B is 3.5, and the preset value condition is that the number of decimal places is not greater than 0. Therefore, the "5" after 3.5 can be deleted, and the node resource value to be allocated corresponding to B can be updated to 3 to complete the data processing.
[0081] Step 604 : After data processing, the sum of the to-be-allocated node resource values corresponding to the next layer of resource allocation nodes is calculated to obtain the sum of actual node resources.
[0082] In this embodiment, after data processing, the sum of the node resource values to be allocated corresponding to the next layer of resource allocation nodes is calculated to obtain the sum of the actual node resources. That is, since the above processing may lose some values, in order to ensure the subsequent allocation traceability of resource values, it is necessary to determine how many node resources are actually allocated.
[0083] Step 605: Calculate a third difference between the sum of the reference node resources and the sum of the actual node resources.
[0084] The third difference value is a resource value that may not be actually allocated during data processing.
[0085] Step 606: Update the node resource value to be allocated of the fourth resource allocation node in the next layer of resource allocation nodes to the sum of the node resource to be allocated of the fourth resource allocation node in the next layer of resource allocation nodes and the third difference.
[0086] In this embodiment, the sum of the node resources to be allocated and the third difference of the fourth resource allocation node in the next layer of resource allocation nodes is calculated, and the node resource value to be allocated of the fourth resource allocation node in the next layer of resource allocation nodes is updated to the sum of the node resources to be allocated and the third difference of the fourth resource allocation node. That is, the resource values that other resource allocation nodes other than the fourth resource allocation node in the next layer of resource allocation nodes do not participate in the actual allocation are compensated to the fourth resource allocation node itself. For example, the "0.5" corresponding to the above B is compensated to A at the same node level to avoid the resource value of "0.5" not participating in the allocation scenario. This ensures the traceability of subsequent resource value allocation, avoids the problem of resource value reconciliation being unable to align, and ensures the accuracy of resource value allocation.
[0087] In summary, the resource allocation processing method of the embodiment of the present disclosure can flexibly calculate the node resource value to be allocated of each resource allocation node, and ensure the allocation accuracy of the relevant resource values after calculating the node resource value to be allocated.
[0088] In order to implement the above embodiments, the present disclosure also proposes a resource allocation processing device. Figure 7 This is a schematic diagram of the structure of a resource allocation processing device provided by an embodiment of the present disclosure. The device can be implemented by software and / or hardware and can generally be integrated into an electronic device. Figure 7 As shown, the device includes: a first determination module 710, an acquisition module 720, a second determination module 730, and an allocation processing module 740, wherein:
[0089] A first determining module 710 is configured to, in response to obtaining a resource allocation instruction for a target order, determine a to-be-allocated order resource value corresponding to the resource allocation instruction;
[0090] An acquisition module 720 is configured to acquire a pre-generated resource allocation tree corresponding to the target order, wherein the resource allocation tree includes a plurality of resource allocation nodes, and each resource allocation node is pre-set with corresponding node attributes;
[0091] The second determining module 730 is configured to determine the node resource value to be allocated of each resource allocation node according to the node attribute of each resource allocation node and the value of the order resource to be allocated;
[0092] The allocation processing module 740 is configured to perform resource allocation processing on each resource allocation node according to the node resource value to be allocated of each resource allocation node.
[0093] In one embodiment of the present disclosure, the present invention further includes: a resource allocation tree construction module, which is used to:
[0094] Acquire multiple resource allocation nodes corresponding to the target order, determine the resource allocation relationship of the multiple resource allocation nodes, and determine the node attributes of each resource allocation node;
[0095] A plurality of resource allocation nodes are connected according to a resource allocation relationship, and node attributes of each resource node are set to generate a resource allocation tree.
[0096] In one embodiment of the present disclosure, the resource allocation tree construction module is further configured to:
[0097] In response to obtaining a deletion instruction for the first resource allocation node in the resource allocation tree, deleting the first resource allocation node in the resource allocation tree; and / or,
[0098] In response to obtaining an instruction to add a second resource allocation node in the resource allocation tree, obtaining a node attribute of the second resource allocation node,
[0099] A second resource allocation node is added to the resource allocation tree, and node attributes of the second resource allocation node are set.
[0100] In one embodiment of the present disclosure, the resource allocation tree construction module is further configured to: in response to obtaining a node attribute modification instruction for a third resource allocation node in the resource allocation tree, obtain node attribute modification information corresponding to the node attribute modification instruction;
[0101] The node attribute of the third resource allocation node is modified according to the node attribute modification information.
[0102] In one embodiment of the present disclosure, the resource allocation tree construction module is further configured to:
[0103] In one embodiment of the present disclosure, the node attributes include: resource allocation ratio, and the second determination module 730 is configured to:
[0104] Determine whether the target order meets the preset allocation end condition based on the resource value of the order to be allocated, wherein the preset allocation end condition is used to verify whether the target order completes the resource allocation event after completing the allocation of the resource value of the order to be allocated;
[0105] In response to not meeting the preset allocation end condition, the node resource value to be allocated of each resource allocation node in the resource allocation tree is determined according to the resource allocation ratio of each resource allocation node and the resource value of the order to be allocated.
[0106] In one embodiment of the present disclosure, the node attributes further include: a node resource allocation threshold; the second determining module 730 is further configured to:
[0107] In response to a preset allocation end condition being met, obtaining an allocated node resource value of each resource allocation node;
[0108] Calculating a first difference between a node resource allocation threshold and an allocated node resource value;
[0109] The first difference is determined as the node resource value to be allocated of each resource allocation node.
[0110] In one embodiment of the present disclosure, the second determining module 730 is further configured to:
[0111] Obtain the order resource allocation threshold corresponding to the target order, and determine the allocated order resource value corresponding to the target order;
[0112] Calculating a second difference between the order resource allocation threshold and the allocated order resource value;
[0113] Determine whether the resource value of the order to be allocated is greater than or equal to the second difference, wherein when it is greater than or equal to the second difference, determine that the target order meets the preset allocation end condition.
[0114] In one embodiment of the present disclosure, the resource allocation tree further includes a fourth resource allocation node, wherein the resource allocation nodes in the next layer connected to the fourth resource allocation node include a corresponding fourth resource allocation node, and the apparatus further includes: a data updating module configured to:
[0115] Determine the sum of all to-be-allocated node resource values corresponding to the next layer of resource allocation nodes connected to the fourth resource allocation node to obtain the sum of reference node resources;
[0116] Identify whether the node resource value to be allocated of each other resource allocation node in the next layer of resource allocation nodes except the fourth resource allocation node meets the preset value condition;
[0117] Performing data processing on the resource values of the nodes to be allocated that do not meet the preset value conditions, wherein the resource values of the nodes to be allocated after the data processing meet the preset value conditions;
[0118] After data processing, the sum of the node resource values to be allocated corresponding to the next layer of resource allocation nodes is calculated to obtain the sum of the actual node resources;
[0119] Calculating a third difference between the sum of the reference node resources and the sum of the actual node resources;
[0120] The node resource value to be allocated of the fourth resource allocation node in the next layer of resource allocation nodes is updated to the sum of the node resource to be allocated of the fourth resource allocation node in the next layer of resource allocation nodes and the third difference value.
[0121] In one embodiment of the present disclosure, the preset value condition includes: the number of decimal places is not greater than the preset number of decimal places; the data updating module is specifically configured to:
[0122] Among the node resource values to be allocated that have more than the preset number of decimal places, the values after the preset number of decimal places are deleted.
[0123] The resource allocation processing device provided in the embodiments of the present disclosure can execute the resource allocation processing method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0124] In order to implement the above embodiments, the present disclosure further proposes a computer program product, including a computer program / instruction, which implements the resource allocation processing method in the above embodiments when executed by a processor.
[0125] An embodiment of the present disclosure provides an electronic device, which includes: a memory on which a computer program is stored; and a processor for executing the computer program in the memory to implement the steps of any method in the present disclosure.
[0126] Figure 8 A schematic structural diagram of an electronic device provided in an embodiment of the present disclosure.
[0127] The following specific reference Figure 8 , which shows a schematic structural diagram of an electronic device 800 suitable for implementing the embodiments of the present disclosure. The electronic device 800 in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 8 The electronic device shown is only an example and should not limit the functions and scope of use of the embodiments of the present disclosure.
[0128] like Figure 8 As shown, the electronic device 800 may include a processor (e.g., a central processing unit, a graphics processing unit, etc.) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a memory 808 into a random access memory (RAM) 803. Various programs and data required for the operation of the electronic device 800 are also stored in the RAM 803. The processor 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0129] Typically, the following devices may be connected to the I / O interface 805: an input device 806 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 807 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a memory 808 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 809. The communication device 809 may allow the electronic device 800 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 8 The electronic device 800 is shown with various devices, but it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed instead.
[0130] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program carried on a non-transitory computer-readable medium, the computer program including program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network via the communication device 809, or installed from the memory 808, or installed from the ROM 802. When the computer program is executed by the processor 801, the above-mentioned functions defined in the resource allocation processing method of the embodiment of the present disclosure are performed.
[0131] In addition to the above-mentioned methods and devices, the embodiments of the present disclosure may also be a computer program product, which includes computer program instructions, which, when executed by a processor, cause the processor to perform the method provided by the embodiments of the present disclosure. The computer program product can be written in any combination of one or more programming languages to write program codes for performing the operations of the embodiments of the present disclosure, and the programming languages include object-oriented programming languages such as Java, C++, etc., and also include conventional procedural programming languages such as "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0132] In addition, the embodiments of the present disclosure may also be a computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, cause the processor to perform the method provided by the embodiments of the present disclosure. The computer-readable storage medium may be any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may, for example, include but is not limited to an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0133] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0134] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device:
[0135] In response to obtaining a resource allocation instruction for a target order, determining the resource value of the order to be allocated corresponding to the resource allocation instruction, obtaining a pre-generated resource allocation tree corresponding to the target order, wherein the resource allocation tree includes multiple resource allocation nodes, each resource allocation node is pre-set with corresponding node attributes, and then, based on the node attributes of each resource allocation node and the resource value of the order to be allocated, determining the node resource value to be allocated for each resource allocation node, and performing resource allocation processing on each resource allocation node based on the node resource value to be allocated for each resource allocation node. In this technical solution, resource allocation is performed in the form of a resource allocation tree in which node attributes and resource allocation nodes can be flexibly adjusted, thereby improving the flexibility of resource allocation, and the resource allocation tree clearly presents the resource allocation relationship between each resource allocation node, thereby improving the efficiency of resource allocation.
[0136] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0137] The units involved in the embodiments described in this disclosure may be implemented in software or hardware, wherein the name of a unit does not necessarily limit the unit itself.
[0138] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.
[0139] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0140] The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also includes other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned disclosed concepts. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.
[0141] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details have been included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0142] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.
Claims
1. A resource allocation processing method, characterized in that: The following steps are involved: In response to obtaining a resource allocation instruction for a target order, determining a to-be-allocated order resource value corresponding to the resource allocation instruction; Obtaining a pre-generated resource allocation tree corresponding to the target order, wherein the resource allocation tree includes a plurality of resource allocation nodes, and each resource allocation node is pre-set with a corresponding node attribute; Determining the node resource value to be allocated of each resource allocation node according to the node attribute of each resource allocation node and the value of the order resource to be allocated; Resource allocation processing is performed on each resource allocation node according to the node resource value to be allocated of each resource allocation node.
2. The method according to claim 1, wherein Before obtaining the pre-generated resource allocation tree corresponding to the target order, the method includes: Acquire multiple resource allocation nodes corresponding to the target order, determine the resource allocation relationship of the multiple resource allocation nodes, and determine the node attribute of each resource allocation node; The plurality of resource allocation nodes are connected according to the resource allocation relationship, and node attributes of each of the resource nodes are set to generate the resource allocation tree.
3. The method according to claim 2, wherein Also includes: In response to obtaining a deletion instruction for a first resource allocation node in the resource allocation tree, deleting the first resource allocation node in the resource allocation tree; and / or, In response to obtaining an instruction to add a second resource allocation node in the resource allocation tree, obtaining a node attribute of the second resource allocation node, The second resource allocation node is added to the resource allocation tree, and node attributes of the second resource allocation node are set.
4. The method according to claim 2, wherein Also includes: In response to obtaining a node attribute modification instruction for a third resource allocation node in the resource allocation tree, obtaining node attribute modification information corresponding to the node attribute modification instruction; The node attributes of the third resource allocation node are modified according to the node attribute modification information.
5. The method according to claim 1, wherein The node attributes include: resource allocation ratio, and determining the node resource value to be allocated of each resource allocation node according to the node attributes of each resource allocation node and the order resource value to be allocated includes: Determining whether the target order satisfies a preset allocation end condition based on the to-be-allocated order resource value, wherein the preset allocation end condition is used to verify whether the target order completes a resource allocation event after completing the allocation of the to-be-allocated order resource value; In response to not meeting the preset allocation end condition, determining the node resource value to be allocated of each resource allocation node in the resource allocation tree according to the resource allocation ratio of each resource allocation node and the order resource value to be allocated.
6. The method according to claim 5, wherein The node attributes further include: a node resource allocation threshold, and after determining whether the target order meets a preset allocation end condition according to the to-be-allocated resource value, further including: In response to satisfying the preset allocation end condition, obtaining an allocated node resource value of each resource allocation node; Calculating a first difference between the node resource allocation threshold and the allocated node resource value; The first difference is determined as a node resource value to be allocated for each resource allocation node.
7. The method according to claim 5, wherein The determining whether the target order meets a preset allocation end condition according to the resource value of the order to be allocated includes: Obtaining an order resource allocation threshold corresponding to the target order, and determining an allocated order resource value corresponding to the target order; Calculating a second difference between the order resource allocation threshold and the allocated order resource value; Determine whether the resource value of the order to be allocated is greater than or equal to the second difference, wherein when it is greater than or equal to the second difference, determine that the target order meets the preset allocation end condition.
8. The method according to any one of claims 1 to 7, wherein: The resource allocation tree further includes a fourth resource allocation node, wherein the resource allocation nodes in the next layer connected to the fourth resource allocation node include a corresponding fourth resource allocation node. After determining the node resource value to be allocated of each resource allocation node according to the node attribute of each resource allocation node and the value of the order resource to be allocated, the method further includes: Determine the sum of all to-be-allocated node resource values corresponding to the next layer of resource allocation nodes connected to the fourth resource allocation node to obtain the sum of reference node resources; Identify whether the node resource value to be allocated of each other resource allocation node in the next layer of resource allocation nodes except the fourth resource allocation node meets a preset value condition; Performing data processing on the resource values of the nodes to be allocated that do not meet the preset value conditions, wherein the resource values of the nodes to be allocated after the data processing meet the preset value conditions; After the data processing, the sum of the to-be-allocated node resource values corresponding to the next layer of resource allocation nodes is calculated to obtain the sum of actual node resources; Calculating a third difference between the sum of the reference node resources and the sum of the actual node resources; The node resource value to be allocated of the fourth resource allocation node in the next layer of resource allocation nodes is updated to the sum of the node resource to be allocated of the fourth resource allocation node in the next layer of resource allocation nodes and the third difference.
9. The method according to claim 8, wherein The preset value conditions include: the number of decimal places is not greater than the preset number of decimal places; The data processing of the node resource value to be allocated that does not meet the preset value condition includes: Among the node resource values to be allocated that are greater than the preset number of decimal places, the values after the preset number of decimal places are deleted.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and the computer program is used to execute the resource allocation processing method according to any one of claims 1 to 9.
11. A computer program product, characterized in that The method comprises a computer program, which implements the resource allocation processing method according to any one of claims 1 to 9 when executed by a processor.