Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be described in detail and completely with reference to the following specific embodiments of the present application and the accompanying drawings. It should be apparent that the described embodiments are only some of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Referring to fig. 1, a method for processing resources provided in the embodiment of the present application specifically includes the following steps:
s01: a batch of resource applications is received.
The user registers the user name in a server of the cloud storage service provider in a mode that the user submits the identity information of the user through the Internet. The cloud storage facilitator may thus provide cloud storage space for the user. Subsequently, when the user prepares to acquire a certain amount of cloud storage space at the server of the cloud storage service provider, the user performs the operation of acquiring the cloud storage space on the computer terminal. When the server of the cloud storage service provider receives the application for acquiring the cloud storage space input by the user, the cloud storage space with a certain capacity applied by the user can be divided from the residual cloud storage space of the server of the cloud storage service provider. Within a certain time period, a plurality of users may issue such resource applications to the server of the cloud storage facilitator.
A certain number of resource applications, or resource applications in a time period, may be used as a batch of resource applications. For example, 500 resource applications, or resource applications within 1 minute may be used as a batch of resource applications. The server may receive a batch of resource applications via a data transfer protocol. Of course, a batch of resource applications may involve multiple users, or may involve only one user.
S02: and determining the total amount corresponding to the resource application of the batch.
The server may determine, in a manner of parsing the resource application, a total amount of resource applications involved in the batch of resource applications, for example, a capacity of the cloud storage space.
S03: determining the resource balance of the service system.
The server can calculate the resource balance of the service system according to the difference between the total resource amount and the allocated resource amount. For example, the cloud storage space has a capacity of 1T left.
Further, in another embodiment provided by the present application, determining the resource balance of the service system specifically includes:
determining the actual knot allowance and the user release amount;
and determining the sum of the two as the resource balance.
The balance of resources of the service system may include the actual balance of resources of the service system and resources released by the user. Specifically, for example, the server actually has a balance of 10T of storage capacity after allocating the cloud storage space, however, when a resource application for a batch is performed, a storage capacity of 5T is released by a plurality of users, the 5T cloud storage space may be further allocated, and a sum of the storage capacity of 10T cloud storage space and the storage capacity of 5T cloud storage space of 15T of cloud storage space may be used as the balance of the cloud storage space. Thus, the resource balance can be dynamically managed, and the processing efficiency of the resource application can be improved on the premise of preventing the risk of resource overdraft.
S04: and when the total amount is not more than the resource balance, sending a message that the resource application record is successful to the service system, so that the service system allocates resources for the users corresponding to the resource application of the batch.
And when the total amount corresponding to the resource application of the batch is not more than the resource balance, indicating that the resources of the server are not overdrawn, and allocating the resources to the user. For example, if the total amount of the cloud storage space application of one batch is 1T, and the balance of the cloud storage space of the server is greater than or equal to 1T, a message that the application recording is successful is sent to the service system, so that the service system allocates resources for the user performing the resource application.
In the embodiment provided by the application, the total amount corresponding to the resource application of one batch is compared with the resource balance, and when the total amount corresponding to the resource application of the batch is not greater than the resource balance, a message that the resource application record is successful is sent to the service system, so that the service system allocates resources for the user corresponding to the resource application of the batch. Therefore, on the premise of preventing resource overdraft, the message that the resource application record is successful is sent to the service system, so that the service system allocates resources for the users corresponding to the resource application of the batch, the processing efficiency of the resource application is improved, the queuing waiting time of the users is reduced, and the user experience satisfaction is improved.
Further, in another embodiment provided by the present application, when the total amount is not greater than the resource balance, sending a message that the resource application recording is successful to the service system specifically includes:
when the total amount is not more than the resource balance, a message of successful resource application record is sent to the service system in real time;
and processing the resource applications of the users in the batch one by one within preset time after the message of successful resource application record is sent out to form resource processing records.
In the embodiment, the time for sending the message that the resource application record is successful to the service system and the time for processing the resource application of the users in the batch one by one have the interval of the preset time, so that the server can conveniently and intensively calculate the total amount of the resource application, resource overdraft is prevented, and the resource application of the users in the batch is processed one by one in the idle time after the server calculates the total amount of the resource application to form the resource processing record. Specifically, suppose that 1 ten thousand users send applications of the cloud storage space to the server within 1 minute, and when the total application capacity of the cloud storage space is not greater than the balance capacity of the cloud storage space of the server, a message that application recording is successful can be immediately sent to the service system, so as to continue to calculate applications of the cloud storage space in the next 1 minute. And in the idle time when the server completes calculation, processing the resource applications of the users in the batch one by one to form resource processing records, so that the task load of the server can be balanced, and the processing efficiency is improved. For example, the server processes the resource application of the user a to form the balance capacity of the cloud storage space after the resource application of the user a is processed, and then sequentially processes the resource application of the user b to form the balance capacity of the cloud storage space after the resource application of the user b is processed.
Further, in another embodiment provided herein, the method further includes:
and when the total amount is larger than the resource balance, sending an intermediate message of failure of resource application record to the service system.
Specifically, for example, 1 ten thousand users issue applications of the cloud storage space to the server within 1 minute, the total application capacity of the cloud storage space is 10T, and at this time, if the balance amount of the cloud storage space of the server is only 5T, an intermediate message indicating that the cloud storage space application recording fails is issued to the business system. When the total amount is larger than the resource balance, the server sends an intermediate message of failure in applying and recording the cloud storage space to the service system, and can feed back in time so as to perform subsequent targeted processing, thereby improving the processing efficiency of resource application.
Further, in another embodiment provided herein, the method further includes:
and taking one batch as a unit, searching the first number of batches to ensure that the total amount corresponding to the resource application in the first number of batches is not more than the resource balance, and sending a message that the resource application record of the first number of batches is successful to the service system.
Specifically, taking the above situation as an example, 1 ten thousand users send an application of the cloud storage space to the server within 1 minute, the total application capacity of the cloud storage space is 10T, and at this time, if the balance amount of the cloud storage space of the server is only 5T, an intermediate message indicating that the application of the cloud storage space fails to be recorded is sent to the service system. It is assumed that the batch is divided with reference to time, for example, with resources within 1 minute as one batch. Then, 10 batches of resource applications may be searched, in the 10 batches, assuming that the total application capacity of the cloud storage space is 50T, the actual balance of the cloud storage space of the server is only 5T, and the capacity of the cloud storage space released by the user is 60T, and a total amount 50T corresponding to the resource applications of the cloud storage space of the 10 batches of resource applications is not greater than the resource balance of the cloud storage space of 65T, a message that the cloud storage space application records of the 10 batches are successful may be sent to the business system, so that the business system allocates resources to the corresponding user performing the resource application. Therefore, on the premise of preventing resource overdraft, a plurality of batches of resource applications can be processed at one time, and the processing efficiency of the resource applications is improved.
A specific application scenario of the embodiment of the present application is described as follows:
the server of the cloud storage service provider receives a batch of cloud storage space applications, for example, 500 cloud storage space applications. The server analyzes the application of the cloud storage space of the batch, and supposes that the application of the cloud storage space of the batch is determined to require the acquisition of the cloud storage space with the capacity of 1T. And the server calculates the balance amount of the cloud storage space according to the difference between the total amount of the cloud storage space and the allocated cloud storage space. And if the calculated balance of the cloud storage space is greater than or equal to the application capacity of the cloud storage space of 1T, the server sends a message that the application recording of the cloud storage space is successful to a service system for distributing the cloud storage space, so that the service system distributes resources for the user corresponding to the cloud storage space application of the batch. And when the calculated balance amount of the cloud storage space is smaller than the application capacity of the cloud storage space of 1T, the server sends an intermediate message of failure in cloud storage space application record to a service system for distributing the cloud storage space, so that subsequent processing is facilitated. The subsequent processing may be to search the first number of batches, so that the total amount corresponding to the application of the cloud storage space in the first number of batches is not greater than the balance amount of the cloud storage space.
Further, referring to fig. 2, the present application also provides another resource processing method, where a computer executes the following steps:
s11: a request for a service payment for an account within a batch is received.
When the actual service occurs in the service system, a payment request for the service is sent to the server. For example, a user A has a transaction and needs to pay an amount of money to the other party. In the case of high concurrency of the service, for example, the account of the user A has 5000 service payment requests within 1 minute. The server may receive a batch of business payment requests for the account. Of course, the batch of service payment requests for an account here may also be several service payment requests, or service payment requests within a period, specifically, for example, 5000 service payment requests, or service payment requests within 1 minute.
S12: a total amount of payment for the account number within the batch is determined.
The server may determine the total amount of payment involved in the batch of business payment requests by parsing the business payment requests.
S13: and determining the fund balance of the account in the service system.
The server may query for the funds balance of the account.
Further, in another embodiment provided by the present application, determining a fund balance of the account in the business system specifically includes:
determining an actual funds balance and a funds remittance amount for the account;
determining the sum of the actual fund balance and the fund remittance amount as the fund balance.
The fund balance of the account may include the actual fund balance of the account in the business system prior to the business payment request and the amount of the fund remittance of the account when processing the business payment request. Specifically, for example, the account has an actual fund balance of 10 ten thousand yuan before a service payment request is made in the service system, and when the service payment request is processed, 5 ten thousand yuan is remitted by the account, and a sum of remitted amounts of 10 ten thousand yuan and 5 ten thousand yuan of the actual fund balance and 15 ten thousand yuan can be used as the fund balance. Therefore, the fund under the account can be dynamically managed, and the processing efficiency of the business payment request can be improved on the premise of preventing the fund overdraft risk.
S14: and when the total payment amount is not greater than the fund balance, sending a message that the business payment request record is successful to the business system, so that the business system distributes funds for the user who makes the business payment request.
The server can compare the total payment amount and the fund balance aiming at the account number in the batch, and when the total payment amount is not more than the fund balance, the server sends a message that the business payment request record is successful to the business system, so that the business system distributes fund-payment for the user who makes the business payment request.
In the embodiment provided by the application, the total payment amount corresponding to a batch of service payment requests is compared with the fund balance once, and when the total payment amount is not greater than the fund balance, a message that the service payment request is recorded successfully is sent to the service system, so that the service system distributes fund-payment for the user who makes the service payment request. Therefore, on the premise of preventing fund overdraft, the information that the business payment request is recorded successfully is sent to the business system, so that the business system distributes funds for the user who proposes the business payment request, the processing efficiency of the business payment request is improved, the queuing waiting time of the user is reduced, and the user experience satisfaction is improved.
Further, in another embodiment provided by the present application, when the total payment amount is not greater than the fund balance, sending a message that the service payment request record is successful to the service system specifically includes:
when the total payment amount is not greater than the fund balance, immediately sending a message of successful business payment request record to a business system;
and processing the service payment requests of the account in batches one by one within a preset time after the message that the service payment request record is successful is sent out to form a fund processing record.
Specifically, for example, when the total payment amount is not greater than the fund balance, the server immediately sends a message that the business payment request record is successful to the business system, and within 10 minutes after the message that the business payment request record is successful is sent, the server processes the business payment requests of the account in the batch one by one to form the fund balance change detail record of the account. Of course, various documents at the time of the service payment request may also be archived in the form of attachments. In the idle time when the server completes account fund balance calculation and determines the total amount calculation of the batch of service payment requests, the service payment requests of the users in the batch are processed one by one to form a fund balance change detail record of the account, so that the task load of the server can be balanced, and the processing efficiency is improved.
Further, in another embodiment provided herein, the method further includes:
and when the total payment amount is larger than the fund balance, sending an intermediate message of business payment request record failure.
Specifically, for example, 1 ten thousand users send service payment requests to the server within 1 minute, the total payment amount of the service payment requests is 10 ten thousand yuan, and at this time, if the fund balance of the account is only 5 ten thousand yuan, an intermediate message indicating that the service payment request record fails is sent to the service system. When the total payment amount is larger than the fund balance, the server sends an intermediate message of failure recording of the service payment request to the service system, and can feed back in time so as to perform subsequent targeted processing, thereby improving the processing efficiency of the service payment request.
Further, in another embodiment provided herein, the method further includes:
and taking one batch as a unit, searching the batch with the first quantity, enabling the total payment amount corresponding to the service payment request aiming at one account number in the batch with the first quantity to be not more than the fund balance, and sending a message that the record of the service payment request of the batch with the first quantity is successful to the service system.
Specifically, taking the above situation as an example, if 1 ten thousand users send service payment requests to the server within 1 minute, the total payment amount is 10 ten thousand yuan, and at this time, if the fund balance of the account is only 5 ten thousand yuan, an intermediate message indicating that the service payment request record fails is sent to the service system. It is assumed that the batch is divided with reference to time, for example, with resources within 1 minute as one batch. Then, 10 batches of service payment requests can be searched, and in the 10 batches, assuming that the total payment amount is 50 ten thousand yuan, the actual fund balance of the account is only 5 ten thousand yuan, and the fund remittance amount for the account is 60 ten thousand yuan, and in the 10 batches of service payment requests, the total payment amount of 50 ten thousand yuan is not more than 65 ten thousand yuan, a message that the service payment request records of the 10 batches are successful can be sent to the service system, so that the service system pays the user who makes the service payment request. Therefore, on the premise of preventing fund overdraft, a plurality of batches of service payment requests can be processed at one time, and the processing efficiency of the service payment requests is improved.
A specific application scenario of the embodiment of the present application is described as follows:
the server receives a batch of service payment requests, for example, 500 service payment requests. The server parses the batch of business payment requests, assuming that it is determined that the batch of business payment requests requires 1 ten thousand dollars of payment. The server calculates the fund balance according to the difference between the total amount of the account and the amount which is paid. And if the calculated fund balance is greater than or equal to 1 ten thousand yuan, the server sends a message that the business payment request record is successful to a business system for allocating the fund, so that the business system allocates the fund for the user making the business payment request. And when the calculated fund balance is less than 1 ten thousand yuan, the server sends an intermediate message of failure of service payment request record to a service system for allocating the fund for subsequent processing. The subsequent processing may be to find a first number of batches such that the total amount of payment within the first number of batches is not greater than the balance of funds.
In the above, the method for processing resources provided in the embodiment of the present application is based on the same idea, please refer to fig. 3, and the present application further provides a device 1 for processing resources, which includes:
a receiving module 11, configured to receive a batch of resource applications;
the analysis module 12 is configured to determine a total amount corresponding to the resource application of the batch;
a calculating module 13, configured to determine a resource balance of the service system;
and the processing module 14 is configured to send a message that the resource application recording is successful to the service system when the total amount is not greater than the resource balance, so that the service system allocates resources to the user corresponding to the resource application of the batch.
Further, in another embodiment provided herein, the apparatus further includes a scheduling module 15;
the scheduling module 15 is configured to:
when the total amount is not more than the resource balance, a message of successful resource application record is sent to a service system in real time;
and processing the resource applications of the users in the batch one by one within preset time after the message of successful application record is sent out to form a resource processing record.
Further, in another embodiment provided by the present application, the calculating module 13 is configured to:
determining the actual balance of the service system and the release amount of all users releasing resources;
and determining the sum of the actual junction residual quantity and the release quantity as the resource junction residual quantity.
Further, in another embodiment provided by the present application, the processing module 14 is configured to:
and taking one batch as a unit, searching the first number of batches to ensure that the total resource application amount in the first number of batches is not more than the resource balance, and sending a message that the resource application record of the first number of batches is successful to the service system.
Further, in another embodiment provided by the present application, an apparatus for resource processing includes:
the receiving module 11 is configured to receive a service payment request for an account in a batch;
a parsing module 12 for determining a total amount of payment for the account within the batch;
a calculation module 13, configured to determine a fund balance of the account in the service system;
and the processing module 14 is configured to send a message that the service payment request record is successful to the service system when the total payment amount is not greater than the fund balance, so that the service system allocates funds to the user who makes the service payment request.
Further, in another embodiment provided herein, the apparatus further includes a scheduling module 15;
the scheduling module 15 is configured to:
when the total payment amount is not greater than the fund balance, immediately sending a message of successful business payment request record to a business system;
and processing the service payment requests of the account in batches one by one within a preset time after the message that the service payment request record is successful is sent out to form a fund processing record.
Further, in another embodiment provided by the present application, the calculating module 13 is configured to:
determining an actual funds balance and a funds remittance amount for the account;
determining the sum of the actual fund balance and the fund remittance amount as the fund balance.
Further, in another embodiment provided by the present application, the processing module 14 is configured to:
and taking one batch as a unit, searching the batch with the first quantity, enabling the total payment amount corresponding to the service payment request aiming at one account number in the batch with the first quantity to be not more than the fund balance, and sending a message that the record of the service payment request of the batch with the first quantity is successful to the service system.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable numerical processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable numerical processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, numerical structures, modules of a program, or other numerical values. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include transitory computer readable media (transient media) such as modulated numeric signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.