CN111190910A - Quota resource processing method and device, electronic equipment and readable storage medium - Google Patents

Quota resource processing method and device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN111190910A
CN111190910A CN201910625848.6A CN201910625848A CN111190910A CN 111190910 A CN111190910 A CN 111190910A CN 201910625848 A CN201910625848 A CN 201910625848A CN 111190910 A CN111190910 A CN 111190910A
Authority
CN
China
Prior art keywords
quota
resource
sub
amount
consumed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910625848.6A
Other languages
Chinese (zh)
Other versions
CN111190910B (en
Inventor
王寸涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201910625848.6A priority Critical patent/CN111190910B/en
Publication of CN111190910A publication Critical patent/CN111190910A/en
Application granted granted Critical
Publication of CN111190910B publication Critical patent/CN111190910B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2308Concurrency control
    • G06F16/2315Optimistic concurrency control
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2453Query optimisation
    • G06F16/24534Query rewriting; Transformation
    • G06F16/24547Optimisations to support specific applications; Extensibility of optimisers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2457Query processing with adaptation to user needs
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The application provides a method and a device for processing quota resources, electronic equipment and a computer readable storage medium, and relates to the field of internet. The method comprises the following steps: when an acquisition request aiming at the quota resource is received, determining a second quota sub-resource matched with the acquisition request; when the acquisition amount of the acquisition request is larger than the remaining amount of the matched second amount sub-resource, deducting the amount resource of the acquisition amount from the first amount sub-resource, and updating the consumed amount of the first amount sub-resource; when the acquisition amount of the acquisition request is not larger than the remaining amount of the matched second amount sub-resource, deducting the amount resource of the acquisition amount from the matched second amount sub-resource, and updating the consumed amount of the matched second amount sub-resource. The method and the device solve the problem that in the prior art, limit resources cannot be provided for users needing large limits, and normal services of the users are affected, so that user experience is improved.

Description

Quota resource processing method and device, electronic equipment and readable storage medium
Technical Field
The application relates to the technical field of internet, in particular to a method and a device for processing quota resources, electronic equipment and a computer readable storage medium.
Background
The database hot spot data refers to data which needs to be frequently updated in the database in a high-concurrency scene in an internet system. In the financial industry, a large number of business requests access hot spot data in a database every day, and each business request updates the hot spot data in the database. For example, the operations of money fetching, money saving, money transfer and the like of the user are all updating operations on the hotspot data corresponding to the quota resources in the database.
In a high concurrency scenario, when each service request updates hotspot data, a line-level lock needs to be added to the hotspot data first, and other service requests need to wait when the hotspot data lines are updated, which may cause request timeout or other system problems.
For example, as shown in table 1, the total amount of the credit resource is 10000, a line is configured in the database, and then each service request needs to query and update the line record (hot spot data) and update the consumed credit field.
General limit Consumed amount
10000 500
TABLE 1
Thus, when any service request operates the row of data, other service requests can only wait; moreover, when the available quota (total quota-consumed quota) is smaller than the quota required by the service request, the user always cannot acquire the quota resource, thereby affecting the normal service.
Disclosure of Invention
The application provides a method and a device for processing quota resources, electronic equipment and a computer-readable storage medium, which can solve the problems that in the prior art, when a plurality of service requests operate the same hotspot data request, only one service request can operate hotspot data, so that other service requests can only wait, the processing efficiency is low, and for service requests exceeding the total quota of quota resources, the hotspot data corresponding to quota resources cannot be operated all the time, so that a user cannot acquire quota resources all the time, and normal services are influenced. The technical scheme is as follows:
the first aspect provides a processing method of quota resources, wherein the quota resources comprise a first quota sub-resource and at least two second quota sub-resources, and the first quota sub-resource is larger than the second quota sub-resources; the method comprises the following steps:
when an acquisition request aiming at the quota resource is received, determining a second quota sub-resource matched with the acquisition request;
when the acquisition amount of the acquisition request is larger than the remaining amount of the matched second amount sub-resource, deducting the amount resource of the acquisition amount from the first amount sub-resource, and updating the consumed amount of the first amount sub-resource;
when the acquisition amount of the acquisition request is not larger than the remaining amount of the matched second amount sub-resource, deducting the amount resource of the acquisition amount from the matched second amount sub-resource, and updating the consumed amount of the matched second amount sub-resource.
Each second quota sub-resource has corresponding resource identification information respectively;
the determining of the second quota sub-resource matched with the acquisition request comprises:
acquiring user identification information for initiating the acquisition request;
and determining the resource identification information matched with the user identification information by adopting a preset corresponding relation between the resource identification information and the user identification information, and determining a second quota of sub-resources matched with the resource identification information.
Preferably, the method further comprises:
acquiring the residual quota of each second quota sub-resource at a preset time interval;
determining a blending amount according to the maximum remaining amount value and the minimum remaining amount value in each remaining amount;
and updating the total value of the second quota sub-resource corresponding to the maximum remaining quota value and the total value of the second quota sub-resource corresponding to the minimum remaining quota value based on the allocation quota.
Preferably, the updating, based on the allocated quota, the total quota value of the second quota sub-resource corresponding to the maximum remaining quota value and the total quota value of the second quota sub-resource corresponding to the minimum remaining quota value includes:
reducing the allocation quota in the quota total value of the second quota sub-resource corresponding to the maximum remaining quota value so as to update and obtain the quota total value of the second quota sub-resource corresponding to the maximum remaining quota value;
and increasing the allocation quota in the quota total value of the second quota sub-resource corresponding to the minimum remaining quota value so as to update and obtain the quota total value of the second quota sub-resource corresponding to the minimum remaining quota value.
Preferably, the method further comprises the following steps:
when a supplementary request aiming at the quota resource is received, adding the quota resource corresponding to the supplementary request to at least one of the first quota sub-resource and the at least two second quota sub-resources;
and updating at least one of the consumed quota of the first quota sub-resource and the consumed quota of the at least two second quota sub-resources by adopting the supplementary quota of the supplement request.
Preferably, adding the supplementary quota resource corresponding to the supplement request to the first quota sub-resource includes:
when the consumed amount of the first amount sub-resource is not zero and is not less than the supplementary amount, adding the supplementary amount resource to the first amount sub-resource;
adopting the supplementary quota of the supplementary request to update the consumed quota of the first quota sub-resource, comprising the following steps:
and reducing the consumed amount of the first amount of sub-resource by the supplementary amount to update the consumed amount of the first amount of sub-resource.
Preferably, adding the supplementary quota resource corresponding to the supplement request to the at least two second quota sub-resources includes:
when the consumed amount of the first amount sub-resource is zero, determining the consumed amount of each second amount sub-resource and a first consumption sum of the consumed amount of each second amount sub-resource;
determining the supplementary limit corresponding to each second limit sub-resource based on the supplementary limit, the consumed limit of each second limit sub-resource and the first consumption sum;
adding the supplementary quota resource corresponding to the supplementary quota of each second quota sub-resource into each second quota sub-resource respectively;
adopting the supplementary quota of the supplementary request to update the consumed quota of the at least two second quota sub-resources, comprising the following steps:
respectively reducing the consumed quota of each second quota sub-resource by the corresponding supplementary quota, so as to update and obtain the consumed quota of each second quota sub-resource.
Preferably, adding the supplementary quota resource corresponding to the supplement request to the first quota sub-resource and the at least two second quota sub-resources includes:
when the consumed amount of the first amount sub-resource is not zero and is smaller than the supplementary amount, adding the supplementary amount resource aiming at the consumed amount of the first amount sub-resource in the supplementary amount resource into the first amount sub-resource;
determining the consumed amount of each second amount sub-resource, the second consumption sum of the consumed amount of each second amount sub-resource and the remaining supplementary amount of the supplementary amount resource;
determining the supplementary limit corresponding to each second limit sub-resource based on the remaining supplementary limit, the consumed limit of each second limit sub-resource and the second consumption sum;
adding the supplementary quota resource corresponding to the supplementary quota of each second quota sub-resource into each second quota sub-resource respectively;
adopting the supplementary quota of the supplementary request to update the consumed quota of the first quota sub-resource and the consumed quotas of the at least two second quota sub-resources, comprising the following steps:
respectively reducing the consumed amount of each second amount sub-resource by the supplementary amount corresponding to each second amount sub-resource so as to update the consumed amount of each second amount sub-resource;
and updating and clearing the consumed quota of the first quota sub-resource.
In a second aspect, a device for processing quota resources is provided, where the quota resources include a first quota sub-resource and at least two second quota sub-resources, and the first quota sub-resource is larger than the second quota sub-resources; the device comprises:
the receiving module is used for receiving an acquisition request aiming at the quota resource;
the first determining module is used for determining a second quota sub-resource matched with the acquisition request;
a first updating module, configured to deduct the quota resource of the acquired quota from the first quota sub-resource and update the consumed quota of the first quota sub-resource when the acquired quota of the acquisition request is greater than the remaining quota of the matched second quota sub-resource;
and the second updating module is used for deducting the quota resource of the acquired quota from the matched second quota sub-resource and updating the consumed quota of the matched second quota sub-resource when the acquired quota of the acquisition request is not more than the remaining quota of the matched second quota sub-resource.
Preferably, each second quota sub-resource has corresponding resource identification information;
the first determining module includes:
a user identification information submodule for acquiring the user identification information initiating the acquisition request;
and the matching submodule is used for determining the resource identification information matched with the user identification information by adopting the corresponding relation between the preset resource identification information and the user identification information, and determining the second quota sub-resource matched with the resource identification information according to the resource identification information.
Preferably, the apparatus further comprises:
the first acquisition module is used for acquiring the residual quota of each second quota sub-resource at a preset time interval;
the second determining module is used for determining the allocation amount according to the maximum surplus value and the minimum surplus value in each surplus amount;
and the third updating module is used for updating the total value of the second quota sub-resource corresponding to the maximum remaining quota value and the total value of the second quota sub-resource corresponding to the minimum remaining quota value based on the allocation quota.
Preferably, the third updating module comprises:
the first total amount updating submodule is used for reducing the allocation amount in the total amount of the second amount sub-resource corresponding to the maximum remaining amount value so as to update and obtain the total amount of the second amount sub-resource corresponding to the maximum remaining amount value;
and the second quota total updating submodule is used for increasing the allocation quota in the quota total of the second quota sub-resource corresponding to the minimum remaining quota value so as to update and obtain the quota total of the second quota sub-resource corresponding to the minimum remaining quota value.
Preferably, the method further comprises the following steps:
the receiving module is also used for receiving a supplement request aiming at the quota resource;
the supplementary module is used for adding the supplementary quota resource corresponding to the supplementary request to at least one of the first quota sub-resource and the at least two second quota sub-resources;
and the fourth updating module is used for updating at least one of the consumed quota of the first quota sub-resource and the consumed quota of the at least two second quota sub-resources by adopting the supplementary quota of the supplementary request.
Preferably, the supplementary module is specifically configured to:
when the consumed amount of the first amount sub-resource is not zero and is not less than the supplementary amount, adding the supplementary amount resource to the first amount sub-resource;
the fourth update module is specifically configured to:
and reducing the consumed amount of the first amount of sub-resource by the supplementary amount to update the consumed amount of the first amount of sub-resource.
Preferably, the supplementary module comprises:
the first determining submodule is used for determining the consumed amount of each second amount of sub-resource and the first consumed sum of the consumed amount of each second amount of sub-resource when the consumed amount of the first amount of sub-resource is zero;
a second determining submodule, configured to determine, based on the supplementary limit, consumed limits of the second limit sub-resources, and the first consumption sum, a supplementary limit corresponding to each second limit sub-resource;
the first adding sub-module is used for respectively adding the supplementary quota resources corresponding to the supplementary quota of each second quota sub-resource into each second quota sub-resource;
the fourth update module is specifically configured to:
respectively reducing the consumed quota of each second quota sub-resource by the corresponding supplementary quota, so as to update and obtain the consumed quota of each second quota sub-resource.
Preferably, the supplementary module comprises:
a second adding sub-module, configured to add, to the first quota sub-resource, a supplementary quota resource that is in the supplementary quota resource and is specific to the consumed quota of the first quota sub-resource, when the consumed quota of the first quota sub-resource is not zero and is smaller than the supplementary quota;
a third determining submodule, configured to determine a consumed amount of each second amount sub-resource, a second consumption sum of the consumed amount of each second amount sub-resource, and a remaining supplemental amount of the supplemental amount resource;
a fourth determining submodule, configured to determine, based on the remaining supplemental line, consumed lines of the second line sub-resources, and the second consumption sum, a supplemental line corresponding to each second line sub-resource;
the third adding sub-module is used for respectively adding the supplementary quota resources corresponding to the supplementary quota of each second quota sub-resource into each second quota sub-resource;
the fourth update module is specifically configured to:
and respectively reducing the consumed amount of each second amount sub-resource by the supplementary amount corresponding to each second amount sub-resource so as to update the consumed amount of each second amount sub-resource, and clearing the consumed amount of the first amount sub-resource.
In a third aspect, an electronic device is provided, which includes:
a processor, a memory, and a bus;
the bus is used for connecting the processor and the memory;
the memory is used for storing operation instructions;
the processor is configured to call the operation instruction, and the executable instruction enables the processor to execute an operation corresponding to the processing method of the quota resource shown in the first aspect of the application.
In a fourth aspect, a computer-readable storage medium is provided, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements the method for processing quota resources shown in the first aspect of the present application.
The beneficial effect that technical scheme that this application provided brought is:
dividing the quota resource into a first quota sub-resource with a large quota and at least two second quota sub-resources with a small quota, and simultaneously correspondingly dividing hot data corresponding to the quota resource according to the first quota sub-resource and each second quota sub-resource, so that when a user initiates a service request of the quota resource with the large quota, the service request can operate the hot data corresponding to the first quota sub-resource, and the first quota sub-resource with the large quota is adopted to provide the quota resource for the user; when a user initiates a service request of a low-quota resource, the service request can operate hot spot data corresponding to the matched second-quota sub-resource, and the corresponding low-quota second-quota sub-resource is adopted to provide quota resources for the user, so that the service request of any quota resource can be ensured to be responded, normal service is not influenced, a plurality of service requests can be simultaneously responded, the processing efficiency is improved, a flexible quota resource providing strategy is provided for different service requirements, the service requirements of different users are met, the problem that in the prior art, when a plurality of service requests operate the same hot spot data request, only one service request can operate the hot spot data, other service requests can only wait, the processing efficiency is low, and the service request of the total quota resource exceeding the quota resource is solved, the hotspot data corresponding to the quota resource can not be operated all the time, so that the user can not acquire the quota resource all the time, thereby influencing the normal service and improving the user experience.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings used in the description of the embodiments of the present application will be briefly described below.
FIG. 1 is a flowchart illustrating a method for processing quota resources according to an embodiment of the present application;
FIG. 2 is a flowchart illustrating a method for processing quota resources according to another embodiment of the present application;
FIG. 3 is a flowchart illustrating a method for processing quota resources according to another embodiment of the present application;
FIG. 4-1 is a schematic structural diagram of a device for processing quota resources according to another embodiment of the present application;
FIG. 4-2 is a schematic structural diagram of a device for processing quota resources according to another embodiment of the present application;
FIG. 4-3 is a schematic structural diagram of a device for processing quota resources according to another embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device for processing quota resources according to another embodiment of the present application.
Detailed Description
Reference will now be made in detail to embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are exemplary only for the purpose of explaining the present application and are not to be construed as limiting the present invention.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may also be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or wirelessly coupled. As used herein, the term "and/or" includes all or any element and all combinations of one or more of the associated listed items.
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
The method and the device for processing the quota resource, the electronic device and the computer-readable storage medium aim to solve the technical problems in the prior art.
The following describes the technical solutions of the present application and how to solve the above technical problems with specific embodiments. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present application will be described below with reference to the accompanying drawings.
In one embodiment, a method for processing quota resources is provided, as shown in fig. 1, quota resources include a first quota sub-resource and at least two second quota sub-resources, and the first quota sub-resource is larger than the second quota sub-resources.
The method and the system can be applied to loan-type services of a financial platform, the quota resource can be a resource with quota, and the hotspot data corresponding to the quota resource is recorded in a preset database. For example, the financial platform "financing" provides 1000 ten thousand yuan RMB for loan transaction, and at the same time, a preset database is adopted to manage 1000 ten thousand yuan RMB corresponding hot spot data "1000 ten thousand".
In this application, the quota resource can be split into a plurality of quota sub-resources when the system is initialized, including: the first quota sub-resource and at least two second quota sub-resources, and at the same time, the hotspot data in the database are correspondingly split.
For example, the total value of the quota resource is 1000 ten thousand, the operator designates that quota allocation of the first quota sub-resource is 50%, the remaining quota resource is averagely divided into 10 second quota sub-resources, and at the same time, the hotspot data "1000 ten thousand" in the database is correspondingly divided, and the division result is shown in table 2:
splitting ID Corresponding account end number Total value of quota Consumed amount
First quota of sub-resources All are 500 ten thousand 0
Second quota of sub-resources 1 0 50 ten thousand 0
Second quota of sub-resources 2 1 50 ten thousand 0
Second quota of sub-resources 3 2 50 ten thousand 0
... ... ... ...
Second quota of sub-resources 10 9 50 ten thousand 0
TABLE 2
The account of the user may be in a digital form, such as a QQ number, and then different end numbers of the account correspond to different second quota sub-resources, respectively.
It should be noted that the splitting manner, the ratio, and the like are only used for illustration, and in practical applications, the splitting manner, the ratio, and the like may be adjusted according to practical needs, which is not limited in the present application.
The method comprises the following steps:
step S101, when an acquisition request aiming at the quota resource is received, determining a second quota sub-resource matched with the acquisition request;
the request for obtaining the quota of resources can be a service request initiated by a user for borrowing, loan, bedding and the like. And when the server receives a service request initiated by the user, determining the second quota of sub-resources matched with the user based on the account of the user.
In a preferred embodiment of the present invention, each second quota sub-resource has corresponding resource identification information;
determining a second quota sub-resource matched with the acquisition request, including:
acquiring user identification information initiating an acquisition request;
and determining the resource identification information matched with the user identification information by adopting the preset corresponding relation between the resource identification information and the user identification information, and determining the second quota sub-resource matched with the resource identification information.
Specifically, each of the split second quota sub-resources has corresponding resource identification information, for example, "second quota sub-resource 1", "second quota sub-resource 2", "second quota sub-resource 10", and the like in table 2, each resource identification information corresponds to an account, for example, as shown in table 2, second quota sub-resource 1 corresponds to an account with a tail number of 0, and second quota sub-resource 2 corresponds to an account with a tail number of 1, and the like, so that the server can obtain user identification information, for example, the last tail number of the account, after receiving the service request, and then determine the resource identification information matched with the user identification information by using the preset corresponding relationship between the resource identification information and the user identification information, and can determine the second quota sub-resource matched with the user identification information according to the resource identification information.
Of course, the corresponding second quota sub-resource may be determined based on a multi-digit end number of the account, a digit number of the account, or a combination thereof, or even other ways besides the last end number of the account, which is not limited in the present application.
Step S102, when the acquisition amount of the acquisition request is larger than the remaining amount of the matched second amount sub-resource, deducting the amount resource of the acquisition amount from the first amount sub-resource, and updating the consumed amount of the first amount sub-resource;
and after the matched second limit sub-resource is determined, acquiring the residual limit of the second limit sub-resource, namely subtracting the consumed limit from the total limit value, then judging whether the acquired limit in the acquisition request initiated by the user is larger than the residual limit of the matched second limit sub-resource, if so, deducting the limit resource of the acquired limit from the first limit sub-resource, and updating the residual limit of the first limit sub-resource. For example, as shown in table 2, the account with the end number of 1 initiates a service request of 100 ten thousand loan, and the remaining amount of the second amount sub-resource 2 matched with the account is 50 ten thousand and is less than 100 ten thousand in the service request, so 100 ten thousand are deducted from the first amount sub-resource and the consumed amount is updated from "0" to "100 ten thousand" (not shown in table 2).
Further, in order to ensure that the service request of the user with a large quota is satisfied, the quota acquired in the single service request may be set to be smaller than the total quota of the first quota sub-resource. For example, if the total value of the first quota of sub-resources is 500 ten thousand, the acquired quota in a single service request may be set to be less than or equal to 500 ten thousand, such as 300 ten thousand, or 100 ten thousand.
Step S103, when the acquisition amount of the acquisition request is not larger than the remaining amount of the matched second amount sub-resource, deducting the amount resource of the acquisition amount from the matched second amount sub-resource, and updating the consumed amount of the matched second amount sub-resource.
If the acquisition amount in the acquisition request initiated by the user is not greater than the remaining amount of the matched second amount sub-resource, the amount resource of the acquisition amount is deducted from the matched second amount sub-resource, and the remaining amount of the second amount sub-resource is updated. For example, as shown in table 2, the account with the end number of 2 initiates a service request of 10 ten thousand loan, and the remaining amount of the second amount sub-resource 3 matched with the account is 50 ten thousand and is greater than 10 ten thousand in the service request, so 10 ten thousand are deducted from the second amount sub-resource 3, and the consumed amount is updated from "0" to "10 ten thousand" (not shown in table 2).
In the embodiment of the invention, the quota resource is split into a first quota sub-resource with a large quota and at least two second quota sub-resources with small quotas, and simultaneously, hot data corresponding to the quota resource is also split correspondingly according to the first quota sub-resource and each second quota sub-resource, so that when a user initiates a service request of the quota resource with the large quota, the service request can operate the hot data corresponding to the first quota sub-resource and provide the quota resource for the user by adopting the first quota sub-resource with the large quota; when a user initiates a service request of a low-quota resource, the service request can operate hot spot data corresponding to the matched second-quota sub-resource, and the corresponding low-quota second-quota sub-resource is adopted to provide quota resources for the user, so that the service request of any quota resource can be ensured to be responded, normal service is not influenced, a plurality of service requests can be simultaneously responded, the processing efficiency is improved, a flexible quota resource providing strategy is provided for different service requirements, the service requirements of different users are met, the problem that in the prior art, when a plurality of service requests operate the same hot spot data request, only one service request can operate the hot spot data, other service requests can only wait, the processing efficiency is low, and the service request of the total quota resource exceeding the quota resource is solved, the hotspot data corresponding to the quota resource can not be operated all the time, so that the user can not acquire the quota resource all the time, thereby influencing the normal service and improving the user experience.
In another embodiment, a method for processing quota resources is provided, as shown in fig. 2, quota resources include a first quota sub-resource and at least two second quota sub-resources, and the first quota sub-resource is larger than the second quota sub-resources. The detailed description of the quota resource, the first quota sub-resource, and the second quota sub-resource can refer to the previous embodiment, which is not repeated herein.
The method comprises the following steps:
step S201, when an acquisition request aiming at the quota resource is received, determining a second quota sub-resource matched with the acquisition request;
in a preferred embodiment of the present invention, each second quota sub-resource has corresponding resource identification information;
determining a second quota sub-resource matched with the acquisition request, including:
acquiring user identification information initiating an acquisition request;
and determining the resource identification information matched with the user identification information by adopting the preset corresponding relation between the resource identification information and the user identification information, and determining the second quota sub-resource matched with the resource identification information.
Step S202, when the acquisition amount of the acquisition request is larger than the remaining amount of the matched second amount sub-resource, deducting the amount resource of the acquisition amount from the first amount sub-resource, and updating the consumed amount of the first amount sub-resource;
step S203, when the acquisition amount of the acquisition request is not more than the remaining amount of the matched second amount sub-resource, deducting the amount resource of the acquisition amount from the matched second amount sub-resource, and updating the consumed amount of the matched second amount sub-resource;
for steps S201 to S203, reference may be made to steps S101 to S103, which are not described herein again.
Step S204, obtaining the residual quota of each second quota sub-resource at a preset time interval;
step S205, determining a blending amount according to the maximum remaining amount value and the minimum remaining amount value in each remaining amount;
step S206, based on the allocated quota, updating the quota total of the second quota sub-resource corresponding to the maximum remaining quota value and the quota total of the second quota sub-resource corresponding to the minimum remaining quota value.
In a preferred embodiment of the present invention, updating the total value of the quota of the second quota sub-resource corresponding to the maximum remaining quota value and the total value of the quota of the second quota sub-resource corresponding to the minimum remaining quota value based on the quota allocation includes:
reducing the allocation quota in the quota total value of the second quota sub-resource corresponding to the maximum remaining quota value so as to update and obtain the quota total value of the second quota sub-resource corresponding to the maximum remaining quota value;
and increasing the allocation quota in the quota total value of the second quota sub-resource corresponding to the minimum remaining quota value so as to update and obtain the quota total value of the second quota sub-resource corresponding to the minimum remaining quota value.
Specifically, as shown in table 2, after the quota resource is split into a plurality of quota sub-resources, in order to ensure that the remaining quota of each second quota sub-resource is balanced, the system may continuously check the remaining quota of each second quota sub-resource or at preset time intervals, and dial the remaining quota of each second quota sub-resource in real time, the steps are as follows:
1) calculating the available quota (quota total value-consumed quota) of each second quota sub-resource;
2) determining the maximum surplus value and the minimum surplus value in each surplus amount, and determining the allocation amount according to the maximum surplus value and the minimum surplus value;
3) updating the total value of the quota of the second quota sub-resource corresponding to the maximum remaining quota value and the total value of the quota of the second quota sub-resource corresponding to the minimum remaining quota value (the second quota sub-resource with the large remaining quota is adjusted to the second quota sub-resource with the small remaining quota) based on the allocated quota;
supposing that the total value of the quota of the second quota sub-resource with the largest remaining quota is total _1, and the consumed quota is consume _ 1; the total value of the quota of the second quota sub-resource with the least remaining quota is total _2, and the consumed quota is consume _ 2; then the calculation formula of the allocation amount is:
[(total_1-consume_1)+(total_2-consume_2)]/2-[(total_2-consume_2)]。
for example, the record of the current first quota sub-resource and each second quota sub-resource is shown in table 3:
Figure BDA0002127065200000141
Figure BDA0002127065200000151
TABLE 3
Through calculation, in each second quota sub-resource, the remaining quota of the second quota sub-resource 1 is the smallest and 15 ten thousand, and the remaining quota of the second quota sub-resource 3 is the largest and 45 ten thousand, and the allocation quota is calculated by adopting the formula as follows: (45+15)/2-15 ═ 15 (ten thousand), then deduct the quota resource of allotment quota from the second quota sub-resource 3, and upgrade the total value of quota after transferring and transferring 35 ten thousand, meanwhile, supplement the quota resource of allotment quota to the second quota sub-resource 1, and upgrade the total value of quota after transferring and transferring 65 ten thousand, in this way, the second quota sub-resource 1 and the surplus quota of the second quota sub-resource 3 are all 30 ten thousand after transferring and transferring, as shown in table 4 specifically:
splitting ID Corresponding account end number Total value of quota Has been consumedAmount unit
First quota of sub-resources All are 500 ten thousand 100 ten thousand
Second quota of sub-resources 1 0 65 ten thousand 35 ten thousand
Second quota of sub-resources 2 1 50 ten thousand 20 ten thousand
Second quota of sub-resources 3 2 35 ten thousand 5 ten thousand
... ... ... ...
Second quota of sub-resources 10 9 50 ten thousand 20 ten thousand
TABLE 4
In the embodiment of the invention, the quota resource is split into a first quota sub-resource with a large quota and at least two second quota sub-resources with small quotas, and simultaneously, hot data corresponding to the quota resource is also split correspondingly according to the first quota sub-resource and each second quota sub-resource, so that when a user initiates a service request of the quota resource with the large quota, the service request can operate the hot data corresponding to the first quota sub-resource and provide the quota resource for the user by adopting the first quota sub-resource with the large quota; when a user initiates a service request of a low-quota resource, the service request can operate hot spot data corresponding to the matched second-quota sub-resource, and the corresponding low-quota second-quota sub-resource is adopted to provide quota resources for the user, so that the service request of any quota resource can be ensured to be responded, normal service is not influenced, a plurality of service requests can be simultaneously responded, the processing efficiency is improved, a flexible quota resource providing strategy is provided for different service requirements, the service requirements of different users are met, the problem that in the prior art, when a plurality of service requests operate the same hot spot data request, only one service request can operate the hot spot data, other service requests can only wait, the processing efficiency is low, and the service request of the total quota resource exceeding the quota resource is solved, the hotspot data corresponding to the quota resource can not be operated all the time, so that the user can not acquire the quota resource all the time, thereby influencing the normal service and improving the user experience.
Furthermore, the residual amount of each amount sub-resource is monitored in real time, and the amount resources are allocated in real time aiming at the amount sub-resource with the maximum residual amount and the amount sub-resource with the minimum residual amount, so that the residual amount of each amount sub-resource is balanced, and the utilization rate of each amount sub-resource is improved.
In another embodiment, a method for processing quota resources is provided, as shown in fig. 3, quota resources include a first quota sub-resource and at least two second quota sub-resources, and the first quota sub-resource is larger than the second quota sub-resources. The detailed description of the quota resource, the first quota sub-resource, and the second quota sub-resource can refer to the previous embodiment, which is not repeated herein.
The method comprises the following steps:
step S301, when an acquisition request aiming at the quota resource is received, determining a second quota sub-resource matched with the acquisition request;
in a preferred embodiment of the present invention, each second quota sub-resource has corresponding resource identification information;
determining a second quota sub-resource matched with the acquisition request, including:
acquiring user identification information initiating an acquisition request;
and determining the resource identification information matched with the user identification information by adopting the preset corresponding relation between the resource identification information and the user identification information, and determining the second quota sub-resource matched with the resource identification information.
Step S302, when the acquisition amount of the acquisition request is larger than the remaining amount of the matched second amount sub-resource, deducting the amount resource of the acquisition amount from the first amount sub-resource, and updating the consumed amount of the first amount sub-resource;
step S303, when the acquisition amount of the acquisition request is not larger than the remaining amount of the matched second amount sub-resource, deducting the amount resource of the acquisition amount from the matched second amount sub-resource, and updating the consumed amount of the matched second amount sub-resource.
Step S304, obtaining the remaining quota of each second quota sub-resource at a preset time interval;
step S305, determining a blending amount according to the maximum remaining amount value and the minimum remaining amount value in each remaining amount;
step S306, updating the total value of the second quota sub-resource corresponding to the maximum remaining quota value and the total value of the second quota sub-resource corresponding to the minimum remaining quota value based on the quota allocation;
in a preferred embodiment of the present invention, updating the total value of the quota of the second quota sub-resource corresponding to the maximum remaining quota value and the total value of the quota of the second quota sub-resource corresponding to the minimum remaining quota value based on the quota allocation includes:
reducing the allocation quota in the quota total value of the second quota sub-resource corresponding to the maximum remaining quota value so as to update and obtain the quota total value of the second quota sub-resource corresponding to the maximum remaining quota value;
and increasing the allocation quota in the quota total value of the second quota sub-resource corresponding to the minimum remaining quota value so as to update and obtain the quota total value of the second quota sub-resource corresponding to the minimum remaining quota value.
For the steps S301 to S306, reference may be specifically made to the steps S201 to S206, which are not described herein again.
Step S307, when a supplementary request aiming at the quota resource is received, adding the quota resource corresponding to the supplementary request to at least one of the first quota sub-resource and at least two second quota sub-resources;
step S308, updating the consumed quota of the first quota sub-resource and at least one of the consumed quotas of at least two second quota sub-resources by using the supplementary quota of the supplement request.
Specifically, the supplementary request for the quota resource may be a repayment request initiated by the user. And after receiving the repayment request, the server adds the corresponding supplementary quota resource to the first quota sub-resource and at least one item in each second quota sub-resource, and correspondingly updates the consumed quota of the added sub-resource.
That is, if the supplementary quota resource is only added to the first quota sub-resource, only the consumed quota of the first quota sub-resource is updated; if the supplementary quota resource is only added into each second quota sub-resource, only updating the consumed quota of each second quota sub-resource; if the supplementary quota resource is added to both the first quota sub-resource and the second quota sub-resource, the consumed quota of the first quota sub-resource and the consumed quota of each second quota sub-resource are updated at the same time.
In a preferred embodiment of the present invention, adding the quota replenishing resource corresponding to the request for replenishment to the first quota sub-resource includes:
when the consumed amount of the first amount sub-resource is not zero and is not less than the supplementary amount, adding the supplementary amount resource into the first amount sub-resource;
adopting the supplementary quota of the supplement request to update the consumed quota of the first quota sub-resource, comprising the following steps:
the consumed amount of the first amount of sub-resource is decreased by the supplementary amount to update the consumed amount of the first amount of sub-resource.
For example, as shown in table 4, if the first quota sub-resource is 500 ten thousand, the consumed quota is 100 ten thousand, and the repayment quota of the user is 50 ten thousand, 50 ten thousand is added to the first quota sub-resource, and the consumed quota of the first quota sub-resource is updated from "100 ten thousand" to "50 ten thousand".
In a preferred embodiment of the present invention, adding the quota of supplement resource corresponding to the request for supplement to at least two second quota sub-resources includes:
when the consumed amount of the first amount sub-resource is zero, determining the consumed amount of each second amount sub-resource and a first consumption sum of the consumed amount of each second amount sub-resource;
determining the supplementary limit corresponding to each second limit sub-resource based on the supplementary limit, the consumed limit of each second limit sub-resource and the first consumption sum;
adding the supplementary quota resource corresponding to the supplementary quota of each second quota sub-resource into each second quota sub-resource respectively;
adopting the supplementary quota of the supplement request to update the consumed quota of at least two second quota sub-resources, comprising the following steps:
respectively reducing the consumed quota of each second quota sub-resource by the corresponding supplementary quota, so as to update and obtain the consumed quota of each second quota sub-resource.
Specifically, when the first quota sub-resource is not consumed (the consumed quota is 0), the supplementary quota corresponding to each second quota sub-resource is calculated according to the consumed quota of each second quota sub-resource, specifically:
1) calculating the consumed quota of each second quota sub-resource, and counting the total consumed sum of all the second quota sub-resources, and recording as total _ total;
2) calculating the supplementary quota of each second quota sub-resource; assuming that the second quota sub-resource i already consumes the quota resource as consumei, the supplementary quota of the second quota sub-resource i can be calculated by the following formula:
the supplementary quota of the second quota sub-resource i is quota _ i/total _ quota (supplementary quota of the supplementary request-supplemented quota of the first quota sub-resource);
therefore, the more second quota sub-resources are consumed by quota resources, the more quota resources are added each time.
For example, the current record of the first quota sub-resource and each second quota sub-resource is shown in table 5, and the repayment quota of the user is 100 ten thousand.
Splitting ID Corresponding account end number Total value of quota Consumed amount
First quota of sub-resources All are 500 ten thousand 0
Second quota of sub-resources 1 0 50 ten thousand 30 ten thousand
Second quota of sub-resources 2 1 50 ten thousand 10 ten thousand
Second quota of sub-resources 3 2 50 ten thousand 10 ten thousand
... ... ... ...
Second quota of sub-resources 10 9 50 ten thousand 10 ten thousand
TABLE 5
Then, the supplementary quota of the second quota sub-resource 1 is: 100 (30/120) ═ 25 (ten thousand), and the supplementary credit of the second credit sub-resource 2 to the second credit sub-resource 9 are respectively: 100 (10/120) ═ 8.3333 (ten thousand), then each second quota sub-resource adds the quota resource of the corresponding supplementary quota, and updates the consumed quota after the supplement, and the records of the updated first quota sub-resource and each second quota sub-resource are shown in table 6:
splitting ID Corresponding account end number Total value of quota Consumed amount
First quota of sub-resources All are 500 ten thousand 0
Second quota of sub-resources 1 0 50 ten thousand 5 ten thousand
Second quota of sub-resources 2 1 50 ten thousand 1.6667 million
Second quota of sub-resources 3 2 50 ten thousand 1.6667 million
... ... ... ...
Second quota of sub-resources 10 9 50 ten thousand 1.6667 million
TABLE 6
In a preferred embodiment of the present invention, adding the quota of supplement resource corresponding to the request for supplement to the first quota sub-resource and the at least two second quota sub-resources includes:
when the consumed amount of the first amount sub-resource is not zero and is smaller than the supplementary amount, adding the supplementary amount resource aiming at the consumed amount of the first amount sub-resource in the supplementary amount resource into the first amount sub-resource;
determining the consumed amount of each second amount sub-resource, the second consumption sum of the consumed amount of each second amount sub-resource and the remaining supplementary amount of the supplementary amount resource;
determining the supplementary limit corresponding to each second limit sub-resource based on the remaining supplementary limit, the consumed limit of each second limit sub-resource and the second consumption sum;
adding the supplementary quota resource corresponding to the supplementary quota of each second quota sub-resource into each second quota sub-resource respectively;
adopting the supplementary quota of the supplement request to update the consumed quota of the first quota sub-resource and the consumed quotas of at least two second quota sub-resources, comprising the following steps:
respectively reducing the consumed amount of each second amount sub-resource by the supplementary amount corresponding to each second amount sub-resource so as to update the consumed amount of each second amount sub-resource;
and updating and clearing the consumed quota of the first quota sub-resource.
For example, the current record of the first quota sub-resource and each second quota sub-resource is shown in table 7, and the repayment quota of the user is 200 ten thousand.
Splitting ID Corresponding account end number Total value of quota Consumed amount
First quota of sub-resources All are 500 ten thousand 100 ten thousand
Second quota of sub-resources 1 0 50 ten thousand 30 ten thousand
Second quota of sub-resources 2 1 50 ten thousand 10 ten thousand
Second quota of sub-resources 3 2 50 ten thousand 10 ten thousand
... ... ... ...
Second quota of sub-resources 10 9 50 ten thousand 10 ten thousand
TABLE 7
Because the consumed amount of the first amount sub-resource is smaller than the supplementary amount in the supplement request, it is preferable to add 100 ten thousand amount resources to the first amount sub-resource, and clear the consumed amount of the first amount sub-resource after the addition is completed, at this time, the remaining amount of the supplementary amount is 100 ten thousand, the supplementary amount of each second amount sub-resource is calculated based on 100 ten thousand, and the supplementary amount of the second amount sub-resource 1 is: 100 (30/120) ═ 25 (ten thousand), and the supplementary credit of the second credit sub-resource 2 to the second credit sub-resource 9 are respectively: 100 (10/120) ═ 8.3333 (ten thousand), then each second quota sub-resource adds the quota resource of the corresponding supplementary quota, and updates the consumed quota after the supplement, and the records of the updated first quota sub-resource and each second quota sub-resource are shown in table 8:
splitting ID Corresponding account end number Total value of quota Consumed amount
First quota of sub-resources All are 500 ten thousand 0
Second quota of sub-resources 1 0 50 ten thousand 5 ten thousand
Second quota of sub-resources 2 1 50 ten thousand 1.6667 million
Second quota of sub-resources 3 2 50 ten thousand 1.6667 million
... ... ... ...
Second quota of sub-resources 10 9 50 ten thousand 1.6667 million
TABLE 8
In the embodiment of the invention, the quota resource is split into a first quota sub-resource with a large quota and at least two second quota sub-resources with small quotas, and simultaneously, hot data corresponding to the quota resource is also split correspondingly according to the first quota sub-resource and each second quota sub-resource, so that when a user initiates a service request of the quota resource with the large quota, the service request can operate the hot data corresponding to the first quota sub-resource and provide the quota resource for the user by adopting the first quota sub-resource with the large quota; when a user initiates a service request of a low-quota resource, the service request can operate hot spot data corresponding to the matched second-quota sub-resource, and the corresponding low-quota second-quota sub-resource is adopted to provide quota resources for the user, so that the service request of any quota resource can be ensured to be responded, normal service is not influenced, a plurality of service requests can be simultaneously responded, the processing efficiency is improved, a flexible quota resource providing strategy is provided for different service requirements, the service requirements of different users are met, the problem that in the prior art, when a plurality of service requests operate the same hot spot data request, only one service request can operate the hot spot data, other service requests can only wait, the processing efficiency is low, and the service request of the total quota resource exceeding the quota resource is solved, the hotspot data corresponding to the quota resource can not be operated all the time, so that the user can not acquire the quota resource all the time, thereby influencing the normal service and improving the user experience.
Furthermore, the residual amount of each amount sub-resource is monitored in real time, and the amount resources are allocated in real time aiming at the amount sub-resource with the maximum residual amount and the amount sub-resource with the minimum residual amount, so that the residual amount of each amount sub-resource is balanced, and the utilization rate of each amount sub-resource is improved.
Furthermore, when a repayment request of the user is received, the amount resources can be supplemented in a targeted manner according to the consumed amounts of the amount sub-resources, so that the more the amount sub-resources are consumed, the more the amount resources are supplemented, the balance of the remaining amounts of the amount sub-resources is further ensured, and the utilization rate of the amount sub-resources is improved.
Fig. 4-1 is a schematic structural diagram of a processing device of quota resources according to another embodiment of the present application, as shown in fig. 4-1, the quota resources include a first quota sub-resource and at least two second quota sub-resources, and the first quota sub-resource is greater than the second quota sub-resources;
the apparatus of this embodiment may include:
a receiving module 401, configured to receive an acquisition request for a quota resource;
a first determining module 402, configured to determine a second quota sub-resource matching the obtaining request;
a first updating module 403, configured to deduct the quota resource of the acquired quota from the first quota sub-resource and update the consumed quota of the first quota sub-resource when the acquired quota of the acquisition request is greater than the remaining quota of the matched second quota sub-resource;
and a second updating module 404, configured to deduct the quota resource of the acquired quota from the matched second quota sub-resource and update the consumed quota of the matched second quota sub-resource when the acquired quota of the acquisition request is not greater than the remaining quota of the matched second quota sub-resource.
In a preferred embodiment of the present invention, each second quota sub-resource has corresponding resource identification information;
the first determining module includes:
the user identification information submodule is used for acquiring the user identification information initiating the acquisition request;
and the matching submodule is used for determining the resource identification information matched with the user identification information by adopting the preset corresponding relation between the resource identification information and the user identification information, and determining the second quota sub-resource matched with the resource identification information according to the resource identification information.
In a preferred embodiment of the present invention, as shown in fig. 4-2, the apparatus further comprises:
a first obtaining module 405, configured to obtain the remaining quota of each second quota sub-resource at a preset time interval;
a second determining module 406, configured to determine the allocation amount according to the maximum remaining amount value and the minimum remaining amount value in each remaining amount;
the third updating module 407 is configured to update the total value of the quota of the second quota sub-resource corresponding to the maximum remaining quota value and the total value of the quota of the second quota sub-resource corresponding to the minimum remaining quota value based on the quota allocation.
In a preferred embodiment of the present invention, the third updating module includes:
the first quota total updating submodule is used for reducing the allocation quota in the quota total of the second quota sub-resource corresponding to the maximum surplus quota value so as to update and obtain the quota total of the second quota sub-resource corresponding to the maximum surplus quota value;
and the second quota total updating submodule is used for increasing the allocation quota in the quota total of the second quota sub-resource corresponding to the minimum remaining quota value so as to update and obtain the quota total of the second quota sub-resource corresponding to the minimum remaining quota value.
In a preferred embodiment of the present invention, as shown in fig. 4-3, the apparatus further comprises:
the receiving module is also used for receiving a supplement request aiming at the quota resource;
a supplement module 408, configured to add a supplementary quota resource corresponding to the supplement request to at least one of the first quota sub-resource and the at least two second quota sub-resources;
a fourth updating module 409, configured to update at least one of the consumed quota of the first quota sub-resource and the consumed quota of the at least two second quota sub-resources with the supplementary quota of the supplement request.
In a preferred embodiment of the present invention, the supplementary module is specifically configured to:
when the consumed amount of the first amount sub-resource is not zero and is not less than the supplementary amount, adding the supplementary amount resource into the first amount sub-resource;
the fourth update module is specifically configured to:
the consumed amount of the first amount of sub-resource is decreased by the supplementary amount to update the consumed amount of the first amount of sub-resource.
In a preferred embodiment of the present invention, the supplementary module comprises:
the first determining submodule is used for determining the consumed amount of each second amount sub-resource and the first consumed sum of the consumed amount of each second amount sub-resource when the consumed amount of the first amount sub-resource is zero;
the second determining submodule is used for determining the supplementary limit corresponding to each second limit sub-resource based on the supplementary limit, the consumed limit of each second limit sub-resource and the first consumption sum;
the first adding sub-module is used for respectively adding the supplementary quota resources corresponding to the supplementary quota of each second quota sub-resource into each second quota sub-resource;
the fourth update module is specifically configured to:
respectively reducing the consumed quota of each second quota sub-resource by the corresponding supplementary quota, so as to update and obtain the consumed quota of each second quota sub-resource.
In a preferred embodiment of the present invention, the supplementary module comprises:
the second adding sub-module is used for adding the supplementary quota resource aiming at the consumed quota of the first quota sub-resource into the first quota sub-resource in the supplementary quota resource when the consumed quota of the first quota sub-resource is not zero and is less than the supplementary quota;
a third determining submodule, configured to determine a consumed amount of each second amount sub-resource, a second consumption sum of the consumed amount of each second amount sub-resource, and a remaining supplemental amount of the supplemental amount resource;
a fourth determining submodule, configured to determine, based on the remaining supplemental quota, the consumed quota of each second quota sub-resource, and the second consumption sum, a supplemental quota corresponding to each second quota sub-resource;
the third adding sub-module is used for respectively adding the supplementary quota resources corresponding to the supplementary quota of each second quota sub-resource into each second quota sub-resource;
the fourth update module is specifically configured to:
respectively reducing the consumed amount of each second amount sub-resource by the supplementary amount corresponding to each second amount sub-resource so as to update the consumed amount of each second amount sub-resource, and clearing the consumed amount of the first amount sub-resource.
The processing apparatus for credit resources of this embodiment can execute the processing method for credit resources of the first embodiment of this application, which is similar to the above-mentioned embodiment in terms of its implementation principle, and is not described herein again.
In the embodiment of the invention, the quota resource is split into a first quota sub-resource with a large quota and at least two second quota sub-resources with small quotas, and simultaneously, hot data corresponding to the quota resource is also split correspondingly according to the first quota sub-resource and each second quota sub-resource, so that when a user initiates a service request of the quota resource with the large quota, the service request can operate the hot data corresponding to the first quota sub-resource and provide the quota resource for the user by adopting the first quota sub-resource with the large quota; when a user initiates a service request of a low-quota resource, the service request can operate hot spot data corresponding to the matched second-quota sub-resource, and the corresponding low-quota second-quota sub-resource is adopted to provide quota resources for the user, so that the service request of any quota resource can be ensured to be responded, normal service is not influenced, a plurality of service requests can be simultaneously responded, the processing efficiency is improved, a flexible quota resource providing strategy is provided for different service requirements, the service requirements of different users are met, the problem that in the prior art, when a plurality of service requests operate the same hot spot data request, only one service request can operate the hot spot data, other service requests can only wait, the processing efficiency is low, and the service request of the total quota resource exceeding the quota resource is solved, the hotspot data corresponding to the quota resource can not be operated all the time, so that the user can not acquire the quota resource all the time, thereby influencing the normal service and improving the user experience.
Furthermore, the residual amount of each amount sub-resource is monitored in real time, and the amount resources are allocated in real time aiming at the amount sub-resource with the maximum residual amount and the amount sub-resource with the minimum residual amount, so that the residual amount of each amount sub-resource is balanced, and the utilization rate of each amount sub-resource is improved.
Furthermore, when a repayment request of the user is received, the amount resources can be supplemented in a targeted manner according to the consumed amounts of the amount sub-resources, so that the more the amount sub-resources are consumed, the more the amount resources are supplemented, the balance of the remaining amounts of the amount sub-resources is further ensured, and the utilization rate of the amount sub-resources is improved.
In another embodiment of the present application, there is provided an electronic device including: a memory and a processor; at least one program stored in the memory for execution by the processor, which when executed by the processor, implements: dividing the quota resource into a first quota sub-resource with a large quota and at least two second quota sub-resources with a small quota, and simultaneously correspondingly dividing hot data corresponding to the quota resource according to the first quota sub-resource and each second quota sub-resource, so that when a user initiates a service request of the quota resource with the large quota, the service request can operate the hot data corresponding to the first quota sub-resource, and the first quota sub-resource with the large quota is adopted to provide the quota resource for the user; when a user initiates a service request of a low-quota resource, the service request can operate hot spot data corresponding to the matched second-quota sub-resource, and the corresponding low-quota second-quota sub-resource is adopted to provide quota resources for the user, so that the service request of any quota resource can be ensured to be responded, normal service is not influenced, a plurality of service requests can be simultaneously responded, the processing efficiency is improved, a flexible quota resource providing strategy is provided for different service requirements, the service requirements of different users are met, the problem that in the prior art, when a plurality of service requests operate the same hot spot data request, only one service request can operate the hot spot data, other service requests can only wait, the processing efficiency is low, and the service request of the total quota resource exceeding the quota resource is solved, the hotspot data corresponding to the quota resource can not be operated all the time, so that the user can not acquire the quota resource all the time, thereby influencing the normal service and improving the user experience.
In an alternative embodiment, an electronic device is provided, as shown in fig. 5, the electronic device 5000 shown in fig. 5 includes: a processor 5001 and a memory 5003. The processor 5001 and the memory 5003 are coupled, such as via a bus 5002. Optionally, the electronic device 5000 may also include a transceiver 5004. It should be noted that the transceiver 5004 is not limited to one in practical application, and the structure of the electronic device 5000 is not limited to the embodiment of the present application.
The processor 5001 may be a CPU, general purpose processor, DSP, ASIC, FPGA or other programmable logic device, transistor logic device, hardware component, or any combination thereof. Which may implement or perform the various illustrative logical blocks, modules, and circuits described in connection with the disclosure. The processor 5001 may also be a combination of processors implementing computing functionality, e.g., a combination comprising one or more microprocessors, a combination of DSPs and microprocessors, or the like.
Bus 5002 can include a path that conveys information between the aforementioned components. The bus 5002 may be a PCI bus or EISA bus, etc. The bus 5002 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 5, but this is not intended to represent only one bus or type of bus.
The memory 5003 may be, but is not limited to, a ROM or other type of static storage device that can store static information and instructions, a RAM or other type of dynamic storage device that can store information and instructions, an EEPROM, a CD-ROM or other optical disk storage, optical disk storage (including compact disk, laser disk, optical disk, digital versatile disk, blu-ray disk, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer.
The memory 5003 is used for storing application program codes for executing the present solution, and the execution is controlled by the processor 5001. The processor 5001 is configured to execute application program code stored in the memory 5003 to implement the teachings of any of the foregoing method embodiments.
Among them, electronic devices include but are not limited to: mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and fixed terminals such as digital TVs, desktop computers, and the like.
Yet another embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, which, when run on a computer, enables the computer to perform the corresponding content in the aforementioned method embodiments. Compared with the prior art, the embodiment of the application divides the quota resource into a first quota sub-resource with a large quota and at least two second quota sub-resources with a small quota, and simultaneously, correspondingly divides the hot data corresponding to the quota resource according to the first quota sub-resource and each second quota sub-resource, so that when a user initiates a service request of the quota resource with the large quota, the service request can operate the hot data corresponding to the first quota sub-resource, and the first quota sub-resource with the large quota is adopted to provide the quota resource for the user; when a user initiates a service request of a low-quota resource, the service request can operate hot spot data corresponding to the matched second-quota sub-resource, and the corresponding low-quota second-quota sub-resource is adopted to provide quota resources for the user, so that the service request of any quota resource can be ensured to be responded, normal service is not influenced, a plurality of service requests can be simultaneously responded, the processing efficiency is improved, a flexible quota resource providing strategy is provided for different service requirements, the service requirements of different users are met, the problem that in the prior art, when a plurality of service requests operate the same hot spot data request, only one service request can operate the hot spot data, other service requests can only wait, the processing efficiency is low, and the service request of the total quota resource exceeding the quota resource is solved, the hotspot data corresponding to the quota resource can not be operated all the time, so that the user can not acquire the quota resource all the time, thereby influencing the normal service and improving the user experience.
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless explicitly stated herein. Moreover, at least a portion of the steps in the flow chart of the figure may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
The foregoing is only a partial embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (11)

1. A processing method of quota resources is characterized in that the quota resources comprise a first quota sub-resource and at least two second quota sub-resources, and the first quota sub-resource is larger than the second quota sub-resources; the method comprises the following steps:
when an acquisition request aiming at the quota resource is received, determining a second quota sub-resource matched with the acquisition request;
when the acquisition amount of the acquisition request is larger than the remaining amount of the matched second amount sub-resource, deducting the amount resource of the acquisition amount from the first amount sub-resource, and updating the consumed amount of the first amount sub-resource;
when the acquisition amount of the acquisition request is not larger than the remaining amount of the matched second amount sub-resource, deducting the amount resource of the acquisition amount from the matched second amount sub-resource, and updating the consumed amount of the matched second amount sub-resource.
2. The method of claim 1, wherein each second credit sub-resource has a corresponding resource identification information;
the determining of the second quota sub-resource matched with the acquisition request comprises:
acquiring user identification information for initiating the acquisition request;
and determining the resource identification information matched with the user identification information by adopting a preset corresponding relation between the resource identification information and the user identification information, and determining a second quota of sub-resources matched with the resource identification information.
3. The method for processing the quota resource of claim 1 or 2, wherein the method further comprises:
acquiring the residual quota of each second quota sub-resource at a preset time interval;
determining a blending amount according to the maximum remaining amount value and the minimum remaining amount value in each remaining amount;
and updating the total value of the second quota sub-resource corresponding to the maximum remaining quota value and the total value of the second quota sub-resource corresponding to the minimum remaining quota value based on the allocation quota.
4. The method of claim 3, wherein the updating the total value of the credit of the second credit sub-resource corresponding to the maximum remaining credit value and the total value of the credit of the second credit sub-resource corresponding to the minimum remaining credit value based on the allocated credit comprises:
reducing the allocation quota in the quota total value of the second quota sub-resource corresponding to the maximum remaining quota value so as to update and obtain the quota total value of the second quota sub-resource corresponding to the maximum remaining quota value;
and increasing the allocation quota in the quota total value of the second quota sub-resource corresponding to the minimum remaining quota value so as to update and obtain the quota total value of the second quota sub-resource corresponding to the minimum remaining quota value.
5. The method for processing quota resources of claim 1 or 2, further comprising:
when a supplementary request aiming at the quota resource is received, adding the quota resource corresponding to the supplementary request to at least one of the first quota sub-resource and the at least two second quota sub-resources;
and updating at least one of the consumed quota of the first quota sub-resource and the consumed quota of the at least two second quota sub-resources by adopting the supplementary quota of the supplement request.
6. The method of claim 5, wherein adding the quota resource corresponding to the request to the first quota sub-resource comprises:
when the consumed amount of the first amount sub-resource is not zero and is not less than the supplementary amount, adding the supplementary amount resource to the first amount sub-resource;
adopting the supplementary quota of the supplementary request to update the consumed quota of the first quota sub-resource, comprising the following steps:
and reducing the consumed amount of the first amount of sub-resource by the supplementary amount to update the consumed amount of the first amount of sub-resource.
7. The method of claim 5, wherein adding the quota resource corresponding to the request to the at least two second quota sub-resources comprises:
when the consumed amount of the first amount sub-resource is zero, determining the consumed amount of each second amount sub-resource and a first consumption sum of the consumed amount of each second amount sub-resource;
determining the supplementary limit corresponding to each second limit sub-resource based on the supplementary limit, the consumed limit of each second limit sub-resource and the first consumption sum;
adding the supplementary quota resource corresponding to the supplementary quota of each second quota sub-resource into each second quota sub-resource respectively;
adopting the supplementary quota of the supplementary request to update the consumed quota of the at least two second quota sub-resources, comprising the following steps:
respectively reducing the consumed quota of each second quota sub-resource by the corresponding supplementary quota, so as to update and obtain the consumed quota of each second quota sub-resource.
8. The method for processing quota resources of claim 5, wherein adding quota resources corresponding to the request for replenishment to the first quota sub-resource and the at least two second quota sub-resources comprises:
when the consumed amount of the first amount sub-resource is not zero and is smaller than the supplementary amount, adding the supplementary amount resource aiming at the consumed amount of the first amount sub-resource in the supplementary amount resource into the first amount sub-resource;
determining the consumed amount of each second amount sub-resource, the second consumption sum of the consumed amount of each second amount sub-resource and the remaining supplementary amount of the supplementary amount resource;
determining the supplementary limit corresponding to each second limit sub-resource based on the remaining supplementary limit, the consumed limit of each second limit sub-resource and the second consumption sum;
adding the supplementary quota resource corresponding to the supplementary quota of each second quota sub-resource into each second quota sub-resource respectively;
adopting the supplementary quota of the supplementary request to update the consumed quota of the first quota sub-resource and the consumed quotas of the at least two second quota sub-resources, comprising the following steps:
respectively reducing the consumed amount of each second amount sub-resource by the supplementary amount corresponding to each second amount sub-resource so as to update the consumed amount of each second amount sub-resource;
and updating and clearing the consumed quota of the first quota sub-resource.
9. A processing device of quota resources is characterized in that the quota resources comprise a first quota sub-resource and at least two second quota sub-resources, and the first quota sub-resource is larger than the second quota sub-resources; the device comprises:
the receiving module is used for receiving an acquisition request aiming at the quota resource;
the first determining module is used for determining a second quota sub-resource matched with the acquisition request;
a first updating module, configured to deduct the quota resource of the acquired quota from the first quota sub-resource and update the consumed quota of the first quota sub-resource when the acquired quota of the acquisition request is greater than the remaining quota of the matched second quota sub-resource;
and the second updating module is used for deducting the quota resource of the acquired quota from the matched second quota sub-resource and updating the consumed quota of the matched second quota sub-resource when the acquired quota of the acquisition request is not more than the remaining quota of the matched second quota sub-resource.
10. An electronic device, comprising:
a processor, a memory, and a bus;
the bus is used for connecting the processor and the memory;
the memory is used for storing operation instructions;
the processor is used for executing the processing method of the quota resource in any one of the claims 1-8 by calling the operation instruction.
11. A computer-readable storage medium for storing computer instructions which, when executed on a computer, enable the computer to perform the method for processing credit resources according to any one of claims 1 to 8.
CN201910625848.6A 2019-07-11 2019-07-11 Method and device for processing quota resources, electronic equipment and readable storage medium Active CN111190910B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910625848.6A CN111190910B (en) 2019-07-11 2019-07-11 Method and device for processing quota resources, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910625848.6A CN111190910B (en) 2019-07-11 2019-07-11 Method and device for processing quota resources, electronic equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN111190910A true CN111190910A (en) 2020-05-22
CN111190910B CN111190910B (en) 2024-01-09

Family

ID=70707134

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910625848.6A Active CN111190910B (en) 2019-07-11 2019-07-11 Method and device for processing quota resources, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN111190910B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112669160A (en) * 2021-03-18 2021-04-16 恒生电子股份有限公司 Data processing method and device, electronic equipment and storage medium
CN113139004A (en) * 2021-04-25 2021-07-20 中国工商银行股份有限公司 Quota control method and device, computer equipment and computer readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101299259A (en) * 2008-06-17 2008-11-05 中国工商银行股份有限公司 System and method for resolving data resource access hot point problem
CN104303527A (en) * 2011-12-21 2015-01-21 瑞典爱立信有限公司 Methods of providing communication services including account balance sharing and related charging systems
CN107040567A (en) * 2016-09-27 2017-08-11 阿里巴巴集团控股有限公司 The management-control method and device of pre-allocation of resources amount
CN108446974A (en) * 2018-03-06 2018-08-24 平安科技(深圳)有限公司 Data processing equipment, method and computer readable storage medium
US10178046B1 (en) * 2015-09-30 2019-01-08 Google Llc Reducing quota access

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101299259A (en) * 2008-06-17 2008-11-05 中国工商银行股份有限公司 System and method for resolving data resource access hot point problem
CN104303527A (en) * 2011-12-21 2015-01-21 瑞典爱立信有限公司 Methods of providing communication services including account balance sharing and related charging systems
US10178046B1 (en) * 2015-09-30 2019-01-08 Google Llc Reducing quota access
CN107040567A (en) * 2016-09-27 2017-08-11 阿里巴巴集团控股有限公司 The management-control method and device of pre-allocation of resources amount
CN108446974A (en) * 2018-03-06 2018-08-24 平安科技(深圳)有限公司 Data processing equipment, method and computer readable storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112669160A (en) * 2021-03-18 2021-04-16 恒生电子股份有限公司 Data processing method and device, electronic equipment and storage medium
CN112669160B (en) * 2021-03-18 2021-06-29 恒生电子股份有限公司 Data processing method and device, electronic equipment and storage medium
CN113139004A (en) * 2021-04-25 2021-07-20 中国工商银行股份有限公司 Quota control method and device, computer equipment and computer readable storage medium
CN113139004B (en) * 2021-04-25 2024-03-01 中国工商银行股份有限公司 Method and device for controlling credit, computer equipment and computer readable storage medium

Also Published As

Publication number Publication date
CN111190910B (en) 2024-01-09

Similar Documents

Publication Publication Date Title
CN108564269B (en) Distribution task allocation method and device, electronic equipment and computer storage medium
US20100115246A1 (en) System and method of data partitioning for parallel processing of dynamically generated application data
CN110633296A (en) Data query method, device, medium and electronic equipment
US20220229701A1 (en) Dynamic allocation of computing resources
CN102473106A (en) Resource allocation in virtualized environments
CN110706093A (en) Accounting processing method and device
CN110489418B (en) Data aggregation method and system
CN111553699B (en) Resource scheduling method and device
CN105488125A (en) Page access method and apparatus
CN112132674A (en) Transaction processing method and device
CN110729038A (en) Cost sharing method and device, electronic equipment and computer-readable storage medium
CN111190910B (en) Method and device for processing quota resources, electronic equipment and readable storage medium
CN112150023A (en) Task allocation method, device and storage medium
CN107147610B (en) Resource processing method and device
CN110460987B (en) Card writing method, device, server and storage medium
CN110096352A (en) Process management method, device and computer readable storage medium
WO2021068585A1 (en) Resource processing method and apparatus, electronic device, and medium
CN111583030B (en) Payment routing method and device
CN110705884B (en) List processing method, device, equipment and storage medium
CN112348298B (en) Designer management method, designer management device, electronic terminal and storage medium
CN113312184A (en) Service data processing method and related equipment
CN112000462A (en) Data processing method and device based on shared peripheral resources
CN113204426A (en) Task processing method of resource pool and related equipment
CN113011607A (en) Resource recovery method, device, equipment and storage medium
CN115361285B (en) Method, device, equipment and medium for realizing off-line service mixed deployment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant