Resource processing method, device, electronic device and computer-readable storage medium

By obtaining and judging the available resources in multiple resource channels, and using preset resource scheduling methods for allocation and transfer, the problems of unbalanced resource use and imbalanced allocation in resource processing services are solved, and efficient and stable processing and throughput of resources are achieved Increase in quantity.

CN114548742BActive Publication Date: 2025-01-14BEIJING HUITONG TIANXIA LOGISTIC CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210152220.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-18
Publication Date
2025-01-14
Estimated Expiration
2042-02-18

AI Technical Summary

Technical Problem

In resource processing business scenarios, resource usage imbalance and allocation imbalance lead to resource processing failures, throughput bottlenecks and single-point problems, making it difficult to achieve efficient and stable processing of resources.

Method used

By obtaining the available resources in multiple resource channels, we can determine whether the preset resource allocation conditions are met, and the preset resource scheduling method is used to allocate resources to achieve resource balance, and use multiple resource channels to transfer and merge processing to improve the resource Throughput and stability.

Benefits of technology

It realizes efficient and stable processing of resources, improves resource throughput, reduces unnecessary resource losses, and ensures the stability of resource processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114548742B_ABST
    Figure CN114548742B_ABST
Patent Text Reader

Abstract

The present application provides a resource processing method, device, electronic device and computer-readable storage medium, which relate to the field of resource management technology. The resource processing method includes: after obtaining the available resource amounts of multiple resource channels, judging whether the available resource amounts of multiple resource channels meet the corresponding preset resource allocation conditions, if the available resource amount of a first resource channel among the multiple resource channels meets the preset resource allocation conditions corresponding to the first resource channel, then using a preset resource scheduling method to allocate resources to the multiple resource channels, so that the available resource amounts of the multiple resource channels meet the preset resource balance conditions. Resource processing is implemented using multiple resource channels. When a resource channel fails, efficient and stable processing of resources can be achieved by transferring, merging, and other processing of the failed resource channel. In addition, multiple resource channels can improve the throughput of resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of resource management, and in particular to a resource processing method, device, electronic device and computer-readable storage medium. Background Art

[0002] In various resource processing business scenarios, such as natural resource processing, financial resource processing, human resources and other business scenarios, it is usually necessary to manage the input and output of a large number of resources. In this process, various resource processing failures may occur due to problems such as uneven resource use or imbalanced resource allocation. For this reason, a resource processing method is needed to break through limitations such as throughput bottlenecks and achieve effective resource processing. Summary of the invention

[0003] The purpose of the present invention is to provide a resource processing method, device, electronic device and computer-readable storage medium to address the deficiencies in the above-mentioned prior art, so as to achieve effective processing of resources.

[0004] To achieve the above purpose, the technical solution adopted in the embodiment of the present application is as follows:

[0005] In a first aspect, an embodiment of the present application provides a resource processing method, including:

[0006] Get the available resources of multiple resource channels;

[0007] Determining whether the available resource amounts of the multiple resource channels meet corresponding preset resource allocation conditions;

[0008] If there is a first resource channel among the multiple resource channels whose available resource amount satisfies the preset resource allocation condition corresponding to the first resource channel, a preset resource scheduling method is used to allocate resources to the multiple resource channels so that the available resource amount of the multiple resource channels satisfies the preset resource balance condition.

[0009] Optionally, the determining whether the available resource amounts of the multiple resource channels meet corresponding preset resource scheduling conditions includes:

[0010] Determining whether the available resource amounts of the multiple resource channels are less than or equal to the corresponding allocation warning resource amounts;

[0011] If the available resource amount of a resource channel is less than or equal to the corresponding allocation warning resource amount, it is determined that the resource channel meets the corresponding preset resource allocation condition;

[0012] If the available resource amount of the one resource channel is greater than the corresponding allocation warning resource amount, it is determined that the one resource channel does not meet the corresponding preset resource allocation condition.

[0013] Optionally, before using a preset resource scheduling method to allocate resources to the multiple resource channels, the method further includes:

[0014] Calculating average available resource amounts of the multiple resource channels;

[0015] Determine whether the average available resource amount is higher than the allocation warning resource amount corresponding to the first resource channel;

[0016] The adopting a preset resource scheduling method to allocate resources for the multiple resource channels includes:

[0017] If the average available resource amount is higher than the allocation warning resource amount corresponding to the first resource channel, the preset resource scheduling method is used to allocate resources for the multiple resource channels.

[0018] Optionally, the method further includes:

[0019] If it is detected that the available resource amount of the second resource channel among the multiple resource channels is less than the preset minimum resource amount, marking the second resource channel as an unavailable channel;

[0020] The available resources of the second resource channel are merged into a third resource channel among the multiple resource channels, and the third resource channel is the resource channel with the largest amount of available resources among the multiple resource channels.

[0021] Optionally, the method further includes:

[0022] placing the resource exchange request distributed to the second resource channel into a waiting queue;

[0023] The resource exchange request in the waiting queue is transferred to the third resource channel, so as to perform a resource exchange operation using the third resource channel.

[0024] Optionally, the method further includes:

[0025] If it is detected that the resource storage operation for any resource channel is completed, the total available resource amount of the multiple resource channels is obtained;

[0026] Calculate, according to the total available resource amount, a first average available resource amount of a designated resource channel among the multiple resource channels, wherein the designated resource channel includes: a preset unavailable channel, and all available resource channels;

[0027] If the first average available resource amount is greater than the allocation warning resource amount corresponding to the preset unavailable channel, resources are allocated to the designated resource channels so that the available resource amount of each designated resource channel meets the resource balance condition;

[0028] The preset unavailable channel is restored as an available channel.

[0029] Optionally, before obtaining the available resource amounts of the multiple resource channels, the method further includes:

[0030] Obtaining available resource amounts of the multiple resource channels;

[0031] Calculating, according to the plurality of resource channels, a second average available resource amount of the plurality of resource channels;

[0032] According to the second average available resource amount, resources are allocated to the multiple resource channels so that the available resource amounts of the multiple resource channels meet the resource balancing condition.

[0033] In a second aspect, an embodiment of the present application further provides a resource processing device, the device comprising: an acquisition module, a judgment module, and an allocation module;

[0034] The acquisition module is used to acquire the available resource amounts of multiple resource channels;

[0035] The judging module is used to judge whether the available resource amounts of the plurality of resource channels meet the corresponding preset resource allocation conditions;

[0036] The allocation module is used to allocate resources to the multiple resource channels using a preset resource scheduling method if the available resource amount of a first resource channel among the multiple resource channels meets the preset resource allocation condition corresponding to the first resource channel, so that the available resource amount of the multiple resource channels meets the preset resource balance condition.

[0037] In the third aspect, an embodiment of the present application also provides an electronic device, comprising: a processor, a storage medium and a bus, wherein the storage medium stores program instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium through the bus, and the processor executes the program instructions to perform the steps of the resource processing method as described in any one of the first aspects.

[0038] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the resource processing method as described in any one of the first aspects are executed.

[0039] The beneficial effect of the present application is as follows: the embodiment of the present application provides a resource processing method, after obtaining the available resource amounts of multiple resource channels, it is determined whether the available resource amounts of the multiple resource channels meet the corresponding preset resource allocation conditions, if there is a first resource channel among the multiple resource channels whose available resource amounts meet the preset resource allocation conditions corresponding to the first resource channel, then a preset resource scheduling method is used to allocate resources to the multiple resource channels, so that the available resource amounts of the multiple resource channels meet the preset resource balance conditions. Resource processing is implemented using multiple resource channels, and when a resource channel fails, efficient and stable processing of resources can be achieved by transferring, merging, and other processing of the failed resource channel. In addition, multiple resource channels can improve resource throughput. By setting resource allocation conditions, unnecessary resource loss is reduced, and the stability of resource processing is further guaranteed. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0041] Figure 1 A flowchart of a resource processing method provided in one embodiment of the present application;

[0042] Figure 2 A resource processing system architecture diagram for a method for running resource processing provided in one embodiment of the present application;

[0043] Figure 3 A flowchart of a resource processing method provided in another embodiment of the present application;

[0044] Figure 4 A flowchart of a resource processing method provided in another embodiment of the present application;

[0045] Figure 5 A flowchart of a resource processing method provided in yet another embodiment of the present application;

[0046] Figure 6 A flowchart of a resource processing method provided in yet another embodiment of the present application;

[0047] Figure 7 A flowchart of a resource processing method provided in accordance with another embodiment of the present application;

[0048] Figure 8 A flowchart of a resource processing method provided in yet another embodiment of the present application;

[0049] Fig. 9 A schematic diagram of a resource processing device provided in one embodiment of the present application;

[0050] Fig.10 A schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0051] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments.

[0052] In this application, unless otherwise expressly specified and limited, in the description of the present invention, "a plurality of" means at least two, such as two or three, unless otherwise expressly and specifically limited. The terms "comprise", "include" or any other variant 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, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.

[0053] The resource processing method of the present application is applied to a client, which may be, for example, a personal digital assistant (PDA), a car computer, a desktop computer, a laptop computer, a smart TV, a smart phone, or other computer device capable of running the program of the present application.

[0054] As mentioned in the background technology, there may be a variety of problems in the resource processing business scenario, which are explained below using financial resource processing as an example. In the financial settlement (such as online freight settlement) business scenario, it is necessary to complete the operation of paying a large number of accounts (such as online payment to a driver or fleet). Generally speaking, a transfer instruction can be issued through the bank-enterprise direct connection system provided by the bank to transfer the platform's bank account funds to the target account (such as the driver's or fleet's bank card), but the bank-enterprise direct connection system has a throughput bottleneck. When the payment amount reaches the maximum amount, the target account collection process cannot be initiated in time. At the same time, there is a single point problem, that is, if the bank-enterprise direct connection system is down, the payment process cannot be carried out.

[0055] In view of the various resource processing problems that currently exist, such as avoiding the interruption of payment business caused by downtime of a single bank-enterprise direct payment channel in the network freight settlement scenario, and the payment delay problem caused by a single payment channel encountering a throughput bottleneck, the embodiments of the present application provide multiple possible implementation methods to achieve effective resource processing. The following is an explanation through multiple examples in conjunction with the accompanying drawings. Figure 1 This is a flowchart of a resource processing method provided by an embodiment of the present application. The method can be implemented by an electronic device running the above method, and the electronic device can be, for example, a terminal device or a server. Figure 1 As shown, the method includes:

[0056] Step 101: Obtain available resource amounts of multiple resource channels.

[0057] It should be noted that the current resource processing is based on a single resource channel, and resource processing is achieved by scheduling and managing the available resources of this resource channel. In this case, if the resource channel fails or the available resources in the resource channel are insufficient, it may cause resource processing failure, which is not conducive to efficient and stable resource processing. Figure 2 A resource processing system architecture diagram for a method for running resource processing provided in one embodiment of the present application; Figure 2 As shown, multiple resource channels are used at the same time, and the available resources of each resource channel can flow between multiple resource channels. When one of the resource channels fails, the resource channels can be transferred, merged, etc. to achieve efficient and stable processing of resources. Figure 2 The resource processing device is a desktop computer, laptop computer, smart phone, server or other device that can run the resource processing method of this application.

[0058] In one possible implementation, Figure 2 On this basis, multiple resource channels can be accessed in parallel, so that when resources are allocated or used, multiple resource channels can be used simultaneously to improve resource throughput.

[0059] It should also be noted that each resource channel includes available resources, which is the number of resources available for use under the resource channel. For example, when the resource channel is a bank-enterprise direct connection channel, each bank-enterprise direct connection channel includes an account balance, which is the available resource amount of the resource channel.

[0060] It should also be noted that since the resources in the resource channels are in use, that is, the amount of available resources in each resource channel is constantly changing, the timing of triggering the resource processing method of the present application can be set according to actual needs. For example, the resource processing method of the present application can be set to run each time a resource exchange request is obtained, that is, when a resource exchange request is obtained, execution starts from step 101. For another example, the resource processing method can be set to run at a fixed time interval. The above is only an example. In actual implementation, there may be other ways to trigger the resource processing method. This application does not limit this, and users can set it according to actual usage needs, resource types, etc.

[0061] Step 102: Determine whether the available resource amounts of multiple resource channels meet corresponding preset resource allocation conditions.

[0062] It should be noted that in order to ensure the normal use of resources in each resource channel, it is necessary to judge the available resource amounts of multiple resource channels to determine whether they meet the corresponding preset resource allocation conditions. Since different types of resources may correspond to different preset resource allocation conditions, this application does not limit this.

[0063] In one possible implementation, in order to maintain the operation of each resource channel, preset resource allocation conditions related to the available resource amount can be set. It should be noted that resource allocation refers to the method of transferring and allocating the available resource amount of each resource channel between resource channels based on a certain purpose or expectation. The stable operation of the resource processing method can be achieved through resource allocation. It can be understood that, for example, when the total amount of available resources of multiple resource channels still does not meet the usage conditions, even if resource allocation is performed, it cannot meet the usage needs, and the resource allocation process also requires considerable resource costs, so there is no need to allocate, so it is necessary to set preset resource allocation conditions.

[0064] Since there are multiple resource channels in the resource processing method of the present application, and the present application improves the stability of resource processing and the throughput of resources through the setting of multiple resource channels, in order to ensure that the multiple resource channels of the present application can operate in a stable multi-channel manner, the number of available resources of the multiple resource channels can be set as a preset resource allocation condition, etc., and the present application does not limit this.

[0065] Step 103: If the available resource amount of a first resource channel among multiple resource channels satisfies the preset resource allocation condition corresponding to the first resource channel, a preset resource scheduling method is used to allocate resources to the multiple resource channels so that the available resource amounts of the multiple resource channels meet the preset resource balance condition.

[0066] Since there are multiple resource channels in the resource processing method of the present application, and the present application improves the stability of resource processing and resource throughput through the setting of multiple resource channels, in order to ensure that the multiple resource channels of the present application can operate in a stable multi-channel manner, the available resource amounts of the multiple resource channels are set to meet the preset resource balance conditions for the purpose of allocation.

[0067] For example, if the resource is a financial resource and the funding channel is a bank-enterprise direct connection channel, since the throughput capacity of each channel is different, and in order to maximize the use of the channel capacity, the scheduling method for each payment request adopts a scheduling strategy whose load meets the characteristics of each channel. After a period of fund use, since the balance of each bank-enterprise direct connection channel account is different, some channels may have a large balance, while some channels may have insufficient balance. In order to ensure that multiple channels will not be unusable due to insufficient balance, it is necessary to transfer funds between multiple channel accounts to ensure that the balances of multiple channels are as balanced as possible and can be used at the same time.

[0068] It should be noted that the resource balancing conditions can be flexibly set according to the actual resource type, user needs, etc., and the resource balance can be an absolute balance in the numerical value of the available resource amount in multiple resource channels, or a relative balance, which is not limited in this application. For example, if multiple resource channels are channels with the same specifications and parameters, the resource balance can be set to be an absolute balance in the numerical value of the available resource amount in the multiple resource channels; for another example, if the throughput of multiple resource channels is different, that is, the specifications or parameters of the multiple resource channels are different, then the resource balance can be set to be a relative balance of the available resource amount in the multiple resource channels, such as a balance proportional to the throughput.

[0069] In summary, the embodiment of the present application provides a resource processing method. After obtaining the available resource amounts of multiple resource channels, it is determined whether the available resource amounts of the multiple resource channels meet the corresponding preset resource allocation conditions. If the available resource amount of the first resource channel among the multiple resource channels meets the preset resource allocation conditions corresponding to the first resource channel, the preset resource scheduling method is used to allocate resources to the multiple resource channels so that the available resource amounts of the multiple resource channels meet the preset resource balance conditions. Resource processing is implemented using multiple resource channels. When a resource channel fails, efficient and stable processing of resources can be achieved by transferring, merging, and other processing of the failed resource channel. In addition, multiple resource channels can improve resource throughput. By setting resource allocation conditions, unnecessary resource loss is reduced, and the stability of resource processing is further guaranteed.

[0070] Optional, in the above Figure 1 Based on this, the present application also provides a possible implementation of a resource processing method. Figure 3A flowchart of a resource processing method provided in another embodiment of the present application; Figure 3 As shown, judging whether the available resource amounts of multiple resource channels meet the corresponding preset resource scheduling conditions includes:

[0071] Step 301: Determine whether the available resource amounts of multiple resource channels are less than or equal to the corresponding allocation warning resource amounts.

[0072] In a possible implementation, a resource allocation warning amount may be preset. When the available resource amount of a resource channel is lower than the resource allocation warning amount, the available resource of the resource channel is at risk of being insufficient. After determining the resource allocation warning amount, the preset resource allocation condition is set to determine whether the available resource amounts of multiple resource channels are less than or equal to the corresponding resource allocation warning amount. That is, when the available resource amount of a resource channel is less than or equal to the resource allocation warning amount set for the resource channel, it is considered that the available resource of the resource channel is at risk of being insufficient and needs to be allocated.

[0073] It should be noted that the amount of allocated alert resources for each resource channel can be the same or different. This application does not limit this, and users can set it according to actual needs.

[0074] In a specific implementation, the amount of allocated alert resources for each resource channel can be calculated using the following formula:

[0075] Allocated alert resource amount = weight N * maximum single resource output * channel TPS (Transaction PerSeconds, event processing times per second) * resource allocation time;

[0076] Among them, the weight N>=1, when the weight N=1, it means that if resource allocation starts, the resource channel can support all current resource exchange requests before allocating resources to the resource acquirer. In order to avoid occasional delays in resource acquisition by the resource acquirer, the weight N can be appropriately increased;

[0077] The maximum single resource output is the highest value of a single resource output of a resource channel;

[0078] Channel TPS is the number of events that can be processed per second by the resource channel;

[0079] Resource allocation time refers to the time required for resources to be transferred from the resource channel to the resource acquirer.

[0080] Through the above calculation formula, the allocation warning resource amount corresponding to each resource channel can be calculated. On this basis, if the allocation warning resource amount of each resource channel is set to the same value, the uniform value can be set to the average value calculated for each resource channel. The above is only an example, and the allocation warning resource amount can also be set in other ways, which is not limited in this application.

[0081] Step 302: If the available resource amount of a resource channel is less than or equal to the corresponding allocation warning resource amount, it is determined that a resource channel meets the corresponding preset resource allocation condition.

[0082] When the available resource amount of a resource channel is less than or equal to the allocation warning resource amount set for the resource channel, it is considered that there is a risk of insufficient available resources of this resource channel and allocation or further judgment is required. Therefore, the resource channel meets the corresponding preset resource allocation conditions.

[0083] It should be noted that the resource channel can be any one of the multiple resource channels of the present application. When judging the preset resource allocation conditions, the present application regards all resource channels as having the same priority. As long as the available resource amount of any one of the multiple resource channels is less than or equal to the corresponding allocation warning resource amount, it is determined that this resource channel meets the corresponding preset resource allocation conditions.

[0084] Step 303: If the available resource amount of a resource channel is greater than the corresponding allocation warning resource amount, it is determined that a resource channel does not meet the corresponding preset resource allocation condition.

[0085] When the available resource amount of a resource channel is greater than the allocation warning resource amount set for the resource channel, it is considered that the available resources of the resource channel are sufficient and no allocation is required, so the resource channel does not meet the corresponding preset resource allocation conditions.

[0086] The above method is used to determine whether resource allocation is required for a resource channel.

[0087] Optional, in the above Figure 3 Based on this, the present application also provides a possible implementation of a resource processing method. Figure 4 A flowchart of a resource processing method provided by another embodiment of the present application; Figure 4 As shown, before using a preset resource scheduling method to allocate resources for multiple resource channels, the method includes:

[0088] Step 401: Calculate the average available resource amounts of multiple resource channels.

[0089] After determining that a certain resource channel needs to be allocated resources, it is further necessary to determine whether the available resources of other resource channels can be allocated to achieve resource allocation, thereby determining the total amount of all resource channels and calculating the average available resource amount of multiple resource channels, where the average available resource amount = the sum of the available resource amounts of all resource channels / the number of resource channels.

[0090] Step 402: Determine whether the average available resource amount is higher than the allocation warning resource amount corresponding to the first resource channel.

[0091] It should be noted that the first resource channel is a resource channel that meets the corresponding preset resource allocation conditions. After the average available resource amount is calculated, the average available resource amount is compared with the allocation warning resource amount corresponding to the first resource channel. If the average available resource amount is less than the allocation warning resource amount corresponding to the first resource channel, it means that the current total available resources can no longer support the parallel output of multiple resource channels. Even if the allocation is completed, some resource channels will quickly enter a situation of insufficient available resources, so allocation cannot be performed.

[0092] Use the preset resource scheduling method to allocate resources to multiple resource channels, including:

[0093] Step 403: If the average available resource amount is higher than the allocation warning resource amount corresponding to the first resource channel, a preset resource scheduling method is used to allocate resources to multiple resource channels.

[0094] If the average available resource amount is higher than the allocation warning resource amount corresponding to the first resource channel, it means that the current total available resources can support the parallel output of multiple resource channels after allocation. The preset resource scheduling method can be used to allocate the available resources of multiple resource channels so that the available resources of multiple resource channels meet the preset resource balance conditions.

[0095] In a specific implementation, the preset resource balance condition is that the total amount of available resources of multiple resource channels is the same. Assume that there are three resource channels, namely resource channel A, resource channel B, and resource channel C. The allocation warning resource amount of the three resource channels is the same, which is 20 units. After a series of output use, the available resource amounts of the three resource channels are 20 units in resource channel A, 100 units in resource channel B, and 50 units in resource channel C. According to the set allocation warning resource amount, it can be known that the available resource amount of resource channel A is equal to the allocation warning resource amount corresponding to resource channel A, and resource channel A meets its corresponding preset resource allocation condition. Next, the average available resource amount of the three resource channels is calculated, and the average available resource amount = (20 + 100 + 50) / 3 = 56 units. By comparison, it can be known that the average available resource amount is higher than the allocation warning resource amount corresponding to the first resource channel. Therefore, the preset resource scheduling method can be used to allocate resources for multiple resource channels.

[0096] In a possible implementation, the preset resource scheduling method may be allocated in the following manner:

[0097] Allocated resource amount = average available resource amount - current available resource amount of target resource channel; wherein, the target resource channel is any resource channel whose available resource amount is not equal to the average available resource amount. Generally, the target resource channel can be set as a resource channel in which the available resource amount in the channel is lower than the average available resource amount, so that in subsequent calculations, the available resource amount can be transferred out through the resource channel with an available resource amount higher than the average available resource amount to achieve the available resource amount of multiple resource channels meeting the preset resource balance condition. The above is only an example description, and there may be other target resource channel setting methods in actual implementation, and this application does not limit this.

