Shared resource processing method, device, equipment and computer storage medium
By pre-dividing shared resources in the total node and dynamically adjusting according to the usage ratio of child nodes, the problem of resource waste and injustice in the existing technology is solved, and the rational allocation and efficient utilization of resources are achieved.
Patent Information
- Application Number
- CN202211712347.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-29
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2042-12-29
AI Technical Summary
The existing shared resource division methods have problems of resource waste and resource injustice. The equalization of resources leads to incomplete use of some resources, and first come first served leads to unfair resource division.
By pre-dividing shared resources to multiple child nodes in the total node and dividing resources according to the proportion of the child nodes using shared resources within multiple preset time periods, we ensure that users under each child node can use shared resources fairly.
It avoids waste of resources equally divided and first come first served injustice, ensuring the reasonable allocation and efficient utilization of resources.
Smart Images

Figure CN116094859B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of data processing, and in particular, relates to a method, device, equipment and computer storage medium for processing shared resources. Background Art
[0002] When multiple users have subscribed to a shared resource package, the system will divide the resources among the multiple users who have subscribed to the shared resource package, usually by evenly dividing the resources based on the number of users who have subscribed to the shared resource package, or by consuming the resources in the shared resource package on a first-come, first-served basis.
[0003] The use of equal resource allocation will result in some users not being able to use all the resources allocated to them, resulting in resource waste; while the use of the first-to-request-first-to-consume method will result in unfair resource allocation, with some users having no shared resources available in the later stages. In other words, both existing resource allocation methods have the problem of unreasonable resource allocation. Summary of the invention
[0004] The embodiments of the present application provide a method, apparatus, device and computer storage medium for processing shared resources, which can solve the technical problem that the resources allocated to some users are not fully used up and waste resources due to the resource equalization method; and solve the technical problem that the resource allocation is unfair due to the method of who requests first and who consumes first, and some users have no shared resources available in the later stage.
[0005] On the one hand, an embodiment of the present application provides a method for processing shared resources, the method comprising: obtaining the total resource amount of shared resources in a main node, and the resource usage of each of a plurality of subnodes in a plurality of preset time periods for the shared resources, the plurality of subnodes being objects to be divided for the shared resources in the main node; calculating, based on the resource usage of each of the plurality of subnodes, the proportion of each of the plurality of subnodes in the use of the shared resources in the plurality of preset time periods; and dividing the shared resources for each subnode according to the proportion and the total resource amount of each subnode.
[0006] On the other hand, an embodiment of the present application provides a shared resource processing device, the device including: an acquisition unit, used to acquire the total resource amount of the shared resources in the main node, and the resource usage of each of a plurality of subnodes in a plurality of preset time periods for the shared resources, the plurality of subnodes being objects to be divided for the shared resources in the main node; a calculation unit, used to calculate the proportion of each of the plurality of subnodes in the use of the shared resources in a plurality of preset time periods based on the resource usage of each of the plurality of subnodes; and a division unit, used to divide the shared resources for each subnode according to the proportion and the total resource amount of each subnode.
[0007] On the other hand, an embodiment of the present application provides a shared resource processing device, the device comprising: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, the shared resource processing method as described above is implemented.
[0008] On the other hand, an embodiment of the present application provides a computer storage medium, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the above-mentioned shared resource processing method is implemented.
[0009] The shared resource processing method, apparatus, device and computer storage medium of the embodiments of the present application divide the shared resources into multiple sub-nodes in advance in the main node, so that when users under each sub-node use the shared resources, they can deduct the consumption based on the shared resources pre-allocated to the sub-node, thereby avoiding the situation where some users have no shared resources available due to the first-come-first-served processing method. At the same time, the embodiments of the present application divide the shared resources into multiple sub-nodes based on the proportion of shared resources used by multiple sub-nodes in multiple preset time periods, thereby avoiding the situation where some resources are wasted and some users have no resources available due to the equal distribution of shared resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0011] Figure 1 It is a flowchart of a method for processing shared resources provided by an embodiment of the present application;
[0012] Figure 2 is a flowchart of a method for processing shared resources provided by another embodiment of the present application;
[0013] Figure 3 is a flowchart of a method for processing shared resources provided by another embodiment of the present application;
[0014] Figure 4 is a structural diagram of a shared resource processing device provided in yet another embodiment of the present application;
[0015] Figure 5 It is a structural diagram of a shared resource processing device provided in yet another embodiment of the present application. DETAILED DESCRIPTION
[0016] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.
[0017] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0018] Based on the background technology, it can be known that when multiple users subscribe to shared resources, there are mainly two ways to allocate shared resources:
[0019] 1. Resource sharing: After multiple users apply to subscribe to resource-sharing packages, the provincial system and billing account domain will obtain relevant information such as packages, users, groups, free resources, and billing discounts. When a user uses shared resources for the first time, the provincial system corresponding to the user will collect and analyze the call records, and synchronize the analyzed call records to the billing account domain. At this time, the billing account domain will divide the shared resources equally according to the number of group members subscribed this time, and deduct the shared resources corresponding to the user who requested this time. Finally, the total remaining resources and the corresponding member’s remaining resources will be synchronized to the provincial system corresponding to each member, and this part of the data will be stored in the corresponding MDB data domain to ensure data integrity.
[0020] 2. First come, first served: After multiple users apply to order resource-sharing packages, the provincial system and the billing account domain will obtain relevant information such as packages, users, groups, free resources, and billing discounts. When a user uses shared resources for the first time, the provincial system will collect and analyze the call records, and synchronize the analyzed call records to the billing account domain. At this time, the billing account domain will deduct the shared resources based on the requested call records, and after the deduction is completed, it will respond to the provincial system of the request initiator with the remaining amount of shared resources, thereby completing the closed loop of the request. At this time, other users in the group will not receive notifications. In addition, the billing account domain will also store this part of the data in the corresponding MDB data domain to ensure data integrity.
[0021] However, the above resource distribution method will lead to the following problems: some resources are wasted, and some users do not use enough resources; each provincial system can only handle the business of its own provincial system, and the provincial system cannot query the business status of other provincial systems.
[0022] The above-mentioned first-come, first-served processing method will lead to the following problems: it may lead to unreasonable allocation of resources, thus causing complaints from users; it requires the business rules of each provincial system to be unified, making the business lack of flexibility; the data is highly concentrated, making construction and maintenance difficult.
[0023] In order to solve the above technical problems, the embodiments of the present application provide a method, device, equipment and computer storage medium for processing shared resources. The following first introduces the resource processing method provided by the embodiments of the present application.
[0024] Figure 1 FIG. 1 is a flow chart showing a method for processing shared resources provided by an embodiment of the present application. Figure 1 As shown, the method for processing the shared resource includes:
[0025] S101, obtaining the total resource amount of the shared resources in the main node and the resource usage of each of the multiple subnodes using the shared resources in multiple preset time periods, the multiple subnodes being objects to be divided of the shared resources in the main node.
[0026] It should be noted that the main node can be a national resource management system, and the sub-node can be a provincial resource management system / municipality resource management system. The main node is configured with shared resources, and the sub-nodes consume / use the shared resources in the main node based on user call records.
[0027] It should be noted that the shared resources can be traffic resources or voice resources.
[0028] It should be noted that the preset time period can be one day, one week, one month, etc.
[0029] For example, S101 provided in the embodiment of the present application may refer to: determining the total amount of shared resources in the national resource management system, as well as the multiple provincial resource management systems that have subscribed to the shared resources, and the amount of shared resources consumed by each provincial resource management system in the previous three months.
[0030] S102: Calculate, according to the resource usage of each of the multiple subnodes, a proportion of shared resources used by each of the multiple subnodes in multiple preset time periods.
[0031] In one example, according to the resource usage of each of the multiple subnodes, calculating the proportion of shared resources used by each of the multiple subnodes in multiple preset time periods can be achieved as follows:
[0032] S1021, calculating, according to the resource usage of each of the multiple subnodes, an average usage of the shared resource of each of the multiple subnodes in multiple preset time periods, averaged over each preset time period.
[0033] In one example, S1021 provided in the embodiment of the present application may refer to: calculating the average amount of shared resources used by each provincial resource management system each month based on the amount of shared resources used by each provincial resource management system in the previous three months.
[0034] S1022: Calculate, based on the average usage of each of the multiple subnodes, a ratio of the average usage of each subnode to the sum of the average usage of the multiple subnodes.
[0035] For example, S1022 provided in the embodiment of the present application may refer to: accumulating the average usage a of each provincial resource management system to obtain the sum of the average usage A; at this time, calculating the ratio a / A of the average usage of each provincial resource management system to the sum of the average usage.
[0036] S1023, based on the ratio of the average usage of each child node to the sum of the average usage of multiple child nodes, obtain the ratio of each child node using the shared resource in multiple preset time periods.
[0037] In one example, S1022 provided in the embodiment of the present application may refer to: taking the ratio of the average usage of each provincial resource management system to the sum of the average usage as the proportion of shared resources used by each provincial resource management system in multiple preset time periods.
[0038] S103, dividing the shared resources for each sub-node according to the proportion of each sub-node and the total resource amount.
[0039] In an example: there are three provincial resource management systems A, B, and C.
[0040] The total amount of resources allocated by the provincial resource management system = the total amount of shared resources * the percentage of allocatable resources.
[0041] The percentage of allocatable resources of provincial resource management system A (αa) = (the average value of shared resource usage of provincial resource management system A in the previous three months / the sum of the average values of shared resource usage of the three provincial resource management systems in the previous three months) * 100%.
[0042] The percentage of resources that can be allocated by provincial resource management system B (αb) = (the average value of shared resource usage of provincial resource management system B in the previous three months / the sum of the average values of shared resource usage of the three provincial resource management systems in the previous three months) * 100%.
[0043] The percentage of resources that can be allocated by provincial resource management system C (αc) = (the average value of shared resource usage of provincial resource management system C in the previous three months / the sum of the average values of shared resource usage of the three provincial resource management systems in the previous three months) * 100%.
[0044] It can be obtained that the initialization resource allocation amount of the resource-saving management system A = the total amount of shared resources * αA, and the same is true for the resource-saving management systems B and C.
[0045] The embodiment of the present application divides the shared resources into multiple sub-nodes in advance in the main node, so that when users under each sub-node use the shared resources, they can deduct consumption based on the shared resources pre-allocated to the sub-node, thereby avoiding the situation where a first-come-first-served approach is adopted for users, resulting in a situation where some users have no shared resources available. At the same time, the embodiment of the present application divides the shared resources into multiple sub-nodes based on the proportion of shared resources used by multiple sub-nodes in multiple preset time periods, thereby avoiding the situation where a part of resources is wasted and some users have no resources available.
[0046] In one embodiment, Figure 2 As shown, after dividing the shared resources for each sub-node according to the proportion of each sub-node and the total resource amount, the processing method further includes:
[0047] S104, obtaining a use request of a child node for a shared resource, where the use request includes a usage amount of the shared resource;
[0048] S105, determining the target shared resource allocated to the child node corresponding to the use request;
[0049] S106: deduct the target shared resource in the main node based on the usage of the shared resource.
[0050] In one example, the subnode obtains the bills of multiple users it manages, and the bills record the shared resources used by the users. The subnode accumulates the shared resources used by the users it manages, and when the total amount of shared resources used by the users reaches a certain threshold, the subnode sends a shared resource use request to the master node based on the shared resources used by the users.
[0051] The embodiment of the present application achieves the effect of prepayment management of the shared resources in the main node by pre-dividing the shared resources in the main node into multiple child nodes; then, after receiving a use request from any child node, determining the target shared resources allocated to the child node in the shared resources of the main node, and deducting the target shared resources.
[0052] At the same time, the embodiment of the present application solves the technical problem in the prior art that each provincial system can only handle the business of its own provincial system when resources are evenly shared by handing over the same data business (i.e., the deduction process of shared resources) in each sub-node to the main node for unified execution.
[0053] At the same time, the embodiment of the present application ensures the independence of the business rules of each sub-node by ensuring that the business process executed by the main node is merely a deduction process for shared resources, thereby solving the technical problems in the prior art where the business rules of each provincial system need to be unified when resources are on a first-come, first-served basis, resulting in a lack of business flexibility, high data concentration, and difficulty in construction and maintenance.
[0054] In one embodiment, after deducting the target shared resource in the total node based on the usage of the shared resource, the method further includes:
[0055] S107, calculating the remaining resource amount of the target shared resource divided by the child node after deduction;
[0056] S108, when the remaining resource amount is less than a preset threshold, obtaining the remaining total resource amount of the shared resources in the total node after deduction;
[0057] S109, reallocate the remaining total resource amount of the shared resources in the main node after deduction to multiple sub-nodes.
[0058] In the embodiment of the present application, when the shared resources allocated by a certain sub-node are exhausted / almost exhausted, the remaining shared resources in the main node are reallocated to improve the utilization rate of the shared resources.
[0059] In one embodiment, the remaining total resource amount after deduction of the shared resources in the main node is re-divided into multiple sub-nodes, which can be achieved as follows:
[0060] S1091, obtaining a historical division ratio of each user when the shared resources in the shared resource package were divided among multiple users last time.
[0061] S1092, obtaining a historical consumption ratio between the shared resources consumed by each user and the divided shared resources after the shared resources in the shared resource package were divided among multiple users last time.
[0062] S1093: Calculate a target partition ratio corresponding to each of the multiple users based on the historical partition ratio and the historical consumption ratio of each of the multiple users.
[0063] S1094: Based on the target division ratio, the remaining total resource amount after deduction of the shared resources in the main node is reallocated to multiple sub-nodes.
[0064] In another embodiment, based on the historical division ratio and the historical consumption ratio of each user among the multiple users, calculating the target division ratio corresponding to each user among the multiple users can be implemented as follows:
[0065] S1093a, calculating an initial division ratio of each user based on the historical division ratio and the historical consumption ratio of each user among the multiple users, wherein the initial division ratio is obtained by multiplying the historical division ratio and the historical consumption ratio.
[0066] S1093b, based on the initial division ratio of each user among the multiple users, calculate the ratio of the initial division ratio of each user to the sum of the initial division ratios of the multiple users.
[0067] S1093c: Obtain a target division ratio for each user among the multiple users based on the ratio of the initial division ratio of each user to the sum of the initial division ratios of the multiple users.
[0068] In an example: there are three provincial resource management systems A, B, and C.
[0069] The total amount of resources acquired by the provincial resource management system = the total amount of remaining shared resources * the percentage of resources allocated by the provincial resource management system, where the percentage of resources allocated by the provincial resource management system is calculated as follows:
[0070] Convert [W(a) / Y*(Z / W(a))], [W(b) / Y*(Z / W(b))], [W(c) / Y*(Z / W(c))] proportionally according to the greatest common divisor and take the numerator. Now:
[0071] The percentage of resources allocated by the resource management system of province A = the numerator value of A / (the sum of the three molecules of A, B, and C);
[0072] The percentage of resources allocated by the resource management system of province B = the numerator value of B / (the sum of the three molecules of A, B, and C);
[0073] The percentage of resources allocated by the resource management system of province C = the numerator value of C / (the sum of the three molecules of A, B, and C);
[0074] From this, we can conclude that the total amount of resources acquired by the resource management system of Province A = the total amount of remaining shared resources * the percentage of resources allocated by the resource management system of Province A; the same is true for the resource management systems of Province A and Province C.
[0075] The key concepts involved in the above calculation are: Y is the total amount of shared resources at the last division; W is the allocation of shared resources obtained by the provincial resource management system at the last division; Z is the usage of shared resources used by the provincial resource management system after the last division.
[0076] In one embodiment, after dividing the shared resources for each sub-node according to the proportion of each sub-node and the total resource amount, the processing method also includes: after a preset time period, continuing to obtain the total resource amount of the shared resources in the total node, and the resource usage of each sub-node in the multiple sub-nodes using the shared resources within multiple preset time periods.
[0077] In the embodiment of the present application, S101, S102 and S103 are re-executed after each preset time period, so that the main node re-divides the shared resources according to the time dimension, thereby improving the utilization rate of the shared resources.
[0078] Figure 3 A schematic flow chart of a method for processing resources provided in another embodiment of the present application is shown.
[0079] like Figure 3 As shown, the resource processing method may include:
[0080] S001, collect the user's resource usage information and obtain the user's call log.
[0081] In one example, after obtaining the user call bill, the processing method further includes: S002, adjusting the format of the user call bill for use by a subsequent billing module.
[0082] S003, collecting the user's resource subscription information, and judging whether the user has subscribed to the shared resource based on the resource subscription information. If the user has subscribed to the shared resource, go to S008; if the user has not subscribed to the shared resource, go to S004.
[0083] S004, based on the user's resource ordering information, determine the non-shared resource packages ordered by the user, as well as the remaining resource volume and priority of each non-shared resource package; based on the remaining resource volume and priority of each non-shared resource package, determine the deduction object of the user's call bill in the non-shared resource package ordered by the user.
[0084] S005: deduct the non-shared resources in the deduction object (non-shared resource package) based on the resource deduction amount in the user call record.
[0085] S006: After the deduction is completed, a billing call record is generated based on the deduction situation.
[0086] S007, storing the user call record and the billing call record in the call record module, and sending them to the main node for storage backup.
[0087] It should be noted that: the above are all executed by sub-nodes, and the above-mentioned call list module corresponds to the sub-node that executes the above.
[0088] like Figure 3 As shown, the resource processing method also includes:
[0089] S008, receiving a resource deduction request sent by a child node, wherein the resource deduction request includes at least any of the following: a unique request serial number, user information, a deduction amount of a shared resource, and a deduction object of a shared resource (a shared resource package ordered by a user).
[0090] S009, verifying the resource deduction request sent by the child node, for example: whether the shared resource package recorded in the resource deduction request is the shared resource package that should be deducted; if the resource deduction request fails the verification, go to S002.
[0091] In other words, when the resource deduction request fails to pass the verification, the main node feeds back the resource deduction request that fails to pass the verification to the child node, so that the child node reprocesses the user call record, so that the current processing result can correct the error of the previous processing result.
[0092] S010, when the resource deduction request passes verification, deduct the shared resources in the shared resource package recorded in the resource deduction request, and obtain the resource deduction result.
[0093] When the deduction is successful, the deducted resource amount of the shared resource package and the remaining resource amount of the shared resource package are sent to the child node for backup storage.
[0094] In case of a deduction failure, the reason for the deduction failure is sent to the child node.
[0095] In the case where some shared resources are deducted successfully, the deducted resource amount of the shared resource package and the remaining resource amount of the shared resource package are sent to the child node for backup storage, and the reason for the deduction failure is sent to the child node.
[0096] S012: After the deduction is completed, a billing call record is generated and stored based on the deduction situation, and the billing call record is sent to the call record module of the child node for storage and backup.
[0097] It should be noted that the above operations are all executed by the main node, and the main node can be configured with multiple sub-nodes.
[0098] in,
[0099] Sub-node: also known as provincial node, refers to the server system distributed in various provinces.
[0100] Total node: refers to the group's overall control point for shared resource packages (the overall control point refers to: traffic resources and voice resources).
[0101] Call record collection: The subnode collects the resources used by the user to form a call record.
[0102] Pre-billing call record: The subnode processes the collected call records to form a pre-billing call record.
[0103] Verification of whether to send up: The subnode analyzes the full package ordered by the user to determine whether it needs to be billed at the main node. Specifically, the subnode obtains the user's package information, divides the package resources into shared resources and non-shared resources, and for users with shared resources, transfers the deduction of the pre-billing call bill of the shared resources to the main node for deduction.
[0104] Intra-province billing: The subnode deducts resources from the user's intra-province package.
[0105] Group billing: The master node deducts resources from the user's shared package. When the provincial node initiates resource deduction, it reports the resource deduction elements to the master node. The master node compares and verifies the resources based on the reported information received and its own data resource module. If the verification passes, the resources are deducted accordingly.
[0106] Balance query: Each child node can query the remaining amount of shared resources at the main node.
[0107] Reminder of remaining resources: The master node monitors the remaining resources in real time and reminds the user when the remaining resources reach the threshold.
[0108] In summary, the embodiment of the present application solves the technical problem in the prior art that when resources are evenly distributed, each provincial system can only process the business of each provincial system, and when resources are first-come-first-served, the business rules of each provincial system need to be unified, which makes the business lack of flexibility, and the data concentration is high, and the construction and maintenance are difficult. At the same time, by synchronously storing billing records in subnodes and the main node, the technical problem that the provincial system cannot query the business status of other provincial systems is solved.
[0109] In addition, the embodiment of the present application does not need to improve the original deduction process. It only needs to add a judgment before the deduction process (to determine whether the deducted resource is a non-shared resource or a shared resource). If it is a non-shared resource, the deduction process of the child node is used; if it is a shared resource, the deduction process of the main node is used; in other words, the embodiment of the present application also achieves minimal modification of the main node and child nodes, reducing the workload of system upgrades.
[0110] Figure 4 FIG. 1 is a schematic diagram showing a structure of a shared resource processing device provided by an embodiment of the present application. Figure 4 As shown, the processing device for shared resources includes:
[0111] The acquisition unit 410 is used to acquire the total resource amount of the shared resources in the main node and the resource usage of each of the multiple subnodes using the shared resources in multiple preset time periods. The multiple subnodes are objects to be divided for the shared resources in the main node.
[0112] The calculation unit 420 is used to calculate the proportion of shared resources used by each of the multiple subnodes in multiple preset time periods according to the resource usage of each of the multiple subnodes.
[0113] The partitioning unit 430 is used to partition the shared resources for each sub-node according to the proportion of each sub-node and the total resource amount.
[0114] The embodiment of the present application divides the shared resources into multiple sub-nodes in advance in the main node, so that when users under each sub-node use the shared resources, they can deduct consumption based on the shared resources pre-allocated to the sub-node, thereby avoiding the situation where a first-come-first-served approach is adopted for users, resulting in a situation where some users have no shared resources available. At the same time, the embodiment of the present application divides the shared resources into multiple sub-nodes based on the proportion of shared resources used by multiple sub-nodes in multiple preset time periods, thereby avoiding the situation where a part of resources is wasted and some users have no resources available.
[0115] In one embodiment, the calculation unit 420 includes: a first calculation subunit, used to calculate the average usage of shared resources for each subnode in multiple preset time periods according to the resource usage of each subnode in the multiple subnodes; a second calculation subunit, used to calculate the ratio of the average usage of each subnode to the sum of the average usages of the multiple subnodes based on the average usage of each subnode in the multiple subnodes; and a first acquisition subunit, used to obtain the ratio of the shared resources used by each subnode in multiple preset time periods based on the ratio of the average usage of each subnode to the sum of the average usages of the multiple subnodes.
[0116] In one embodiment, the device also includes: a second acquisition sub-unit, which is used to obtain the sub-node's request for use of the shared resources allocated to the sub-node after the shared resources are allocated to each sub-node according to the proportion of each sub-node and the total amount of resources, and the use request includes the usage amount of the shared resources; a determination sub-unit, which is used to determine the target shared resources allocated to the sub-node corresponding to the usage request; and a deduction sub-unit, which is used to deduct the target shared resources in the total node based on the usage amount of the shared resources.
[0117] In one embodiment, the device also includes: a third calculation sub-unit, which is used to calculate the remaining resource amount of the target shared resources divided by the sub-nodes after deducting the target shared resources in the main node based on the usage of the shared resources; a third acquisition sub-unit, which is used to obtain the remaining total resource amount of the shared resources in the main node after deduction when the remaining resource amount is less than a preset threshold; and a division sub-unit, which is used to reallocate the remaining total resource amount of the shared resources in the main node after deduction to multiple sub-nodes.
[0118] In one embodiment, the division sub-unit includes: a first acquisition module, used to obtain the historical division ratio of each sub-node when the shared resources in the shared resource package were last divided into multiple sub-nodes; a second acquisition module, used to obtain the historical consumption ratio between the shared resources consumed by each sub-node and the divided shared resources after the shared resources in the shared resource package were last divided into multiple sub-nodes; a calculation module, used to calculate the target division ratio corresponding to each sub-node in the multiple sub-nodes based on the historical division ratio and historical consumption ratio of each sub-node in the multiple sub-nodes; a division module, used to redivide the remaining total resource amount after deduction of the shared resources in the total node to multiple sub-nodes based on the target division ratio.
[0119] In one embodiment, a calculation module includes: a first calculation submodule, used to calculate the initial division ratio of each subnode based on the historical division ratio and the historical consumption ratio of each subnode among a plurality of subnodes, wherein the initial division ratio is obtained by multiplying the historical division ratio and the historical consumption ratio; a second calculation submodule, used to calculate the proportion of the initial division ratio of each subnode to the sum of the initial division ratios of the plurality of subnodes based on the initial division ratio of each subnode among a plurality of subnodes; and an acquisition submodule, used to obtain the target division ratio of each subnode among a plurality of subnodes based on the proportion of the initial division ratio of each subnode to the sum of the initial division ratios of the plurality of subnodes.
[0120] In one embodiment, the processing device also includes: an execution unit, which is used to, after dividing the shared resources for each sub-node according to the proportion of each sub-node and the total resource amount, continue to execute the acquisition of the total resource amount of the shared resources in the total node at intervals of a preset time period, as well as the resource usage of the shared resources used by each sub-node in multiple preset time periods.
[0121] Figure 5 FIG. 1 is a schematic diagram showing the hardware structure of a shared resource processing device provided by an embodiment of the present application. Figure 5 As shown, the processing device of the shared resource may include a processor 501 and a memory 502 storing computer program instructions.
[0122] Specifically, the processor 501 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0123] The memory 502 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 502 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 502 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 502 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 502 is a non-volatile solid-state memory.
[0124] The memory 502 may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Thus, typically, the memory 502 includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to an aspect of the present application.
[0125] The processor 501 implements any one of the shared resource processing methods in the above embodiments by reading and executing computer program instructions stored in the memory 502 .
[0126] In one example, the processing device of the shared resource may further include a communication interface 503 and a bus 510. Figure 5 As shown, the processor 501, the memory 502, and the communication interface 503 are connected via a bus 510 and communicate with each other.
[0127] The communication interface 503 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0128] Bus 510 includes hardware, software or both, and the parts of the processing equipment of shared resources are coupled to each other. For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front-side bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 310 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the application considers any suitable bus or interconnection.
[0129] In addition, in combination with the shared resource processing method in the above embodiment, the embodiment of the present application can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by the processor, any one of the shared resource processing methods in the above embodiment is implemented.
[0130] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known methods is omitted here. In the above embodiments, several specific examples are described and shown. However, the method process of the present application is not limited to the specific described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order after understanding the spirit of the present application.
[0131] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0132] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of or devices. However, this application is not limited to the above sequence, that is, it can be executed in the order mentioned in the embodiment, or it can be different from the order in the embodiment, or several can be executed simultaneously.
[0133] The above reference is according to the method of the embodiment of the present application, the flow chart of the device (system) and the computer program product and / or the block diagram described various aspects of the present application.It should be understood that each square box in the flow chart and / or the block diagram and the combination of each square box in the flow chart and / or the block diagram can be realized by computer program instructions.These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the realization of the function / action specified in one or more square boxes of the flow chart and / or the block diagram.Such a processor can be but is not limited to a general-purpose processor, a special-purpose processor, a special application processor or a field programmable logic circuit.It can also be understood that each square box in the block diagram and / or the flow chart and the combination of the square boxes in the block diagram and / or the flow chart can also be realized by the dedicated hardware that performs the specified function or action, or can be realized by the combination of dedicated hardware and computer instructions.
[0134] The above is only a specific implementation of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.
Claims
1. A method for processing shared resources, characterized in that: include: Acquire the total resource amount of the shared resources in the main node, and the resource usage amount of the shared resources used by each of the multiple subnodes in multiple preset time periods, wherein the multiple subnodes are objects to be divided for the shared resources in the main node; Calculating, according to the resource usage of each of the multiple subnodes, a proportion of the shared resource used by each of the multiple subnodes within the multiple preset time periods; Divide the shared resources for each subnode according to the proportion of each subnode and the total amount of resources; After dividing the shared resources for each subnode according to the proportion of each subnode and the total amount of resources, the method further includes: Acquire a use request of the subnode for the shared resource divided by the subnode, wherein the use request includes a usage amount of the shared resource; Determine a target shared resource allocated to the subnode corresponding to the use request; Based on the usage of the shared resource, deducting the target shared resource in the master node; After deducting the target shared resource in the master node based on the usage of the shared resource, the method further includes: Calculate the remaining resource amount of the target shared resource divided by the sub-node after deduction; When the remaining resource amount is less than a preset threshold, obtaining the remaining total resource amount of the shared resources in the main node after deduction; Re-dividing the remaining total resource amount after deduction of the shared resources in the main node to the multiple sub-nodes; Re-dividing the remaining total resource amount after deduction of the shared resources in the main node to the multiple sub-nodes, including: Obtaining a historical division ratio of each sub-node when the shared resources in the shared resource package were last divided among the plurality of sub-nodes; Obtaining a historical consumption ratio between the shared resources consumed by each sub-node and the divided shared resources after the shared resources in the shared resource package are divided among the multiple sub-nodes last time; Calculating a target partition ratio corresponding to each of the plurality of subnodes based on a historical partition ratio and a historical consumption ratio of each of the plurality of subnodes; Based on the target division ratio, the remaining total resource amount after deduction of the shared resources in the main node is reallocated to the multiple sub-nodes.
2. The processing method according to claim 1, characterized in that: Calculating, according to the resource usage of each of the multiple subnodes, a proportion of the shared resource used by each of the multiple subnodes within the multiple preset time periods, includes: Calculate, according to the resource usage of each of the multiple subnodes, an average usage of the shared resource of each of the multiple subnodes in each of the multiple preset time periods within the multiple preset time periods; Based on the average usage of each of the multiple subnodes, calculating the ratio of the average usage of each of the subnodes to the sum of the average usage of the multiple subnodes; Based on the ratio of the average usage of each sub-node to the sum of the average usage of the multiple sub-nodes, the ratio of each sub-node using the shared resource in the multiple preset time periods is obtained.
3. The processing method according to claim 2, characterized in that: Calculating a target partition ratio corresponding to each of the plurality of subnodes based on a historical partition ratio and a historical consumption ratio of each of the plurality of subnodes includes: Calculating an initial division ratio of each subnode based on a historical division ratio and a historical consumption ratio of each subnode among the plurality of subnodes, wherein the initial division ratio is obtained by multiplying the historical division ratio and the historical consumption ratio; Based on the initial division ratio of each of the multiple subnodes, calculating the ratio of the initial division ratio of each of the subnodes to the sum of the initial division ratios of the multiple subnodes; Based on the ratio of the initial division ratio of each of the sub-nodes to the sum of the initial division ratios of the multiple sub-nodes, a target division ratio of each of the multiple sub-nodes is obtained.
4. The processing method according to claim 1, characterized in that: After dividing the shared resources for each sub-node according to the proportion of each sub-node and the total amount of resources, the processing method further includes: At intervals of preset time periods, the total resource amount of the shared resources in the main node and the resource usage amount of the shared resources used by each of the plurality of child nodes in a plurality of preset time periods are continuously obtained.
5. A shared resource processing device, characterized in that: include: An acquisition unit, used to acquire the total resource amount of the shared resources in the main node, and the resource usage amount of the shared resources used by each of the multiple subnodes in multiple preset time periods, wherein the multiple subnodes are objects to be divided for the shared resources in the main node; a calculation unit, configured to calculate a proportion of shared resources used by each of the plurality of subnodes within the plurality of preset time periods according to the resource usage of each of the plurality of subnodes; A partitioning unit, configured to partition the shared resources for each subnode according to the proportion of each subnode and the total amount of resources; After dividing the shared resources for each sub-node according to the proportion of each sub-node and the total resource amount, the method further includes: Acquire a use request of the subnode for the shared resource divided by the subnode, wherein the use request includes a usage amount of the shared resource; Determine a target shared resource allocated to the subnode corresponding to the use request; Based on the usage of the shared resource, deducting the target shared resource in the master node; After deducting the target shared resource in the master node based on the usage of the shared resource, the method further includes: Calculate the remaining resource amount of the target shared resource divided by the sub-node after deduction; When the remaining resource amount is less than a preset threshold, obtaining the remaining total resource amount of the shared resources in the main node after deduction; Re-dividing the remaining total resource amount after deduction of the shared resources in the main node to the multiple sub-nodes; Re-dividing the remaining total resource amount after deduction of the shared resources in the main node to the multiple sub-nodes, including: Obtaining a historical division ratio of each sub-node when the shared resources in the shared resource package were last divided among the plurality of sub-nodes; Obtaining a historical consumption ratio between the shared resources consumed by each sub-node and the divided shared resources after the shared resources in the shared resource package are divided among the multiple sub-nodes last time; Calculating a target partition ratio corresponding to each of the plurality of subnodes based on a historical partition ratio and a historical consumption ratio of each of the plurality of subnodes; Based on the target division ratio, the remaining total resource amount after deduction of the shared resources in the main node is reallocated to the multiple sub-nodes.
6. A processing device for sharing resources, characterized in that: The device comprises: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the method for processing shared resources according to any one of claims 1 to 4 is implemented.
7. A computer storage medium, characterized in that: The computer storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the method for processing shared resources according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Flow sharing method and system, and storage device
CN115086898A