A resource processing method and device, computer equipment and storage medium
By acquiring and calculating the resource addition and release thresholds in the account, the system automatically adjusts the amount of resources added and released, solving the cumbersome margin operation problem in resource trading and improving resource utilization.
Patent Information
- Application Number
- CN202111361508.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-17
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2041-11-17
AI Technical Summary
In the process of resource trading, users need to replenish or release margin for each transaction and each margin account, which makes the operation cumbersome and the resource utilization rate low.
By obtaining the used and unused resources in the account, the system determines the addition and release thresholds for each sub-resource, calculates the amount of resources added and released, and automatically adjusts multiple sub-resources based on these amounts, simplifying the operation process and improving resource utilization.
It enables automatic allocation of multiple sub-resources, simplifies the operation of adding and releasing margin, and improves resource utilization.
Smart Images

Figure CN114240056B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, computer device, and storage medium for processing resources. Background Technology
[0002] In existing technologies, during some resource transactions, such as when banks and users enter into transactions involving financial products, users need to open a margin account and pay an initial margin. During the transaction period, as the market changes, the corresponding risk exposure and margin call level will also change. When the margin paid by the user is less than the margin call level, the user needs to pay additional margin to cover all risk exposures; when the margin paid by the user is greater than the risk exposure, the excess funds need to be released.
[0003] However, since a financial product often involves multiple transactions and corresponds to multiple margin accounts, replenishing or releasing margin requires processing each transaction and each margin account individually. This is cumbersome for users and results in low resource utilization in the account. Summary of the Invention
[0004] Therefore, it is necessary to provide a resource processing method, apparatus, computer equipment, and storage medium that can simplify operation and improve resource utilization in response to the above-mentioned technical problems.
[0005] Firstly, this application provides a method for processing resources. The method includes:
[0006] Obtain the first resource of the account, which is the resource of the account that has been used. The resource of the account also includes the second resource that has not been used. The first resource includes multiple sub-resources.
[0007] Obtain the append threshold and release threshold corresponding to each of the plurality of sub-resources;
[0008] The multiple sub-resources are compared with the corresponding addition threshold and release threshold to determine the resource addition amount and resource release amount for each sub-resource.
[0009] The multiple sub-resources are adjusted based on the resource addition amount and the resource release amount.
[0010] In one embodiment, the step of comparing the plurality of sub-resources with the corresponding addition threshold and release threshold to determine the resource addition amount and resource release amount of each sub-resource includes:
[0011] When the sub-resource is less than the additional threshold, the difference between the additional threshold and the sub-resource is determined to be the resource addition amount corresponding to the sub-resource;
[0012] When the sub-resource is greater than the release threshold, the difference between the sub-resource and the release threshold is determined as the resource release amount corresponding to the sub-resource.
[0013] In one embodiment, adjusting the plurality of sub-resources based on the resource addition amount and the resource release amount includes:
[0014] When the total resource addition amount equals the total resource release amount, multiple sub-resources to be added are obtained. The total resource addition amount is the sum of the resource addition amounts of each sub-resource, and the total resource release amount is the sum of the resource release amounts of each sub-resource. The sub-resources to be added are set as resources with a resource addition amount greater than zero.
[0015] The total resource release is allocated to the multiple sub-resources to be added, so that the current stock of the sub-resources to be added reaches the corresponding addition threshold.
[0016] In one embodiment, adjusting the plurality of sub-resources based on the resource addition amount and the resource release amount includes:
[0017] When the total amount of resources added is less than the total amount of resources released, acquire multiple sub-resources to be added and the second resource of the account;
[0018] The total resource release amount is allocated to the multiple sub-resources to be added, so that the current stock of the sub-resources to be added reaches the corresponding addition threshold.
[0019] The difference between the total resource release and the total resource addition is added to the second resource.
[0020] In one embodiment, adjusting the plurality of sub-resources based on the resource addition amount and the resource release amount includes:
[0021] When the total amount of resources added exceeds the total amount of resources released, acquire multiple sub-resources to be added and the second resource of the account;
[0022] Determine the difference between the total resource addition and the total resource release, and obtain the difference from the second resource;
[0023] The total resource release amount and the difference are allocated to the multiple sub-resources to be added, so that the current stock of the sub-resources to be added reaches the corresponding addition threshold.
[0024] In one embodiment, the method of allocating the total resource release amount to the plurality of sub-resources to be added includes:
[0025] Obtain the priority of each of the plurality of sub-resources to be added, wherein the priority is negatively correlated with the amount of resources to be added to the sub-resource;
[0026] Based on the priority, the total resource release amount is allocated to the plurality of sub-resources to be added.
[0027] In one embodiment, adjusting the plurality of sub-resources based on the resource addition amount and the resource release amount includes:
[0028] When the total amount of resources added exceeds the total amount of resources released, acquire multiple sub-resources to be added and the second resource of the account;
[0029] Determine the difference between the total additional resources and the total released resources;
[0030] If the difference is greater than the second resource, the second resource and the total resource release amount will be allocated to the plurality of sub-resources to be added.
[0031] In one embodiment, after allocating the second resource and the total resource release amount to the plurality of sub-resources to be added, the method further includes:
[0032] Mark the sub-resources to be added whose current stock has not reached the corresponding addition threshold.
[0033] Secondly, this application also provides a resource processing apparatus. The apparatus includes:
[0034] The first acquisition module is used to acquire the first resource of the account, which is the resource that has been used in the account. The resource of the account also includes the second resource that has not been used. The first resource includes multiple sub-resources.
[0035] The second acquisition module is used to acquire the append threshold and release threshold corresponding to each of the plurality of sub-resources;
[0036] The comparison module is used to compare the plurality of sub-resources with the corresponding addition threshold and release threshold respectively, and determine the resource addition amount and resource release amount of each sub-resource;
[0037] The adjustment module is used to adjust the multiple sub-resources based on the resource addition amount and the resource release amount.
[0038] In one embodiment, the comparison module includes:
[0039] The first submodule is used to determine the difference between the additional threshold and the sub-resource as the resource addition amount corresponding to the sub-resource when the sub-resource is less than the additional threshold.
[0040] The second submodule is used to determine the difference between the sub-resource and the release threshold as the resource release amount corresponding to the sub-resource when the sub-resource is greater than the release threshold.
[0041] In one embodiment, the adjustment module includes:
[0042] The acquisition module is used to acquire multiple sub-resources to be added when the total resource addition amount equals the total resource release amount. The total resource addition amount is the sum of the resource addition amounts of each sub-resource, and the total resource release amount is the sum of the resource release amounts of each sub-resource. The sub-resources to be added are set as resources with a resource addition amount greater than zero.
[0043] The allocation module is used to allocate the total resource release amount to the multiple sub-resources to be added, so that the current stock of the sub-resources to be added reaches the corresponding addition threshold.
[0044] In one embodiment, the adjustment module includes:
[0045] The acquisition module is used to acquire multiple sub-resources to be added and the second resource of the account when the total resource addition amount is less than the total resource release amount;
[0046] The first allocation module is used to allocate the total resource release amount to the multiple sub-resources to be added, so that the current stock of the sub-resources to be added reaches the corresponding addition threshold.
[0047] The second allocation module is used to add the difference between the total resource release amount and the total resource addition amount to the second resource.
[0048] In one embodiment, the adjustment module includes:
[0049] The first acquisition module is used to acquire multiple sub-resources to be added and the second resource of the account when the total resource addition amount is greater than the total resource release amount;
[0050] The second acquisition module is used to determine the difference between the total resource addition amount and the total resource release amount, and to acquire the difference from the second resource;
[0051] The allocation module is used to allocate the total resource release amount and the difference to the multiple sub-resources to be added, so that the current stock of the sub-resources to be added reaches the corresponding addition threshold.
[0052] In one embodiment, the module that allocates the total resource addition amount to the plurality of sub-resources to be added includes:
[0053] The acquisition module is used to acquire the priority of each sub-resource to be added among the plurality of sub-resources to be added, wherein the priority is negatively correlated with the amount of resources to be added to the sub-resource to be added;
[0054] The allocation module is used to allocate the total resource release amount to the plurality of sub-resources to be added according to the priority.
[0055] In one embodiment, the adjustment module includes:
[0056] The acquisition module is used to acquire multiple sub-resources to be added and the second resource of the account when the total resource addition amount is greater than the total resource release amount;
[0057] The determining module is used to determine the difference between the total resource addition amount and the total resource release amount;
[0058] The allocation module is used to allocate the second resource and the total resource release amount to the plurality of sub-resources to be added when the difference is greater than the second resource.
[0059] In one embodiment, the allocation module is followed by:
[0060] The marking module is used to mark the sub-resources that are yet to be added, whose current stock has not reached the corresponding addition threshold.
[0061] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of any of the methods described in the above embodiments.
[0062] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the steps of any of the methods in the above embodiments.
[0063] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the steps of any of the methods described in the above embodiments.
[0064] The aforementioned resource processing methods, apparatus, computer equipment, storage media, and computer program products acquire the resources already used in an account, as well as the addition and release thresholds corresponding to each sub-resource. Based on the addition and release thresholds, the resource addition and release amounts are determined, and then adjustments are made to multiple sub-resources according to the magnitude of the addition and release amounts. This enables the allocation of multiple sub-resources in the account, simplifies the addition and release operation process, and improves the utilization rate of resources in the account. Attached Figure Description
[0065] Figure 1 This is a flowchart illustrating a resource processing method in one embodiment;
[0066] Figure 2 This is a flowchart illustrating a resource processing method in one embodiment;
[0067] Figure 3 This is a flowchart illustrating a resource processing method in one embodiment;
[0068] Figure 4 This is a flowchart illustrating the initial steps of resource processing in one embodiment;
[0069] Figure 5 This is a flowchart illustrating a resource processing method in one embodiment;
[0070] Figure 6 This is a structural block diagram of a resource processing device in one embodiment;
[0071] Figure 7 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0072] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0073] In one embodiment, such as Figure 1 As shown, a resource processing method is provided. This embodiment illustrates the method applied to a terminal, but it is understood that the method can also be applied to a server, and to a system including both a terminal and a server, and implemented through interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0074] Step S101: Obtain the first resource of the account. The first resource is the resource that has been used in the account. The account's resources also include the second resource that has not been used. The first resource includes multiple sub-resources.
[0075] In this embodiment, the first step is to obtain the resources already used in the account, i.e., the first resources. Typically, these used resources are divided into multiple sub-resources, each corresponding to a business operation, based on each time a user invokes resources in the account for a business operation. In addition to the first resources, the account also includes unused resources, i.e., the second resources. In one example, when a user pre-deposits funds in their account as margin for transactions, each transaction requires a portion of the account funds to be used as margin for that transaction. The margin for each transaction is a sub-resource, and the total margin used by all transactions constitutes the used resources in the account. The remaining funds are the unused second resources.
[0076] Step S102: Obtain the append threshold and release threshold corresponding to each of the plurality of sub-resources;
[0077] In this embodiment, the sub-resources required by each service may change due to various external factors. When the sub-resources required by a service exceed the already occupied sub-resources, additional resources need to be added to the corresponding sub-resources to bring the sub-resources for that service to the required amount. This required amount is the addition threshold. When the occupied sub-resources significantly exceed the required amount, the excess sub-resources can be released. A release threshold can be defined at this time. When the sub-resources occupied by the service exceed the release threshold, the excess portion can be released. Typically, a threshold calculation module is set up according to account type and service type to calculate the addition threshold and release threshold. The threshold calculation module obtains the addition threshold and release threshold for each of the multiple sub-resources. In one example, the release threshold for a sub-resource is usually greater than or equal to the addition threshold for that sub-resource, and the addition thresholds and release thresholds for multiple sub-resources are usually different.
[0078] Step S103: Compare the plurality of sub-resources with the corresponding addition threshold and release threshold respectively to determine the resource addition amount and resource release amount of each sub-resource;
[0079] In this embodiment of the disclosure, after obtaining the addition threshold and release threshold corresponding to each sub-resource, it is necessary to determine the resource addition amount and resource release amount based on the addition threshold and release threshold. Specifically, the portion of each sub-resource less than the addition threshold is the resource addition amount for that sub-resource, and the portion of each sub-resource greater than the release threshold is the resource release amount for that sub-resource. In one example, if the current inventory of a sub-resource is greater than the corresponding addition threshold, the resource addition amount for that sub-resource can be recorded as zero; if the current inventory of a sub-resource is less than the corresponding release threshold, the resource release amount for that sub-resource can be recorded as zero.
[0080] Step S104: Adjust the plurality of sub-resources according to the resource addition amount and the resource release amount.
[0081] In this embodiment of the disclosure, after obtaining the resource addition amount or resource release amount corresponding to each sub-resource in the account, each sub-resource is adjusted according to the sum of all resource addition amounts and the sum of all resource release amounts in the account, so that the sub-resources that need to be added reach the addition threshold and the sub-resources that need to be released reach the release threshold.
[0082] This embodiment of the disclosure obtains the resources already used in the account, as well as the addition and release thresholds corresponding to each sub-resource. The resource addition and release amounts are determined based on the addition and release thresholds, and then the multiple sub-resources are adjusted according to the magnitude of the addition and release amounts. This embodiment of the disclosure eliminates the need to repeatedly obtain resources from unused resources in the account for addition or release resources to be released into the account. Instead, it automatically allocates the addition and release amounts of multiple sub-resources in the first account, thereby enabling the allocation of multiple sub-resources in the account, simplifying the addition and release operation process, and improving the utilization rate of resources in the account.
[0083] Figure 2 This is a flowchart illustrating a resource processing method according to an exemplary embodiment, with reference to... Figure 2As shown, for financial derivatives (such as forward swap foreign exchange transactions) between banks and clients, clients need to open a margin account and pay an initial margin for each transaction. Simultaneously, the risk exposure changes with the valuation of the derivatives during the transaction's duration. When the client's paid margin falls below a certain margin call threshold, they must make up the difference to cover all risk exposures. When the bank's margin system allocates margin, it first retrieves the margin register to determine the valid transactions in the current account. It then retrieves the mark-to-market data for each transaction, calls the mark-to-market margin parameter module, and uses the built-in calculation model to calculate the margin call threshold and transaction exposure for each transaction. Based on the margin register, if the margin used for a transaction is less than the margin call threshold, additional funds are required; if the margin used for a transaction is greater than or equal to the margin call threshold but less than the transaction exposure, no action is needed; if the margin used for a transaction is greater than the transaction exposure, funds need to be released. After determining the amount to be added and the amount to be released, the internal margin allocation management module is called for initial allocation. When the available margin is zero or the margin to be added is zero, no internal allocation is involved; all margin needs to be added or released, without processing in the internal margin allocation management module. When the available margin is greater than or equal to the margin to be added, no additional margin is involved, but internal allocation is involved. All transactions that have not reached the margin call threshold use the available margin to replenish the margin to the threshold. The remaining unused available margin becomes the new available amount, and the margin holding register is updated. When the available margin is greater than zero but less than the margin to be added, additional margin is involved, and internal allocation is involved. All available margin enters the release queue. For transactions that have not reached the margin call threshold, they are sorted in ascending order of the difference between the margin call threshold and the margin already used by the transaction. Available margin is used to allocate to each transaction until the available margin is used up. The margin holding register is updated, the mark-to-market margin calculation module is called again to calculate the amount to be added, and the margin holding register is updated again.
[0084] In one embodiment, comparing the plurality of sub-resources with the corresponding addition threshold and release threshold to determine the resource addition amount and resource release amount for each sub-resource includes:
[0085] When the sub-resource is less than the additional threshold, the difference between the additional threshold and the sub-resource is determined to be the resource addition amount corresponding to the sub-resource;
[0086] When the sub-resource is greater than the release threshold, the difference between the sub-resource and the release threshold is determined as the resource release amount corresponding to the sub-resource.
[0087] In this embodiment of the disclosure, after obtaining the addition threshold and release threshold corresponding to each sub-resource, it is necessary to determine the resource addition amount or resource release amount corresponding to the sub-resource based on the addition threshold and release threshold. Specifically, when the sub-resource is less than the addition threshold, the difference between the addition threshold and the sub-resource is obtained, and this difference is the resource addition amount corresponding to the sub-resource; when the sub-resource is greater than the release threshold, the difference between the sub-resource and the release threshold is obtained, and this difference is the resource release amount corresponding to the sub-resource.
[0088] In this embodiment of the disclosure, the resource addition amount or resource release amount corresponding to each sub-resource is determined based on the obtained addition threshold and release threshold. This embodiment of the disclosure can obtain the resource addition amount or resource release amount corresponding to each sub-resource among the resources that have been used in the account, thereby enabling subsequent resource allocation.
[0089] In one embodiment, adjusting the plurality of sub-resources based on the resource addition amount and the resource release amount includes:
[0090] When the total resource addition amount equals the total resource release amount, multiple sub-resources to be added are obtained. The total resource addition amount is the sum of the resource addition amounts of each sub-resource, and the total resource release amount is the sum of the resource release amounts of each sub-resource. The sub-resources to be added are set as resources with a resource addition amount greater than zero.
[0091] The total resource release is allocated to the multiple sub-resources to be added, so that the current stock of the sub-resources to be added reaches the corresponding addition threshold.
[0092] In this embodiment, after obtaining the resource addition and release amounts corresponding to all used sub-resources in the account, the total resource addition and release amounts are compared. When the total resource addition and release amounts are equal, multiple sub-resources with resource addition amounts greater than zero are obtained; these multiple sub-resources are the sub-resources to be added. Since the total resource addition and release amounts are the same at this time, it is only necessary to allocate the total resource release amount to all sub-resources to be added. During allocation, when the current inventory of a sub-resource reaches the corresponding addition threshold, the addition of that sub-resource is completed. When all sub-resources to be added are completed, the allocation is finished.
[0093] In this embodiment of the disclosure, when the total amount of resource additions equals the total amount of resource releases, all resource releases are allocated to all resources to be added. This embodiment of the disclosure enables direct allocation of multiple sub-resources when the total amount of resource additions equals the total amount of resource releases, ensuring that all sub-resources meet business requirements.
[0094] In one embodiment, adjusting the plurality of sub-resources based on the resource addition amount and the resource release amount includes:
[0095] When the total amount of resources added is less than the total amount of resources released, acquire multiple sub-resources to be added and the second resource of the account;
[0096] The total resource release amount is allocated to the multiple sub-resources to be added, so that the current stock of the sub-resources to be added reaches the corresponding addition threshold.
[0097] The difference between the total resource release and the total resource addition is added to the second resource.
[0098] In this embodiment, after obtaining the resource addition and release amounts corresponding to all used sub-resources in the account, the total resource addition and release amounts are compared. When the total resource addition is less than the total resource release, multiple sub-resources with resource addition amounts greater than zero are obtained; these multiple sub-resources are the sub-resources to be added. Because the total resource addition is less than the total resource release at this time, a portion of the resource release amount needs to be allocated to the sub-resources to be added. During allocation, when the current stock of the sub-resource reaches the corresponding addition threshold, the sub-resource is added. When all sub-resources to be added are added, there is still a remaining resource release amount. At this time, the remaining resource release amount is added to the second resource, that is, the remaining resource release amount becomes the unused resource in the account.
[0099] In this embodiment, when the total amount of resources added is less than the total amount of resources released, a portion of the released resources is allocated to all resources to be added, and the remaining released resources are added to the second resource. This embodiment can allocate multiple sub-resources when the total amount of resources added is less than the total amount of resources released, ensuring that all sub-resources meet business requirements, while releasing excess released resources to the second resource, thereby improving resource utilization.
[0100] In one embodiment, adjusting the plurality of sub-resources based on the resource addition amount and the resource release amount includes:
[0101] When the total amount of resources added exceeds the total amount of resources released, acquire multiple sub-resources to be added and the second resource of the account;
[0102] Determine the difference between the total resource addition and the total resource release, and obtain the difference from the second resource;
[0103] The total resource release amount and the difference are allocated to the multiple sub-resources to be added, so that the current stock of the sub-resources to be added reaches the corresponding addition threshold.
[0104] In this embodiment, after obtaining the resource addition and release amounts corresponding to all used sub-resources in the account, the total resource addition and release amounts are compared. When the total resource addition is greater than the total resource release, multiple sub-resources with resource addition amounts greater than zero are obtained; these multiple sub-resources are the sub-resources to be added. Because the total resource addition is greater than the total resource release at this time, the total release amount cannot cover the total addition. The additional amount that the release amount cannot cover needs to be obtained from the second resource. The difference between the total resource addition and the total resource release is determined; this difference is the portion that the release amount cannot cover. This difference is obtained from the unoccupied resources in the account, i.e., the second resource. The total resource release and the difference obtained from the second resource are allocated to all the sub-resources to be added. During allocation, when the current stock of a sub-resource reaches the corresponding addition threshold, the sub-resource is added. The allocation ends when all sub-resources to be added are added.
[0105] In this embodiment, when the total resource addition amount exceeds the total resource release amount, the difference between the addition amount and the release amount is obtained from the second resource, and all resource release amounts and the obtained difference are allocated to all sub-resources to be added. This embodiment can, when the total resource addition amount exceeds the total resource release amount, obtain the portion that the release amount cannot fully cover from the second resource and allocate it to multiple sub-resources to be added, ensuring that all sub-resources meet business requirements.
[0106] In one embodiment, the method of allocating the total resource release amount to the plurality of sub-resources to be added includes:
[0107] Obtain the priority of each of the plurality of sub-resources to be added, wherein the priority is negatively correlated with the amount of resources to be added to the sub-resource;
[0108] Based on the priority, the total resource release amount is allocated to the plurality of sub-resources to be added.
[0109] In this embodiment of the disclosure, when allocating the total resource release amount to the sub-resources to be added, it is first necessary to obtain the priority of all sub-resources to be added. This priority is negatively correlated with the size of the resource addition amount corresponding to each sub-resource; that is, the smaller the resource addition amount of the sub-resource to be added, the higher the priority of that sub-resource. The total resource release amount is allocated to the sub-resources to be added, and the allocation order is based on the obtained priority of the sub-resources to be added. During allocation, when the current stock of a sub-resource reaches the corresponding addition threshold, the addition of that sub-resource is completed. After all release amounts have been allocated, the difference between the addition amount and the release amount is obtained from the second resource and allocated accordingly.
[0110] In this embodiment, the priority of the sub-resources to be added is obtained, and the total resource release amount is allocated to the sub-resources to be added according to the priority order. This embodiment can allocate sub-resources according to a preset priority, ensuring the orderliness of the allocation.
[0111] In one embodiment, adjusting the plurality of sub-resources based on the resource addition amount and the resource release amount includes:
[0112] When the total amount of resources added exceeds the total amount of resources released, acquire multiple sub-resources to be added and the second resource of the account;
[0113] Determine the difference between the total additional resources and the total released resources;
[0114] If the difference is greater than the second resource, the second resource and the total resource release amount will be allocated to the plurality of sub-resources to be added.
[0115] In this embodiment, after obtaining the resource addition and release amounts corresponding to all used sub-resources in the account, the total resource addition and release amounts are compared. When the total resource addition is greater than the total resource release, multiple sub-resources with resource addition amounts greater than zero are obtained; these multiple sub-resources are the sub-resources to be added. Because the total resource addition is greater than the total resource release at this time, the total release amount cannot cover the total addition. In this case, the addition amount that the release amount cannot cover needs to be obtained from the second resource. When the difference between the total resource addition and the total resource release is greater than the current stock in the second resource, the total resource release and the second resource are allocated to the sub-resources to be added according to the resource addition amount. In one example, when allocating the total resource release and the second resource to the sub-resources to be added, it is usually necessary to allocate according to a certain priority, which can be negatively correlated with the size of the resource addition amount corresponding to each sub-resource.
[0116] In this embodiment of the disclosure, when the sum of the total resource release and the second resource exceeds the total resource addition, all resource releases and the second resource are allocated to the sub-resources to be added. This embodiment of the disclosure maximizes resource utilization by allocating all resource releases and the second resource to the sub-resources to be added when the sum of the total resource release and the second resource exceeds the total resource addition.
[0117] In one embodiment, after allocating the second resource and the total resource release amount to the plurality of sub-resources to be added, the method further includes:
[0118] Mark the sub-resources to be added whose current stock has not reached the corresponding addition threshold.
[0119] In this embodiment of the disclosure, when the sum of the total resource release and the second resource is greater than the total resource addition, allocating all resource release and the second resource to the sub-resources to be added still cannot cover all the resource additions. In this case, it is necessary to mark the sub-resources to be added that still cannot reach the corresponding addition threshold after the allocation is completed, and send the marking information to the relevant users for further processing by the users.
[0120] In this embodiment of the disclosure, if all available resources for an account are still insufficient to reach the additional threshold for all sub-resources, resources that have not reached the additional threshold are marked. This embodiment of the disclosure can mark sub-resources that cannot meet business needs after allocation, so that users can perform subsequent processing on the relevant sub-resources.
[0121] Figure 3 This is a flowchart illustrating a resource processing method according to an exemplary embodiment, with reference to... Figure 3 As shown, when a user allocates margin, after the initial allocation is completed by calling the internal margin allocation module, it checks whether the available margin after allocation is greater than zero. If it is greater than zero, all available margin is released directly to the account system, the margin register is updated, and the allocation is complete. If it is not greater than zero, it checks whether the amount to be added is greater than zero. If the amount to be added is not greater than zero, the margin register is updated, and the allocation is complete. If the amount to be added is greater than zero, the account system is called, and the unused amount in the account is used to add the margin. If the remaining amount in the account is greater than or equal to the amount to be added, the entire amount to be added is added directly. If the remaining amount in the account is less than the amount to be added, the amount to be added is allocated according to the order of the amount to be added for each transaction from smallest to largest. After all the remaining amount in the account is allocated, the margin register is updated. The margin register is typically used to record the initial margin usage and mark-to-market margin usage for each transaction.
[0122] Figure 4 This is a flowchart illustrating an initial step of resource processing according to an exemplary embodiment, with reference to... Figure 4 As shown, when each transaction is initiated, the margin parameter module needs to be called to calculate the initial margin amount and determine whether the available balance in the margin account is sufficient. If it is insufficient, the transaction is rejected; if it is sufficient, the corresponding amount is frozen to continue the transaction processing, and the occupancy register is updated synchronously. The margin parameter management module can set initial margin and mark-to-market margin ratios based on product characteristics, from multiple dimensions such as product, term, and currency. These parameters are used to calculate the initial margin amount and the mark-to-market margin call level.
[0123] Figure 5This is a flowchart illustrating a resource processing method according to an exemplary embodiment, with reference to... Figure 5 As shown, when the business is terminated, the margin register is called to retrieve the margin occupied by the terminated business, and all frozen initial margin and mark-to-market margin corresponding to the terminated business are released, and the margin register is updated.
[0124] It should be understood that although the steps in the flowcharts in the accompanying drawings are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some of the steps in the accompanying drawings may include multiple steps or stages, which are not necessarily completed at the same time, but may be executed at different times, and the execution order of these steps or stages is not necessarily sequential, but may be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0125] Based on the same inventive concept, this application also provides a resource processing apparatus for implementing the resource processing method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations of one or more resource processing apparatus embodiments provided below can be found in the limitations of the resource processing method described above, and will not be repeated here.
[0126] In one embodiment, such as Figure 6 As shown, a resource processing apparatus is provided, the apparatus comprising:
[0127] The first acquisition module is used to acquire the first resource of the account, which is the resource that has been used in the account. The resource of the account also includes the second resource that has not been used. The first resource includes multiple sub-resources.
[0128] The second acquisition module is used to acquire the append threshold and release threshold corresponding to each of the plurality of sub-resources;
[0129] The comparison module is used to compare the plurality of sub-resources with the corresponding addition threshold and release threshold respectively, and determine the resource addition amount and resource release amount of each sub-resource;
[0130] The adjustment module is used to adjust the multiple sub-resources based on the resource addition amount and the resource release amount.
[0131] In one embodiment, the comparison module includes:
[0132] The first submodule is used to determine the difference between the additional threshold and the sub-resource as the resource addition amount corresponding to the sub-resource when the sub-resource is less than the additional threshold.
[0133] The second sub-determination module is used to determine the difference between the sub-resource and the release threshold as the resource release amount corresponding to the sub-resource when the sub-resource is greater than the release threshold.
[0134] In one embodiment, the adjustment module includes:
[0135] The acquisition module is used to acquire multiple sub-resources to be added when the total resource addition amount equals the total resource release amount. The total resource addition amount is the sum of the resource addition amounts of each sub-resource, and the total resource release amount is the sum of the resource release amounts of each sub-resource. The sub-resources to be added are set as resources with a resource addition amount greater than zero.
[0136] The allocation module is used to allocate the total resource release amount to the multiple sub-resources to be added, so that the current stock of the sub-resources to be added reaches the corresponding addition threshold.
[0137] In one embodiment, the adjustment module includes:
[0138] The acquisition module is used to acquire multiple sub-resources to be added and the second resource of the account when the total resource addition amount is less than the total resource release amount;
[0139] The first allocation module is used to allocate the total resource release amount to the multiple sub-resources to be added, so that the current stock of the sub-resources to be added reaches the corresponding addition threshold.
[0140] The second allocation module is used to add the difference between the total resource release amount and the total resource addition amount to the second resource.
[0141] In one embodiment, the adjustment module includes:
[0142] The first acquisition module is used to acquire multiple sub-resources to be added and the second resource of the account when the total resource addition amount is greater than the total resource release amount;
[0143] The second acquisition module is used to determine the difference between the total resource addition amount and the total resource release amount, and to acquire the difference from the second resource;
[0144] The allocation module is used to allocate the total resource release amount and the difference to the multiple sub-resources to be added, so that the current stock of the sub-resources to be added reaches the corresponding addition threshold.
[0145] In one embodiment, allocating the total resource addition amount to the plurality of sub-resources to be added includes:
[0146] The acquisition module is used to acquire the priority of each sub-resource to be added among the plurality of sub-resources to be added, wherein the priority is negatively correlated with the amount of resources to be added to the sub-resource to be added;
[0147] The allocation module is used to allocate the total resource release amount to the plurality of sub-resources to be added according to the priority.
[0148] In one embodiment, the adjustment module includes:
[0149] The acquisition module is used to acquire multiple sub-resources to be added and the second resource of the account when the total resource addition amount is greater than the total resource release amount;
[0150] The determining module is used to determine the difference between the total resource addition amount and the total resource release amount;
[0151] The allocation module is used to allocate the second resource and the total resource release amount to the plurality of sub-resources to be added when the difference is greater than the second resource.
[0152] In one embodiment, the allocation module further includes:
[0153] The marking module is used to mark the sub-resources that are yet to be added, whose current stock has not reached the corresponding addition threshold.
[0154] Each module in the aforementioned resource processing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can invoke and execute the operations corresponding to each module.
[0155] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 7 As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores resource data. The network interface communicates with external terminals via a network connection. When the computer program is executed by the processor, it implements a resource processing method.
[0156] Those skilled in the art will understand that Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0157] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.
[0158] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.
[0159] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0160] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0161] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0162] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0163] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for processing resources, characterized in that, The method includes: Obtain the first resource of the account, which is the resource of the account that has been used. The resource of the account also includes the second resource that has not been used. The first resource includes multiple sub-resources. Obtain the append threshold and release threshold corresponding to each of the multiple sub-resources; wherein the append threshold and the release threshold are calculated using a threshold calculation module, which is set according to the account type and business type of the account; The multiple sub-resources are compared with the corresponding addition threshold and release threshold to determine the resource addition amount and resource release amount for each sub-resource. The plurality of sub-resources are adjusted according to the resource addition amount and the resource release amount; wherein, adjusting the plurality of sub-resources includes: adjusting each sub-resource according to the sum of all resource addition amounts and the sum of all resource release amounts in the account, so that the sub-resources that need to be added reach the corresponding addition threshold and the sub-resources that need to be released reach the corresponding release threshold.
2. The method according to claim 1, characterized in that, The step of comparing the plurality of sub-resources with the corresponding addition threshold and release threshold to determine the resource addition amount and resource release amount for each sub-resource includes: When the sub-resource is less than the additional threshold, the difference between the additional threshold and the sub-resource is determined to be the resource addition amount corresponding to the sub-resource; When the sub-resource is greater than the release threshold, the difference between the sub-resource and the release threshold is determined as the resource release amount corresponding to the sub-resource.
3. The method according to claim 1, characterized in that, The adjustment of the plurality of sub-resources based on the resource addition amount and the resource release amount includes: When the total resource addition amount equals the total resource release amount, multiple sub-resources to be added are obtained. The total resource addition amount is the sum of the resource addition amounts of each sub-resource, and the total resource release amount is the sum of the resource release amounts of each sub-resource. The sub-resources to be added are set as resources with a resource addition amount greater than zero. The total resource release is allocated to the multiple sub-resources to be added, so that the current stock of the sub-resources to be added reaches the corresponding addition threshold.
4. The method according to claim 1, characterized in that, The adjustment of the plurality of sub-resources based on the resource addition amount and the resource release amount includes: When the total amount of resources added is less than the total amount of resources released, acquire multiple sub-resources to be added and the second resource of the account; The total resource release amount is allocated to the multiple sub-resources to be added, so that the current stock of the sub-resources to be added reaches the corresponding addition threshold. The difference between the total resource release and the total resource addition is added to the second resource.
5. The method according to claim 1, characterized in that, The adjustment of the plurality of sub-resources based on the resource addition amount and the resource release amount includes: When the total amount of resources added exceeds the total amount of resources released, acquire multiple sub-resources to be added and the second resource of the account; Determine the difference between the total resource addition and the total resource release, and obtain the difference from the second resource; The total resource release amount and the difference are allocated to the multiple sub-resources to be added, so that the current stock of the sub-resources to be added reaches the corresponding addition threshold.
6. The method according to claim 5, characterized in that, The methods for allocating the total resource release amount to the multiple sub-resources to be added include: Obtain the priority of each of the plurality of sub-resources to be added, wherein the priority is negatively correlated with the amount of resources to be added to the sub-resource; Based on the priority, the total resource release amount is allocated to the plurality of sub-resources to be added.
7. The method according to claim 1, characterized in that, The adjustment of the plurality of sub-resources based on the resource addition amount and the resource release amount includes: When the total amount of resources added exceeds the total amount of resources released, acquire multiple sub-resources to be added and the second resource of the account; Determine the difference between the total additional resources and the total released resources; If the difference is greater than the second resource, the second resource and the total resource release amount will be allocated to the plurality of sub-resources to be added.
8. The method according to claim 7, characterized in that, After allocating the second resource and the total resource release amount to the plurality of sub-resources to be added, the process further includes: Mark the sub-resources to be added whose current stock has not reached the corresponding addition threshold.
9. A resource processing apparatus, characterized in that, The device includes: The first acquisition module is used to acquire the first resource of the account, which is the resource that has been used in the account. The resource of the account also includes the second resource that has not been used. The first resource includes multiple sub-resources. The second acquisition module is used to acquire the append threshold and release threshold corresponding to each of the plurality of sub-resources; wherein the append threshold and the release threshold are calculated using a threshold calculation module, which is set according to the account type and business type of the account; The comparison module is used to compare the plurality of sub-resources with the corresponding addition threshold and release threshold respectively, and determine the resource addition amount and resource release amount of each sub-resource; The adjustment module is used to adjust the plurality of sub-resources according to the resource addition amount and the resource release amount; wherein, adjusting the plurality of sub-resources includes: adjusting each sub-resource according to the sum of all resource addition amounts and the sum of all resource release amounts in the account, so that the sub-resources that need to be added reach the corresponding addition threshold and the sub-resources that need to be released reach the corresponding release threshold.
10. The apparatus according to claim 9, characterized in that, The comparison module includes: The first submodule is used to determine the difference between the additional threshold and the sub-resource as the resource addition amount corresponding to the sub-resource when the sub-resource is less than the additional threshold. The second submodule is used to determine the difference between the sub-resource and the release threshold as the resource release amount corresponding to the sub-resource when the sub-resource is greater than the release threshold.
11. The apparatus according to claim 9, characterized in that, The adjustment module includes: The acquisition module is used to acquire multiple sub-resources to be added when the total resource addition amount equals the total resource release amount. The total resource addition amount is the sum of the resource addition amounts of each sub-resource, and the total resource release amount is the sum of the resource release amounts of each sub-resource. The sub-resources to be added are set as resources with a resource addition amount greater than zero. The allocation module is used to allocate the total resource release amount to the multiple sub-resources to be added, so that the current stock of the sub-resources to be added reaches the corresponding addition threshold.
12. The apparatus according to claim 9, characterized in that, The adjustment module includes: The acquisition module is used to acquire multiple sub-resources to be added and the second resource of the account when the total resource addition amount is less than the total resource release amount; The first allocation module is used to allocate the total resource release amount to the multiple sub-resources to be added, so that the current stock of the sub-resources to be added reaches the corresponding addition threshold. The second allocation module is used to add the difference between the total resource release amount and the total resource addition amount to the second resource.
13. The apparatus according to claim 9, characterized in that, The adjustment module includes: The first acquisition module is used to acquire multiple sub-resources to be added and the second resource of the account when the total resource addition amount is greater than the total resource release amount; The second acquisition module is used to determine the difference between the total resource addition amount and the total resource release amount, and to acquire the difference from the second resource; The allocation module is used to allocate the total resource release amount and the difference to the multiple sub-resources to be added, so that the current stock of the sub-resources to be added reaches the corresponding addition threshold.
14. The apparatus according to claim 13, characterized in that, The module that allocates the total resource release amount to the multiple sub-resources to be added includes: The acquisition module is used to acquire the priority of each sub-resource to be added among the plurality of sub-resources to be added, wherein the priority is negatively correlated with the amount of resources to be added to the sub-resource to be added; The allocation module is used to allocate the total resource release amount to the plurality of sub-resources to be added according to the priority.
15. The apparatus according to claim 9, characterized in that, The adjustment module includes: The acquisition module is used to acquire multiple sub-resources to be added and the second resource of the account when the total resource addition amount is greater than the total resource release amount; The determining module is used to determine the difference between the total resource addition amount and the total resource release amount; The allocation module is used to allocate the second resource and the total resource release amount to the plurality of sub-resources to be added when the difference is greater than the second resource.
16. The apparatus according to claim 15, characterized in that, The allocation module further includes: The marking module is used to mark the sub-resources that are yet to be added, whose current stock has not reached the corresponding addition threshold.
17. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 8.
18. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 8.
19. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Resource processing method and device, electronic equipment and medium
CN110795237A
Resource processing method, resource processing device, electronic equipment and medium
CN111445232A