[0098] In a specific implementation, for example, in the above embodiment, the available resource amounts of the three resource channels are 20 units in resource channel A, 100 units in resource channel B, and 50 units in resource channel C, respectively. The average available resource amount = (20 + 100 + 50) / 3 = 56 units, wherein the available resource amounts in resource channel A and resource channel C are both less than the average available resource amount. Therefore, it is necessary to transfer the available resource amount from resource channel B to resource channel A and resource channel C. If the above method is adopted to transfer the available resource amount less than the average available resource amount, As the method of taking the resource channel as the target resource channel, resource channel A and resource channel C are the target resource channels. According to the above calculation method of the allocated resource amount, the amount of resources allocated from resource channel B to resource channel A = 56-20 = 36 units, and the amount of resources allocated from resource channel B to resource channel C = 56-50 = 6 units. After the allocation is completed, the available resources in resource channel A, resource channel, and resource channel C are all 56 units, thereby satisfying the preset resource balance condition that the total amount of available resources of multiple resource channels is the same.

[0099] By determining the total amount of available resources of multiple resource channels, resources are allocated with the goal of maintaining normal operation of as many resource channels as possible, thereby further enhancing the stability of the present application.

[0100] Optional, in the above Figure 1 Based on this, the present application also provides a possible implementation of a resource processing method. Figure 5 A flowchart of a resource processing method provided in yet another embodiment of the present application; Figure 5 As shown, the method includes:

[0101] Step 501: If it is detected that the available resource amount of a second resource channel among multiple resource channels is less than a preset minimum resource amount, the second resource channel is marked as an unavailable channel.

[0102] It should be noted that the minimum resource amount refers to the set minimum resource value. When the available resource amount of a resource channel is less than the minimum resource amount, the available resource amount of the resource channel can no longer meet the scheduling of multiple parallel resource channels. In order to ensure the stable operation of resource processing, the resource channels can be merged or invalidated. According to the above description, for a resource channel, the preset minimum resource amount is less than the allocation warning resource amount corresponding to the resource channel. In addition, the minimum resource amounts of multiple resource channels can be the same or different, and this application does not limit this.

[0103] In a possible implementation, the minimum resource amount may be set to the maximum value of the available resource amount outputted by the resource channel at a time. The above is only an example, and there may be other ways to set the minimum resource amount in actual implementation, which is not limited in this application.

[0104] When it is detected that the available resource amount of the second resource channel among multiple resource channels is less than the preset minimum resource amount, the second resource channel is marked as an unavailable channel, and the second resource channel is no longer calculated in subsequent resource allocation or resource use.

[0105] It should also be noted that marking the second resource channel as an unavailable channel can be by adding an unavailable mark to the second resource channel, or by removing the second resource channel from the current multiple resource channels. The present application does not limit the specific marking method of the second resource channel, as long as the isolation of the second resource channel from other channels can be achieved.

[0106] Step 502: Merge the available resources of the second resource channel into a third resource channel among the multiple resource channels, where the third resource channel is the resource channel with the largest amount of available resources among the multiple resource channels.

[0107] The remaining available resources in the second resource channel are merged and merged into the third resource channel with the largest amount of available resources.

[0108] By marking unavailable channels and merging available resources, the utilization of as many resource channels as possible is ensured.

[0109] Optional, in the above Figure 5 Based on this, the present application also provides a possible implementation of a resource processing method. Figure 6 A flowchart of a resource processing method provided in another embodiment of the present application; Figure 6 As shown, the method includes:

[0110] Step 601: Put the resource exchange request distributed to the second resource channel into a waiting queue.

[0111] Before marking the second resource channel as an unavailable channel, the resource exchange request of the original second resource channel needs to be processed. The resource exchange request of the second resource channel is placed in a waiting queue (eg, a waiting First In First Out (FIFO) queue) and temporarily does not perform resource exchange processing on it.

[0112] Step 602: The resource exchange request in the waiting queue is transferred to the third resource channel, so as to use the third resource channel to perform a resource exchange operation.

[0113] After marking the second resource channel as an unavailable channel and merging the available resource amount of the second resource channel into a third resource channel among multiple resource channels, the resource exchange requests in the waiting queue are transferred to the third resource channel, and the third resource channel executes the resource exchange requests in the waiting queue.

[0114] In a specific implementation, if there are subsequent resource channels that continue to trigger the minimum resource amount, the above steps are repeated until only a single resource channel remains.

[0115] The above method is used to merge resource channels, which further improves the stability of the method of the present application.

[0116] Optional, in the above Figure 6 On this basis, the present application also provides a possible implementation of a resource processing method. Figure 7 A flowchart of a resource processing method provided in the third embodiment of the present application; Figure 7 As shown, the method includes:

[0117] Step 701: If it is detected that the resource storage operation for any resource channel is completed, the total available resource amounts of the multiple resource channels are obtained.

[0118] In addition to the output use of resources realized by responding to resource exchange requests, there may also be input available resource amounts in the resource channel, such as resource storage operations. Through resource storage operations, the available resource amounts in the resource channel can be increased. By responding to this operation, the available resource amounts in multiple resource channels can be allocated. Therefore, when any resource storage operation is detected, the total available resource amounts of multiple resource channels are obtained, that is, the sum of the available resource amounts of multiple resource channels.

[0119] It should be noted that, in order to reduce the amount of calculation of the entire method, a trigger condition for step 701 may be set, for example, when a resource channel is marked as an unavailable channel and a resource storage operation is detected, step 701 is executed.

[0120] Step 702: Calculate a first average available resource amount of a designated resource channel among a plurality of resource channels according to the total available resource amount, where the designated resource channel includes: a preset unavailable channel and all available resource channels.

[0121] In the above embodiment, a resource channel whose available resource amount is less than the preset minimum resource amount is marked as an unavailable channel, and it is no longer allocated in subsequent calculations. After detecting a storage operation for any resource, it can be considered to remove the unavailable channel mark of the unavailable channel and resume the use of the channel. Therefore, the calculation is performed by the following method:

[0122] The average value of the available resource amounts in any resource channel with an unavailable channel mark and all resource channels without an unavailable channel mark is calculated, that is, the first average available resource amount.

[0123] It should be noted that the selection of the preset unavailable channel selected in the calculation can be random, that is, randomly selected from all resource channels with unavailable channel marks; it can also be based on the priority of the resource channel, for example, setting a priority for each resource channel, and the higher the priority, the earlier the resource channel is restored. Therefore, after detecting any resource storage operation, calculate the resource channel with the highest priority among all resource channels with unavailable channel marks and the average value of the available resources in all resource channels without unavailable channel marks. The above is only an example. This application does not limit the specific method of specifying unavailable channels in designated resource channels, and users can choose according to actual needs.

[0124] Step 703: If the first average available resource amount is greater than the allocation warning resource amount corresponding to the preset unavailable channel, resources are allocated to the designated resource channels so that the available resource amount of each designated resource channel meets the resource balance condition.

[0125] Step 704: Restore the preset unavailable channel to an available channel.

[0126] If the first average available resource amount is less than the allocation warning resource amount corresponding to the unavailable channel, no recovery operation is performed. If the first average available resource amount is greater than the allocation warning resource amount corresponding to the unavailable channel, resources are allocated to the designated resource channels, so that the available resource amounts of multiple designated resource channels after the allocation meet the preset resource balance conditions, and the preset unavailable channels are restored to available channels.

[0127] In a specific implementation, assume that there are three resource channels, namely resource channel A, resource channel B, and resource channel C. The allocation warning resource volume of the three resource channels is 20 units. After a series of output use and storage, the available resource volumes of the three resource channels are 100 units in resource channel A, 0 units in resource channel B, and 5 units in resource channel C. Resource channel B and resource channel C are both marked as unavailable channels. Resource channel B is randomly selected as the channel to be restored, and the designated resource channels are resource channel A and resource channel B. The first average available resource volume = (100+0+5) / 2 = 52, which is higher than the allocation warning resource volume of 20, so allocation can be performed.

[0128] In a possible implementation, the allocation can be performed in the following manner:

[0129] Allocated resource amount = average available resource amount - current available resource amount of target resource channel; wherein, the target resource channel is any designated resource channel. Generally, the target resource channel can be set as a resource channel in the designated resource channel whose available resource amount is lower than the first average available resource amount, so that in subsequent calculations, the available resource amount can be transferred out through the resource channel with an available resource amount higher than the first average available resource amount to achieve that the available resource amount of the designated resource channel meets the preset resource balance condition. The above is only an example description, and there may be other target resource channel setting methods in actual implementation, and this application does not limit this.

[0130] In a specific implementation, for example, in the above embodiment, the available resource amounts of the three resource channels are 100 units in resource channel A, 0 units in resource channel B, and 4 units in resource channel C, respectively. Resource channel B and resource channel C are both marked as unavailable channels. Resource channel B is randomly selected as the channel to be restored, and the designated resource channels are resource channel A and resource channel B. The average value of the available resource amounts of the designated resource channels = (100+0+4) / 2 = 52. Therefore, it is necessary to allocate the available resource amounts from resource channel A and resource channel C to resource channel B. If the above method of using the resource channel with an available resource amount less than the average available resource amount as the target resource channel is adopted, resource channel B is the target resource channel. According to the above method of calculating the allocated resource amount, the allocated resource amount = 52-0 = 52. That is to say, after all allocation operations, 52 units of resources need to be allocated to resource channel B.

[0131] In another specific implementation, the allocation order can be set, for example, allocation starts from the resource channel with the lowest current available resource amount, or when there are available resources in the unavailable channel, allocation is prioritized from the unavailable channel. For example, in the scenario of the above embodiment, allocation can be prioritized from resource channel C, and after all 4 units in resource channel C are allocated to resource channel B, 52-4=48 units are allocated from resource channel A, thereby satisfying the preset resource balance condition that the total amount of available resources of multiple resource channels is the same. After the allocation is completed, there are 52 units in resource channel A, 52 units in resource channel B, and 0 units in resource channel C.

[0132] The above method is used to recover the unavailable channel.

[0133] Optional, in the above Figure 1-Figure 7 On this basis, the present application also provides a possible implementation of a resource processing method. Figure 8 A flowchart of a resource processing method provided in yet another embodiment of the present application; Figure 8 As shown, before obtaining the available resource amounts of multiple resource channels, the method further includes:

[0134] Step 801: Obtain available resource amounts of multiple resource channels.

[0135] Before obtaining the available resource amounts of multiple resource channels, the available resource amounts of the multiple resource channels may be allocated in advance. For example, before a specific service starts, the available resource amounts of the resource channels may be allocated to meet initial usage needs.

[0136] In a specific implementation, two hours before the start of a specific service every day, the available resources are pre-allocated through steps 901 to 903. First, the available resources of multiple resource channels are obtained.

[0137] Step 802: Calculate second average available resource amounts of the multiple resource channels according to the multiple resource channels.

[0138] Calculate the average of the available resources in all resource channels, and use this average as the second average available resources. The second average available resources are the available resources of the resource channels at the beginning of each business cycle.

[0139] The second average available resource amount=the sum of the available resource amounts of the multiple resource channels / the number of resource channels.

[0140] Step 803: Allocate resources to multiple resource channels according to the second average available resource amount, so that the available resource amounts of the multiple resource channels meet the resource balance condition.

[0141] The available resource amounts of the multiple resource channels are allocated according to the second average available resource amount, so that the available resource amounts of the multiple resource channels meet a preset resource balance condition.

[0142] In a specific implementation, assume that there are three resource channels, namely resource channel A, resource channel B, and resource channel C. The available resource amounts of the three resource channels are 100 units in resource channel A, 200 units in resource channel B, and 300 units in resource channel C, respectively. Then the second average available resource amount = (100 + 200 + 300) / 3 = 200, and 100 units are transferred from resource channel C to resource channel A.

[0143] In summary, the present application adopts parallel access of multiple resource channels, and adopts a certain resource allocation method / algorithm to allocate the available resources of multiple resource channels to ensure the balance of available resources of each channel. In this way, when using or responding to resource exchange requests, multiple channels are carried out simultaneously to improve resource throughput; at the same time, if any channel goes down or fails, the channel can be eliminated and other channels can complete the resource exchange.

[0144] The following describes the resource processing device, electronic device, storage medium, etc. used to execute the present application. The specific implementation process and technical effects are described above and will not be repeated below.

[0145] The embodiments of the present application provide a possible implementation example of a resource processing device, which can execute the resource processing method provided in the above embodiments. Fig. 9 Schematic diagram of a resource processing device provided in one embodiment of the present application. Fig. 9 As shown, the resource processing device 100 includes: an acquisition module 11, a determination module 13, and an allocation module 15;

[0146] An acquisition module 11 is used to acquire available resource amounts of multiple resource channels;

[0147] A judgment module 13 is used to judge whether the available resource amounts of multiple resource channels meet the corresponding preset resource allocation conditions;

[0148] The allocation module 15 is used to allocate resources to multiple resource channels using a preset resource scheduling method if the available resource amount of a first resource channel among multiple resource channels meets the preset resource allocation condition corresponding to the target resource channel, so that the available resource amount of multiple resource channels meets the preset resource balance condition.

[0149] Optionally, the judgment module 13 is used to judge whether the available resource amounts of multiple resource channels are less than or equal to the corresponding allocation warning resource amounts; if the available resource amount of a resource channel is less than or equal to the corresponding allocation warning resource amount, it is determined that a resource channel meets the corresponding preset resource allocation condition; if the available resource amount of a resource channel is greater than the corresponding allocation warning resource amount, it is determined that a resource channel does not meet the corresponding preset resource allocation condition.

[0150] Optionally, the acquisition module 11 is used to calculate the average available resource amount of multiple resource channels;

[0151] A judgment module 13 is used to judge whether the average available resource amount is higher than the allocation warning resource amount corresponding to the first resource channel;

[0152] The allocation module 15 is configured to allocate resources to multiple resource channels using a preset resource scheduling method if the average available resource amount is higher than the allocation warning resource amount corresponding to the first resource channel.

[0153] Optionally, the resource processing device 100 further includes: a processing module, configured to mark the second resource channel as an unavailable channel if it is detected that the available resource amount of the second resource channel among the multiple resource channels is less than a preset minimum resource amount;

[0154] The allocation module 15 is used to merge the available resources of the second resource channel into a third resource channel among the multiple resource channels, where the third resource channel is the resource channel with the largest amount of available resources among the multiple resource channels.

[0155] Optionally, the processing module is used to put the resource exchange request distributed to the second resource channel into a waiting queue; and transfer the resource exchange request in the waiting queue to the third resource channel to perform the resource exchange operation using the third resource channel.

[0156] Optionally, the acquisition module 11 is used to acquire the total available resource amount of multiple resource channels if it is detected that the resource storage operation for any resource channel is completed; and calculate the first average available resource amount of a specified resource channel among the multiple resource channels according to the total available resource amount, where the specified resource channel includes: a preset unavailable channel, and all available resource channels;

[0157] The judgment module 13 is used to allocate resources to the designated resource channels if the first average available resource amount is greater than the allocation warning resource amount corresponding to the preset unavailable channel, so that the available resource amount of each designated resource channel meets the resource balance condition; and restore the preset unavailable channel to an available channel.

[0158] Optionally, the acquisition module 11 is used to acquire available resource amounts of multiple resource channels; and calculate a second average available resource amount of the multiple resource channels according to the multiple resource channels;

[0159] The allocation module 15 is used to allocate resources to multiple resource channels according to the second average available resource amount, so that the available resource amounts of the multiple resource channels meet the resource balance condition.

[0160] The above-mentioned device is used to execute the method provided by the aforementioned embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.

[0161] The above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASIC), or one or more digital singnal processors (DSP), or one or more field programmable gate arrays (FPGA). For another example, when a module is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).

[0162] The embodiments of the present application provide a possible implementation example of an electronic device, which can execute the resource processing method provided in the above embodiments. Fig.10 A schematic diagram of an electronic device provided in an embodiment of the present application, the device can be integrated into a terminal device or a chip of a terminal device, and the terminal can be a computing device with data processing capabilities.

[0163] The electronic device includes: a processor 1101, a storage medium 1102 and a bus, the storage medium stores program instructions executable by the processor, when the control device is running, the processor and the storage medium communicate through the bus, the processor executes the program instructions, and executes the steps of the above resource processing method. The specific implementation method and technical effect are similar and will not be repeated here.

[0164] An embodiment of the present application provides a possible implementation example of a computer-readable storage medium, which can execute the resource processing method provided in the above embodiment. A computer program is stored on the storage medium, and when the computer program is executed by a processor, the steps of the above resource processing method are executed.

[0165] A computer program stored in a storage medium may include several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (English: processor) to perform some steps of the methods of various embodiments of the present invention. The aforementioned storage medium includes: a USB flash drive, a mobile hard disk, a read-only memory (English: Read-Only Memory, abbreviated: ROM), a random access memory (English: Random Access Memory, abbreviated: RAM), a magnetic disk or an optical disk, and other media that can store program codes.

[0166] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0167] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0168] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0169] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (English: processor) to perform some steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (English: Read-Only Memory, abbreviated: ROM), random access memory (English: Random Access Memory, abbreviated: RAM), disk or optical disk and other media that can store program codes.

[0170] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A resource processing method, characterized in that: include: Get the available resources of multiple resource channels; Determine whether the available resource amounts of the multiple resource channels meet the corresponding preset resource allocation conditions; wherein the preset resource allocation conditions corresponding to the available resource amounts of the multiple resource channels are that the available resource amounts of the multiple resource channels are less than or equal to the corresponding allocation warning resource amounts, and the formula for the allocation warning resource amounts corresponding to the resource channels is: allocation warning resource amount = weight * maximum single resource output amount * number of channel event processing times per second * resource allocation time; If there is a first resource channel among the multiple resource channels whose available resource amount satisfies the preset resource allocation condition corresponding to the first resource channel, a preset resource scheduling method is used to allocate resources for the multiple resource channels so that the available resource amount of the multiple resource channels satisfies the preset resource balance condition; wherein the preset resource balance condition is that the values ​​of the available resource amounts in the multiple resource channels maintain an absolute balance or a relative balance, and the relative balance is a balance that is proportional to the value of the available resource amount in the resource channel and the throughput of the resource channel; The method further comprises: If it is detected that the available resource amount of the second resource channel among the multiple resource channels is less than the preset minimum resource amount, marking the second resource channel as an unavailable channel; The available resources of the second resource channel are merged into a third resource channel among the multiple resource channels, and the third resource channel is the resource channel with the largest amount of available resources among the multiple resource channels.

2. The method according to claim 1, characterized in that The determining whether the available resource amounts of the plurality of resource channels meet corresponding preset resource scheduling conditions includes: Determining whether the available resource amounts of the multiple resource channels are less than or equal to the corresponding allocation warning resource amounts; If the available resource amount of a resource channel is less than or equal to the corresponding allocation warning resource amount, it is determined that the resource channel meets the corresponding preset resource allocation condition; If the available resource amount of the one resource channel is greater than the corresponding allocation warning resource amount, it is determined that the one resource channel does not meet the corresponding preset resource allocation condition.

3. The method according to claim 2, characterized in that Before allocating resources to the multiple resource channels using a preset resource scheduling method, the method further includes: Calculating average available resource amounts of the multiple resource channels; Determine whether the average available resource amount is higher than the allocation warning resource amount corresponding to the first resource channel; The adopting a preset resource scheduling method to allocate resources to the multiple resource channels includes: If the average available resource amount is higher than the allocation warning resource amount corresponding to the first resource channel, the preset resource scheduling method is used to allocate resources to the multiple resource channels.

4. The method according to claim 1, characterized in that The method further comprises: placing the resource exchange request distributed to the second resource channel into a waiting queue; The resource exchange request in the waiting queue is transferred to the third resource channel, so as to perform a resource exchange operation using the third resource channel.

5. The method according to claim 1, characterized in that The method further comprises: If it is detected that the resource storage operation for any resource channel is completed, the total available resource amount of the multiple resource channels is obtained; Calculate, according to the total available resource amount, a first average available resource amount of a designated resource channel among the multiple resource channels, wherein the designated resource channel includes: a preset unavailable channel, and all available resource channels; If the first average available resource amount is greater than the allocation warning resource amount corresponding to the preset unavailable channel, resources are allocated to the designated resource channels so that the available resource amount of each designated resource channel meets the resource balance condition; The preset unavailable channel is restored as an available channel.

6. The method according to any one of claims 1 to 5, characterized in that: Before obtaining the available resource amounts of the multiple resource channels, the method further includes: Obtaining available resource amounts of the multiple resource channels; Calculating, according to the plurality of resource channels, a second average available resource amount of the plurality of resource channels; According to the second average available resource amount, resources are allocated to the multiple resource channels so that the available resource amounts of the multiple resource channels meet the resource balancing condition.

7. A resource processing device, characterized in that: The device comprises: an acquisition module, a judgment module, and an allocation module; The acquisition module is used to acquire the available resource amounts of multiple resource channels; The judgment module is used to judge whether the available resource amounts of the multiple resource channels meet the corresponding preset resource allocation conditions; wherein the preset resource allocation conditions corresponding to the available resource amounts of the multiple resource channels are that the available resource amounts of the multiple resource channels are less than or equal to the corresponding allocation warning resource amounts, and the formula for the allocation warning resource amounts corresponding to the resource channels is: allocation warning resource amount = weight * maximum single resource output amount * number of channel event processing times per second * resource allocation time; The allocation module is used for, if there is a first resource channel among the multiple resource channels whose available resource amount satisfies the preset resource allocation condition corresponding to the first resource channel, to allocate resources to the multiple resource channels by using a preset resource scheduling method, so that the available resource amount of the multiple resource channels satisfies the preset resource balance condition; wherein the preset resource balance condition is that the values ​​of the available resource amounts in the multiple resource channels maintain an absolute balance or a relative balance, and the relative balance is a balance that is proportional to the value of the available resource amount in the resource channel and the throughput of the resource channel; The device further includes: a processing module, configured to mark the second resource channel as an unavailable channel if it is detected that the available resource amount of the second resource channel among the multiple resource channels is less than a preset minimum resource amount; The allocation module is further used to merge the available resource amount of the second resource channel into a third resource channel among the multiple resource channels, and the third resource channel is the resource channel with the largest amount of available resources among the multiple resource channels.

8. An electronic device, characterized in that: include: A processor, a storage medium and a bus, wherein the storage medium stores program instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the program instructions to perform the steps of the resource processing method as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the resource processing method according to any one of claims 1 to 6 are executed.

Citation Information

Patent Citations

  • Multi-channel fund allocation method and device based on prediction model, equipment and medium

    CN113610634A

  • Goods inventory pre-occupation method and device and goods inventory system

    CN113935694A