CN111190910B - Method and device for processing quota resources, electronic equipment and readable storage medium - Google Patents
Method and device for processing quota resources, electronic equipment and readable storage medium Download PDFInfo
- Publication number
- CN111190910B CN111190910B CN201910625848.6A CN201910625848A CN111190910B CN 111190910 B CN111190910 B CN 111190910B CN 201910625848 A CN201910625848 A CN 201910625848A CN 111190910 B CN111190910 B CN 111190910B
- Authority
- CN
- China
- Prior art keywords
- credit
- resource
- sub
- quota
- supplementary
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 33
- 230000001502 supplementing effect Effects 0.000 claims description 10
- 230000000977 initiatory effect Effects 0.000 claims description 9
- 238000003672 processing method Methods 0.000 abstract description 5
- 230000000153 supplemental effect Effects 0.000 description 13
- 238000010586 diagram Methods 0.000 description 5
- 238000004364 calculation method Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 238000011897 real-time detection Methods 0.000 description 3
- 239000013589 supplement Substances 0.000 description 3
- 230000006978 adaptation Effects 0.000 description 2
- 238000004590 computer program Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000000802 evaporation-induced self-assembly Methods 0.000 description 1
- 230000003203 everyday effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/23—Updating
- G06F16/2308—Concurrency control
- G06F16/2315—Optimistic concurrency control
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2453—Query optimisation
- G06F16/24534—Query rewriting; Transformation
- G06F16/24547—Optimisations to support specific applications; Extensibility of optimisers
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2457—Query processing with adaptation to user needs
-
- Y—GENERAL 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
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE 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/00—Energy 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)
- Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
The application provides a processing method and device of a credit resource, 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 for the quota resources is received, determining a second quota child resource matched with the acquisition request; when the acquired limit of the acquired request is larger than the residual limit of the matched second limit sub-resource, deducting the limit resource of the acquired limit from the first limit sub-resource, and updating the consumed limit of the first limit sub-resource; and when the acquired quota of the acquired request is not greater than the residual quota of the matched second quota sub-resource, 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. The method and the device solve the problem that in the prior art, the user with large quota can not be provided with quota resources, so that normal business of the user is affected, and user experience is improved.
Description
Technical Field
The present application relates to the field of internet technologies, and in particular, to a method and an apparatus for processing a credit resource, an electronic device, and a computer readable storage medium.
Background
Database hot spot data refers to data which needs to be frequently updated in a database in a high concurrency scene in an internet system. In the financial industry, a large number of service requests access hot spot data in a database every day, and each service request updates the hot spot data in the database. For example, the operations of money taking, saving, transferring and the like by the user are all updating operation of hot spot data corresponding to the quota resources in the database.
In a high concurrency scenario, each service request needs to add a row-level lock to the hotspot data when updating the hotspot data, and other service requests need to wait when updating the hotspot data, which causes overtime of the request or other system problems.
For example, as shown in table 1, the total credit of the credit resource is 10000, and a row is configured in the database, then each service request needs to query and update the row record (hotspot data), and update the consumed credit field.
Total amount of money | Already consumed credit |
10000 | 500 |
TABLE 1
Thus, when any service request operates on the data, other service requests can only wait; moreover, when the available credit (total credit-consumed credit) is smaller than the credit required by the service request, the situation that the user cannot acquire credit resources all the time occurs, thereby affecting normal service.
Disclosure of Invention
The application provides a processing method, a device, electronic equipment and a computer readable storage medium of a credit resource, which can solve the problems that when a plurality of service requests operate on the same hot spot data request in the prior art, only one service request can operate on the hot spot data, so that other service requests can only wait, the processing efficiency is lower, and for the service requests exceeding the total credit of the credit resource, the operation on the hot spot data corresponding to the credit resource can not be performed all the time, so that a user can not acquire the credit resource all the time, thereby influencing normal service. The technical scheme is as follows:
in a first aspect, a method for processing a credit resource is provided, where the credit resource includes a first credit sub-resource and at least two second credit sub-resources, and the first credit sub-resource is greater than the second credit sub-resource; the method comprises the following steps:
when an acquisition request for the quota resources is received, determining a second quota child resource matched with the acquisition request;
when the acquired quota of the acquisition request is larger than the residual quota of the matched second quota sub-resource, deducting the quota resource of the acquired quota from the first quota sub-resource, and updating the consumed quota of the first quota sub-resource;
And when the acquired quota of the acquisition request is not greater than the residual quota of the matched second quota sub-resource, 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.
Each second quota child resource is provided with corresponding resource identification information respectively;
the determining the second quota child resource matched with the acquisition request includes:
acquiring user identification information for initiating the acquisition request;
and determining 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 limit sub-resource matched with the resource identification information.
Preferably, the method further comprises:
obtaining the residual quota of each second quota child resource at preset time intervals;
determining the allocation credit according to the maximum residual credit value and the minimum residual credit value in each residual credit;
and updating the sum total value of the second sum sub-resource corresponding to the maximum remaining sum value and the sum total value of the second sum sub-resource corresponding to the minimum remaining sum value based on the allocation sum.
Preferably, the updating the sum total value of the second sum sub-resource corresponding to the maximum remaining sum value and the sum total value of the second sum sub-resource corresponding to the minimum remaining sum value based on the allocation sum includes:
reducing the allocation credit in the credit total value of the second credit sub-resource corresponding to the maximum residual credit value to update and obtain the credit total value of the second credit sub-resource corresponding to the maximum residual credit value;
and adding the allocation credit in the credit total value of the second credit sub-resource corresponding to the minimum residual credit value to update and obtain the credit total value of the second credit sub-resource corresponding to the minimum residual credit value.
Preferably, the method further comprises:
when a supplementary request for the credit resource is received, adding the supplementary credit resource corresponding to the supplementary request to at least one of the first credit sub-resource and the at least two second credit sub-resources;
and updating at least one of the consumed credit of the first credit sub-resource and the consumed credit of the at least two second credit sub-resources by adopting the supplementary credit of the supplementary request.
Preferably, adding the supplementary credit resource corresponding to the supplementary request to the first credit sub-resource includes:
When the consumed quota of the first quota sub-resource is not zero and is not smaller than the supplementary quota, adding the supplementary quota resource into the first quota sub-resource;
updating the consumed credit of the first credit sub-resource with the supplementary credit of the supplementary request, including:
and reducing the consumed quota of the first quota child resource by the supplementary quota so as to update and obtain the consumed quota of the first quota child resource.
Preferably, adding the supplementary credit resource corresponding to the supplementary request to the at least two second credit sub-resources includes:
when the consumed quota of the first quota sub-resource is zero, determining the consumed quota of each second quota sub-resource and the first consumption sum of the consumed quota of each second quota sub-resource;
determining the corresponding supplementary credit of each second credit sub-resource based on the supplementary credit, the consumed credit of each second credit sub-resource and the first consumption sum;
adding the supplementary credit resources corresponding to the supplementary credit of each second credit sub-resource into each second credit sub-resource respectively;
updating the consumed credit of the at least two second credit sub-resources with the supplemental credit of the supplemental request, comprising:
And respectively reducing the consumed credit of each second credit sub-resource by the corresponding supplementary credit so as to update and obtain the consumed credit of each second credit sub-resource.
Preferably, adding the supplementary credit resource corresponding to the supplementary request to the first credit sub-resource and the at least two second credit sub-resources includes:
when the consumed credit of the first credit sub-resource is not zero and is smaller than the supplementary credit, adding the supplementary credit resource aiming at the consumed credit of the first credit sub-resource in the supplementary credit resource to the first credit sub-resource;
determining the consumed credit of each second credit sub-resource, the second consumption sum of the consumed credit of each second credit sub-resource and the residual supplementary credit of the supplementary credit resource;
determining the corresponding supplementary credit of each second credit sub-resource based on the residual supplementary credit, the consumed credit of each second credit sub-resource and the second consumption sum;
adding the supplementary credit resources corresponding to the supplementary credit of each second credit sub-resource into each second credit sub-resource respectively;
updating the consumed credit of the first credit sub-resource and the consumed credit of the at least two second credit sub-resources with the supplemental credit of the supplemental request, comprising:
The consumed credit of each second credit sub-resource is reduced by the corresponding supplementary credit of each second credit sub-resource so as to update and obtain the consumed credit of each second credit sub-resource;
and resetting the consumed quota update of the first quota child resource.
In a second aspect, a device for processing a credit resource is provided, where the credit resource includes a first credit sub-resource and at least two second credit sub-resources, and the first credit sub-resource is greater than the second credit sub-resource; the device comprises:
the receiving module is used for receiving an acquisition request aiming at the limit resources;
the first determining module is used for determining a second quota child resource matched with the acquisition request;
the first updating module is used for deducting the quota resources of the acquired quota from the first quota sub-resource and updating the consumed quota of the first quota sub-resource when the acquired quota of the acquisition request is larger than the residual quota of the matched second quota sub-resource;
and the second updating module is used for deducting the credit resource of the acquired credit from the matched second credit sub-resource and updating the consumed credit of the matched second credit sub-resource when the acquired credit of the acquired request is not greater than the residual credit of the matched second credit sub-resource.
Preferably, each second quota child resource has corresponding resource identification information;
the first determining module includes:
the user identification information sub-module is used for acquiring the user identification information for initiating the acquisition request;
and the matching sub-module 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 limit sub-resource matched with the resource identification information.
Preferably, the apparatus further comprises:
the first acquisition module is used for acquiring the residual quota of each second quota child resource at preset time intervals;
the second determining module is used for determining the allocation credit according to the maximum residual credit value and the minimum residual credit value in each residual credit;
and the third updating module is used for updating the sum total value of the second sum sub-resources corresponding to the maximum residual sum value and the sum total value of the second sum sub-resources corresponding to the minimum residual sum value based on the allocation sum.
Preferably, the third updating module includes:
the first credit total value updating sub-module is used for reducing the allocation credit in the credit total value of the second credit sub-resource corresponding to the maximum residual credit value so as to update and obtain the credit total value of the second credit sub-resource corresponding to the maximum residual credit value;
And the second quota total value updating sub-module is used for adding the allocation quota in the total quota value of the second quota sub-resource corresponding to the minimum residual quota value so as to update and obtain the total quota value of the second quota sub-resource corresponding to the minimum residual quota value.
Preferably, the method further comprises:
the receiving module is further configured to receive a replenishment request for the quota resource;
the supplementing module is used for adding the supplementing quota resources corresponding to the supplementing request to at least one of the first quota sub-resource and the at least two second quota sub-resources;
and a fourth updating module, configured to update at least one of the consumed quota of the first quota child resource and the consumed quota of the at least two second quota child resources with the supplementary quota of the supplementary request.
Preferably, the supplementary module is specifically configured to:
when the consumed quota of the first quota sub-resource is not zero and is not smaller than the supplementary quota, adding the supplementary quota resource into the first quota sub-resource;
the fourth updating module is specifically configured to:
and reducing the consumed quota of the first quota child resource by the supplementary quota so as to update and obtain the consumed quota of the first quota child resource.
Preferably, the supplementary module includes:
the first determining sub-module is configured to determine, when the consumed credit of the first credit sub-resource is zero, the consumed credit of each second credit sub-resource and a first sum of consumed credits of each second credit sub-resource;
the second determining sub-module is used for determining the supplementary credit corresponding to each second credit sub-resource based on the supplementary credit, the consumed credit of each second credit sub-resource and the first consumption sum;
the first adding sub-module is used for respectively adding the supplementary credit resources corresponding to the supplementary credit of each second credit sub-resource into each second credit sub-resource;
the fourth updating module is specifically configured to:
and respectively reducing the consumed credit of each second credit sub-resource by the corresponding supplementary credit so as to update and obtain the consumed credit of each second credit sub-resource.
Preferably, the supplementary module includes:
the second adding sub-module is configured to add, when the consumed credit of the first credit sub-resource is not zero and is smaller than the supplementary credit, a supplementary credit resource of the consumed credit for the first credit sub-resource in the supplementary credit resource to the first credit sub-resource;
A third determining sub-module, configured to determine a consumed credit of each second credit sub-resource, a second sum of consumed credits of each second credit sub-resource, and a remaining supplementary credit of the supplementary credit resource;
a fourth determining sub-module, configured to determine a supplementary credit corresponding to each second credit sub-resource based on the remaining supplementary credit, the consumed credit of each second credit sub-resource, and the second consumption sum;
the third adding sub-module is used for respectively adding the supplementary credit resources corresponding to the supplementary credit of each second credit sub-resource into each second credit sub-resource;
the fourth updating module is specifically configured to:
and respectively reducing the consumed credit of each second credit sub-resource by the corresponding supplementary credit of each second credit sub-resource so as to update and obtain the consumed credit of each second credit sub-resource, and clearing the consumed credit of the first credit sub-resource.
In a third aspect, an electronic device is provided, the 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 configured to, by invoking the operation instruction, cause the processor to execute an operation corresponding to a processing method of the credit resource as shown in the first aspect of the present application.
In a fourth aspect, a computer readable storage medium is provided, on which a computer program is stored, which program, when being executed by a processor, implements a method for processing a credit resource as described in the first aspect of the present application.
The beneficial effects that this application provided technical scheme brought are:
splitting the credit resource into a first credit sub-resource with large credit and at least two second credit sub-resources with small credit, and correspondingly splitting hot spot data corresponding to the credit resource according to the first credit sub-resources and each second credit sub-resource, so that when a user initiates a service request of the credit resource with large credit, the service request can operate the hot spot data corresponding to the first credit sub-resources and provide the credit resource for the user by adopting the first credit sub-resources with large credit; when a user initiates a service request of a small-credit resource, the service request can operate hot spot data corresponding to a matched second credit sub-resource, and the corresponding second credit sub-resource is adopted to provide credit resources for the user, so that the service request of any credit resource can be responded, normal service is not influenced, a plurality of service requests can be simultaneously responded, the processing efficiency is improved, flexible credit resource providing strategies are 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 on the same hot spot data, only one service request can operate the hot spot data, other service requests can only wait, the processing efficiency is lower, and for the service request exceeding the total credit of the credit resource, the user can not operate the hot spot data corresponding to the credit resource, so that the user can not acquire the credit resource all the time, thereby influencing normal service is solved, and the user experience is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings that are required to be 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 a credit resource according to an embodiment of the present application;
FIG. 2 is a flowchart illustrating a method for processing credit resources according to another embodiment of the present disclosure;
FIG. 3 is a flowchart illustrating a method for processing credit resources according to another embodiment of the present disclosure;
fig. 4-1 is a schematic structural diagram of a processing device for credit resources according to another embodiment of the present application;
fig. 4-2 is a schematic structural diagram of a processing device for credit resources according to another embodiment of the present application;
fig. 4-3 are schematic structural diagrams of a processing device for credit resources according to another embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device for processing credit resources according to another embodiment of the present application.
Detailed Description
Embodiments of the present application are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals refer to the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by referring to the drawings are exemplary only for the purpose of illustrating the present application and are not to be construed as limiting the invention.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless expressly stated otherwise, as understood by those skilled in the art. 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. The term "and/or" as used herein includes all or any element and all combination of one or more of the associated listed items.
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
The processing method, device, electronic equipment and computer readable storage medium of the quota resources aim to solve the technical problems in the prior art.
The following describes the technical solutions of the present application and how the technical solutions of the present application solve the above technical problems in detail with specific embodiments. The following embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments. Embodiments of the present application will be described below with reference to the accompanying drawings.
In one embodiment, as shown in fig. 1, the credit resource includes a first credit sub-resource and at least two second credit sub-resources, where the first credit sub-resource is greater than the second credit sub-resource.
The method and the device can be applied to loan type business of a financial platform, the line resources can be resources with the line, and hot spot data corresponding to the line resources are recorded in a preset database. For example, the financial platform 'financial accounting system' provides 1000 ten thousand Yuan-nationality coins for lending business, and meanwhile, a preset database is adopted to manage the hot spot data '1000 ten thousand' corresponding to 1000 ten thousand Yuan-nationality coins.
In this application, the method may split the credit resource into a plurality of credit sub-resources during system initialization, including: and simultaneously, correspondingly splitting the hot spot data in the database.
For example, the total value of the quota resources is 1000 ten thousand, the operator designates that the quota allocation ratio of the first quota sub-resource is 50%, the remaining quota resources are equally divided into 10 second quota sub-resources, meanwhile, the hot spot data in the database is correspondingly split into 1000 ten thousand, and the splitting result is shown in table 2:
splitting ID | Corresponding account tail number | Total value of credit | Already consumed credit |
First quota child resource | All of which | 500 ten thousand | 0 |
Second credit child resource 1 | 0 | 50 ten thousand (50) | 0 |
Second credit child resource 2 | 1 | 50 ten thousand (50) | 0 |
Second credit child resource 3 | 2 | 50 ten thousand (50) | 0 |
... | ... | ... | ... |
Second credit child resource 10 | 9 | 50 ten thousand (50) | 0 |
TABLE 2
Wherein the account of the user can be in digital form, such as a QQ number, then the different tail numbers of the account respectively correspond to different second-credit sub-resources.
It should be noted that the above-mentioned splitting manner, ratio, etc. are merely for illustration, and in practical application, the splitting manner, ratio, etc. may be adjusted according to actual needs, which is not limited in this application.
The method comprises the following steps:
step S101, when an acquisition request for the quota resources is received, determining a second quota child resource matched with the acquisition request;
the request for obtaining the credit resource can be a service request such as borrowing, loan, and pad resource initiated by a user. And when the server receives a service request initiated by the user, determining the second quota child resource matched with the user based on the account of the user.
In a preferred embodiment of the present invention, each second credit sub-resource has corresponding resource identification information;
determining a second credit child resource that matches the acquisition request includes:
acquiring user identification information for initiating an 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 child resource matched with the resource identification information.
Specifically, each split second credit sub-resource has corresponding resource identification information, for example, "second credit sub-resource 1," "second credit sub-resource 2," "second credit sub-resource 10," and the like in table 2, where each resource identification information corresponds to an account, for example, as shown in table 2, second credit sub-resource 1 corresponds to an account with a tail number of 0, second credit sub-resource 2 corresponds to an account with a tail number of 1, and the like, so that after receiving a service request, the server may obtain user identification information, for example, a last tail number of the account, and then determine resource identification information matched with the user identification information by adopting a preset correspondence between the resource identification information and the user identification information, and may determine the second credit sub-resource matched with the user identification information according to the resource identification information.
Of course, the corresponding second credit sub-resource may be determined based on the multi-digit tail number of the account, the number of digits of the account, or a combination thereof, or even otherwise, in addition to the last digit of the account, which is not limited in this application.
Step S102, deducting the acquired quota resources from the first quota sub-resource and updating 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;
after the matched second credit sub-resource is determined, the remaining credit of the second credit sub-resource is acquired, namely the consumed credit is subtracted from the total credit value, then whether the acquired credit in the acquisition request initiated by the user is larger than the remaining credit of the matched second credit sub-resource is judged, if so, the credit resource of the acquired credit is deducted from the first credit sub-resource, and the remaining credit of the first credit sub-resource is updated. For example, as shown in table 2, an account with a tail number of 1 initiates a loan 100 ten thousand service request, and the remaining credit of the second credit sub-resource 2 matched with the request is 50 ten thousand, which is less than 100 ten thousand in the service request, so 100 ten thousand is deducted from the first credit sub-resource, and the consumed credit is updated from "0" to "100 ten thousand" (not shown in table 2).
Further, in order to ensure that the service request with a large amount of users is satisfied, the acquired amount in the single service request may be set to be smaller than the total amount of the first amount sub-resources. For example, the total value of the first quota child resource is 500 ten thousand, and then the acquired quota in the single service request may be set to be less than or equal to 500 ten thousand, for example 300 ten thousand, or 100 ten thousand.
Step S103, deducting the acquired credit resources from the matched second credit sub-resources and updating the consumed credit of the matched second credit sub-resources when the acquired credit of the acquired request is not greater than the residual credit of the matched second credit sub-resources.
And if the acquired credit in the acquisition request initiated by the user is not greater than the residual credit of the matched second credit sub-resource, deducting the credit resource of the acquired credit from the matched second credit sub-resource, and updating the residual credit of the second credit sub-resource. For example, as shown in table 2, an account with the tail number of 2 initiates a loan 10 ten thousand service request, and the remaining credit of the second credit sub-resource 3 matched with the request is 50 ten thousand and is greater than 10 ten thousand in the service request, so 10 ten thousand consumed credit is deducted from the second credit sub-resource 3 and updated from "0" to "10 ten thousand" (not shown in table 2).
In the embodiment of the invention, the credit resource is split into the first credit sub-resource with large credit and the second credit sub-resources with at least two small credits, and meanwhile, the hot spot data corresponding to the credit resource is correspondingly split according to the first credit sub-resource and each second credit sub-resource, so that when a user initiates a service request of the credit resource with large credit, the service request can operate the hot spot data corresponding to the first credit sub-resource and the first credit sub-resource with large credit is adopted to provide the credit resource for the user; when a user initiates a service request of a small-credit resource, the service request can operate hot spot data corresponding to a matched second credit sub-resource, and the corresponding second credit sub-resource is adopted to provide credit resources for the user, so that the service request of any credit resource can be responded, normal service is not influenced, a plurality of service requests can be simultaneously responded, the processing efficiency is improved, flexible credit resource providing strategies are 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 on the same hot spot data, only one service request can operate the hot spot data, other service requests can only wait, the processing efficiency is lower, and for the service request exceeding the total credit of the credit resource, the user can not operate the hot spot data corresponding to the credit resource, so that the user can not acquire the credit resource all the time, thereby influencing normal service is solved, and the user experience is improved.
In another embodiment, as shown in fig. 2, the credit resource includes a first credit sub-resource and at least two second credit sub-resources, where the first credit sub-resource is greater than the second credit sub-resource. The detailed descriptions of the credit resource, the first credit sub-resource and the second credit sub-resource can refer to the previous embodiment, and are not described herein.
The method comprises the following steps:
step S201, when an acquisition request for the quota resources is received, determining a second quota child resource matched with the acquisition request;
in a preferred embodiment of the present invention, each second credit sub-resource has corresponding resource identification information;
determining a second credit child resource that matches the acquisition request includes:
acquiring user identification information for initiating an 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 child resource matched with the resource identification information.
Step S202, deducting the acquired credit resources from the first credit sub-resources and updating the consumed credit of the first credit sub-resources when the acquired credit of the acquired request is greater than the remaining credit of the matched second credit sub-resources;
Step S203, deducting the acquired credit resources from the matched second credit sub-resources and updating the consumed credit of the matched second credit sub-resources when the acquired credit of the acquired request is not greater than the residual credit of the matched second credit sub-resources;
the steps S201 to S203 may refer to the steps S101 to S103 specifically, and will not be described here again.
Step S204, obtaining the residual quota of each second quota child resource at preset time intervals;
step S205, determining the allocation credit according to the maximum residual credit value and the minimum residual credit value in each residual credit;
step S206, updating the sum total value of the second sum sub-resource corresponding to the maximum remaining sum value and the sum total value of the second sum sub-resource corresponding to the minimum remaining sum value based on the allocation sum.
In a preferred embodiment of the present invention, updating the sum total value of the second sum sub-resource corresponding to the maximum remaining sum value and the sum total value of the second sum sub-resource corresponding to the minimum remaining sum value based on the allocation sum includes:
reducing the allocation credit in the credit total value of the second credit sub-resource corresponding to the maximum residual credit value so as to update and obtain the credit total value of the second credit sub-resource corresponding to the maximum residual credit value;
And adding the allocation credit in the credit total value of the second credit sub-resource corresponding to the minimum residual credit value to update and obtain the credit total value of the second credit sub-resource corresponding to the minimum residual credit value.
Specifically, as shown in table 2, after the credit resource is split into a plurality of credit sub-resources, in order to ensure that the remaining credits of each second credit sub-resource are balanced, the system may continuously check the remaining credits of each second credit sub-resource or at preset time intervals, and allocate the remaining credits of each second credit sub-resource in real time, as follows:
1) Calculating the available credit (credit total value-consumed credit) of each second credit sub-resource;
2) Determining the maximum residual amount value and the minimum residual amount value in each residual amount, and determining the allocation amount according to the maximum residual amount value and the minimum residual amount value;
3) Based on the allocation credit, updating the credit total value of the second credit sub-resource corresponding to the maximum residual credit value and the credit total value of the second credit sub-resource corresponding to the minimum residual credit value (allocating the second credit sub-resource with more residual credit to the second credit sub-resource with less residual credit);
Assuming that the sum total value of the second quota child resource with the largest remaining quota is denoted as total_1, and the consumed quota is denoted as condume_1; the sum of the second sum sub-resource with the least residual sum is marked as total_2, and the consumed sum is marked as consume_2; then the calculation formula of the allotment is:
[(total_1-consume_1)+(total_2-consume_2)]/2-[(total_2-consume_2)]。
for example, the records of the current first credit sub-resource and each second credit sub-resource are shown in table 3:
TABLE 3 Table 3
The calculation shows that, in each second quota sub-resource, the remaining quota of the second quota sub-resource 1 is minimum, 15 ten thousand, the remaining quota of the second quota sub-resource 3 is maximum, 45 ten thousand, and the calculation of the formula is adopted to obtain the allocation quota as follows: (45+15)/2-15=15 (ten thousand), then deducting the allocated quota resources from the second quota sub-resource 3, updating the total value of the allocated quota to be 35 ten thousand, and meanwhile, supplementing the allocated quota resources to the second quota sub-resource 1, updating the total value of the allocated quota to be 65 ten thousand, so that the remaining quota of the second quota sub-resource 1 and the second quota sub-resource 3 after allocation is 30 ten thousand, as shown in table 4:
splitting ID | Corresponding account tail number | Total value of credit | Already consumed credit |
First quota child resource | All of which | 500 ten thousand | 100 ten thousand |
Second credit child resource 1 | 0 | 65 ten thousand (ten thousand) | 35 ten thousand (ten thousand) |
Second credit child resource 2 | 1 | 50 ten thousand (50) | 20 ten thousand (20) |
Second credit child resource 3 | 2 | 35 ten thousand (ten thousand) | 5 ten thousand (5) |
... | ... | ... | ... |
Second credit child resource 10 | 9 | 50 ten thousand (50) | 20 ten thousand (20) |
TABLE 4 Table 4
In the embodiment of the invention, the credit resource is split into the first credit sub-resource with large credit and the second credit sub-resources with at least two small credits, and meanwhile, the hot spot data corresponding to the credit resource is correspondingly split according to the first credit sub-resource and each second credit sub-resource, so that when a user initiates a service request of the credit resource with large credit, the service request can operate the hot spot data corresponding to the first credit sub-resource and the first credit sub-resource with large credit is adopted to provide the credit resource for the user; when a user initiates a service request of a small-credit resource, the service request can operate hot spot data corresponding to a matched second credit sub-resource, and the corresponding second credit sub-resource is adopted to provide credit resources for the user, so that the service request of any credit resource can be responded, normal service is not influenced, a plurality of service requests can be simultaneously responded, the processing efficiency is improved, flexible credit resource providing strategies are 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 on the same hot spot data, only one service request can operate the hot spot data, other service requests can only wait, the processing efficiency is lower, and for the service request exceeding the total credit of the credit resource, the user can not operate the hot spot data corresponding to the credit resource, so that the user can not acquire the credit resource all the time, thereby influencing normal service is solved, and the user experience is improved.
Further, the real-time detection is carried out on the residual quota of each quota sub-resource, and the real-time allocation of the quota resource is carried out on the quota sub-resource with the maximum residual quota and the quota sub-resource with the minimum residual quota, so that the balance of the residual quota of each quota sub-resource is ensured, and the utilization rate of each quota sub-resource is improved.
In another embodiment, as shown in fig. 3, the credit resource includes a first credit sub-resource and at least two second credit sub-resources, where the first credit sub-resource is greater than the second credit sub-resource. The detailed descriptions of the credit resource, the first credit sub-resource and the second credit sub-resource can refer to the previous embodiment, and are not described herein.
The method comprises the following steps:
step S301, when an acquisition request for the quota resources is received, determining a second quota child resource matched with the acquisition request;
in a preferred embodiment of the present invention, each second credit sub-resource has corresponding resource identification information;
determining a second credit child resource that matches the acquisition request includes:
acquiring user identification information for initiating an 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 child resource matched with the resource identification information.
Step S302, deducting the acquired credit resources from the first credit sub-resources and updating the consumed credit of the first credit sub-resources when the acquired credit of the acquired request is greater than the remaining credit of the matched second credit sub-resources;
step S303, deducting the credit resources of the acquired credit from the matched second credit sub-resources and updating the consumed credit of the matched second credit sub-resources when the acquired credit of the acquired request is not greater than the remaining credit of the matched second credit sub-resources.
Step S304, obtaining the residual quota of each second quota child resource at preset time intervals;
step S305, determining the allocation credit according to the maximum residual credit value and the minimum residual credit value in each residual credit;
step S306, updating the sum total value of the second sum sub-resource corresponding to the maximum remaining sum value and the sum total value of the second sum sub-resource corresponding to the minimum remaining sum value based on the allocation sum;
In a preferred embodiment of the present invention, updating the sum total value of the second sum sub-resource corresponding to the maximum remaining sum value and the sum total value of the second sum sub-resource corresponding to the minimum remaining sum value based on the allocation sum includes:
reducing the allocation credit in the credit total value of the second credit sub-resource corresponding to the maximum residual credit value so as to update and obtain the credit total value of the second credit sub-resource corresponding to the maximum residual credit value;
and adding the allocation credit in the credit total value of the second credit sub-resource corresponding to the minimum residual credit value to update and obtain the credit total value of the second credit sub-resource corresponding to the minimum residual credit value.
The steps S301 to S306 may refer to the steps S201 to S206 specifically, and are not described herein.
Step S307, when receiving the supplement request for the credit resource, adding the supplement credit resource corresponding to the supplement request to at least one of the first credit sub-resource and the at least two second credit sub-resources;
step S308, the consumed credit of the first credit sub-resource and at least one of the consumed credits of the at least two second credit sub-resources are updated with the supplementary credit of the supplementary request.
Specifically, the replenishment request for the credit resource may be a user initiated repayment request. And after receiving the repayment request, the server adds the corresponding supplementary credit resource to at least one of the first credit sub-resource and each second credit sub-resource, and correspondingly updates the consumed credit of the added sub-resource.
That is, if the supplemental credit resource is only added to the first credit sub-resource, only the consumed credit of the first credit sub-resource is updated; if the supplementary credit resource is only added to each second credit sub-resource, only the consumed credit of each second credit sub-resource is updated; if the supplemental credit resource is added to both the first credit sub-resource and the second credit sub-resource, then the consumed credit of the first credit sub-resource and the consumed credit of each second credit sub-resource are updated simultaneously.
In a preferred embodiment of the present invention, adding the supplementary credit resource corresponding to the supplementary request to the first credit sub-resource includes:
when the consumed credit of the first credit sub-resource is not zero and is not smaller than the supplementary credit, adding the supplementary credit resource into the first credit sub-resource;
Updating the consumed credit of the first credit sub-resource with the supplemental credit of the supplemental request, comprising:
and reducing the consumed credit of the first credit sub-resource by the supplementary credit to update and obtain the consumed credit of the first credit sub-resource.
For example, as shown in table 4, the first credit sub-resource is 500 ten thousand, the current consumed credit is 100 ten thousand, and the repayment credit of the user is 50 ten thousand, then 50 ten thousand is added to the first credit sub-resource, and the consumed credit of the first credit sub-resource is updated from 100 ten thousand to 50 ten thousand.
In a preferred embodiment of the present invention, adding the supplementary credit resource corresponding to the supplementary request to at least two second credit sub-resources includes:
when the consumed quota of the first quota sub-resource is zero, determining the consumed quota of each second quota sub-resource and the first consumption sum of the consumed quota of each second quota sub-resource;
determining the supplementary credit corresponding to each second credit sub-resource based on the supplementary credit, the consumed credit of each second credit sub-resource and the first consumption sum;
adding the supplementary credit resources corresponding to the supplementary credit of each second credit sub-resource into each second credit sub-resource respectively;
Updating the consumed credit of the at least two second credit sub-resources with the supplemental credit of the supplemental request, comprising:
and respectively reducing the consumed credit of each second credit sub-resource by the corresponding supplementary credit so as to update and obtain the consumed credit of each second credit sub-resource.
Specifically, when the first credit sub-resource is not consumed (the consumed credit is 0), the supplementary credit corresponding to each second credit sub-resource is calculated according to the consumed credit of each second credit sub-resource, specifically:
1) Calculating the consumed quota of each second quota sub-resource, and counting the sum of the consumption of all the second quota sub-resources, and recording the sum as total_Consume;
2) Calculating the supplementary credit of each second credit sub-resource; assuming that the second credit sub-resource i already consumes the credit resource is condume_i, the supplementary credit of the second credit sub-resource i can be calculated by the following formula:
the second credit sub-resource i's supplementary credit = supplementary_i/total_supplementary (supplementary requested supplementary credit-the first credit sub-resource's refund credit);
thus, the more the second quota child resources are consumed, the more the quota resources are added each time.
For example, the records of the current first credit sub-resource and each second credit sub-resource are shown in table 5, and the repayment amount of the user is 100 ten thousand.
Splitting ID | Corresponding account tail number | Total value of credit | Already consumed credit |
First quota child resource | All of which | 500 ten thousand | 0 |
Second credit child resource 1 | 0 | 50 ten thousand (50) | 30 ten thousand |
Second credit child resource 2 | 1 | 50 ten thousand (50) | 10 ten thousand (10) |
Second credit child resource 3 | 2 | 50 ten thousand (50) | 10 ten thousand (10) |
... | ... | ... | ... |
Second credit child resource 10 | 9 | 50 ten thousand (50) | 10 ten thousand (10) |
TABLE 5
Then, the supplemental credit for the second credit child resource 1 is: 100 (30/120) =25 (ten thousand), and the supplementary credits of the second credit sub-resource 2 to the second credit sub-resource 9 are respectively: 100 (10/120) = 8.3333 (ten thousand), and then each second credit sub-resource adds the corresponding credit resource of the supplementary credit, and updates the supplementary consumed credit, and the records of the updated first credit sub-resource and each second credit sub-resource are shown in table 6:
splitting ID | Corresponding account tail number | Total value of credit | Already consumed credit |
First quota child resource | All of which | 500 ten thousand | 0 |
Second credit child resource 1 | 0 | 50 ten thousand (50) | 5 ten thousand (5) |
Second credit child resource 2 | 1 | 50 ten thousand (50) | 1.6667 ten thousand |
Second credit child resource 3 | 2 | 50 ten thousand (50) | 1.6667 ten thousand |
... | ... | ... | ... |
Second credit child resource 10 | 9 | 50 ten thousand (50) | 1.6667 ten thousand |
TABLE 6
In a preferred embodiment of the present invention, adding the supplementary credit resource corresponding to the supplementary request to the first credit sub-resource and the at least two second credit sub-resources includes:
When the consumed credit of the first credit sub-resource is not zero and is smaller than the supplementary credit, adding the supplementary credit resource aiming at the consumed credit of the first credit sub-resource in the supplementary credit resource into the first credit sub-resource;
determining the consumed credit of each second credit sub-resource, the second consumption sum of the consumed credit of each second credit sub-resource and the residual supplementary credit of the supplementary credit resource;
determining the corresponding supplementary credit of each second credit sub-resource based on the residual supplementary credit, the consumed credit of each second credit sub-resource and the second consumption sum;
adding the supplementary credit resources corresponding to the supplementary credit of each second credit sub-resource into each second credit sub-resource respectively;
updating the consumed credit of the first credit sub-resource and the consumed credit of the at least two second credit sub-resources with the supplemental credit of the supplemental request, comprising:
the consumed credit of each second credit sub-resource is reduced by the corresponding supplementary credit of each second credit sub-resource so as to update and obtain the consumed credit of each second credit sub-resource;
and clearing the consumed quota update of the first quota child resource.
For example, the records of the current first credit sub-resource and each second credit sub-resource are shown in table 7, and the repayment amount of the user is 200 ten thousand.
Splitting ID | Corresponding account tail number | Total value of credit | Already consumed credit |
First quota child resource | All of which | 500 ten thousand | 100 ten thousand |
Second credit child resource 1 | 0 | 50 ten thousand (50) | 30 ten thousand |
Second credit child resource 2 | 1 | 50 ten thousand (50) | 10 ten thousand (10) |
Second credit child resource 3 | 2 | 50 ten thousand (50) | 10 ten thousand (10) |
... | ... | ... | ... |
Second credit child resource 10 | 9 | 50 ten thousand (50) | 10 ten thousand (10) |
TABLE 7
Because the consumed credit of the first credit sub-resource is smaller than the supplementary credit in the supplementary request, it is preferable to add 100 ten thousand credit resources to the first credit sub-resource, clear the consumed credit of the first credit sub-resource after the addition is completed, at this time, the remaining credit of the supplementary credit is 100 ten thousand, calculate the supplementary credit of each second credit sub-resource based on 100 ten thousand, and the supplementary credit of the second credit sub-resource 1 is: 100 (30/120) =25 (ten thousand), and the supplementary credits of the second credit sub-resource 2 to the second credit sub-resource 9 are respectively: 100 (10/120) = 8.3333 (ten thousand), and then each second credit sub-resource adds the corresponding credit resource of the supplementary credit, and updates the supplementary consumed credit, and the records of the updated first credit sub-resource and each second credit sub-resource are shown in table 8:
Splitting ID | Corresponding account tail number | Total value of credit | Already consumed credit |
First quota child resource | All of which | 500 ten thousand | 0 |
Second credit child resource 1 | 0 | 50 ten thousand (50) | 5 ten thousand (5) |
Second credit child resource 2 | 1 | 50 ten thousand (50) | 1.6667 ten thousand |
Second credit child resource 3 | 2 | 50 ten thousand (50) | 1.6667 ten thousand |
... | ... | ... | ... |
Second credit child resource 10 | 9 | 50 ten thousand (50) | 1.6667 ten thousand |
TABLE 8
In the embodiment of the invention, the credit resource is split into the first credit sub-resource with large credit and the second credit sub-resources with at least two small credits, and meanwhile, the hot spot data corresponding to the credit resource is correspondingly split according to the first credit sub-resource and each second credit sub-resource, so that when a user initiates a service request of the credit resource with large credit, the service request can operate the hot spot data corresponding to the first credit sub-resource and the first credit sub-resource with large credit is adopted to provide the credit resource for the user; when a user initiates a service request of a small-credit resource, the service request can operate hot spot data corresponding to a matched second credit sub-resource, and the corresponding second credit sub-resource is adopted to provide credit resources for the user, so that the service request of any credit resource can be responded, normal service is not influenced, a plurality of service requests can be simultaneously responded, the processing efficiency is improved, flexible credit resource providing strategies are 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 on the same hot spot data, only one service request can operate the hot spot data, other service requests can only wait, the processing efficiency is lower, and for the service request exceeding the total credit of the credit resource, the user can not operate the hot spot data corresponding to the credit resource, so that the user can not acquire the credit resource all the time, thereby influencing normal service is solved, and the user experience is improved.
Further, the real-time detection is carried out on the residual quota of each quota sub-resource, and the real-time allocation of the quota resource is carried out on the quota sub-resource with the maximum residual quota and the quota sub-resource with the minimum residual quota, so that the balance of the residual quota of each quota sub-resource is ensured, and the utilization rate of each quota sub-resource is improved.
Furthermore, when a repayment request of a user is received, targeted credit resource replenishment can be performed according to consumed credit of each credit sub-resource, so that more credit sub-resources are consumed to replenish more credit resources, the balance of the residual credit of each credit sub-resource is further ensured, and the utilization rate of each credit sub-resource is improved.
Fig. 4-1 is a schematic structural diagram of a device for processing a credit resource according to another embodiment of the present application, where, as shown in fig. 4-1, the credit resource includes a first credit sub-resource and at least two second credit sub-resources, and the first credit sub-resource is larger than the second credit sub-resource;
the apparatus of this embodiment may include:
a receiving module 401, configured to receive an acquisition request for a credit resource;
a first determining module 402, configured to determine a second credit child resource that matches the acquisition request;
A first updating module 403, configured to deduct the credit resource of the acquired credit from the first credit sub-resource and update the consumed credit of the first credit sub-resource when the acquired credit of the acquired request is greater than the remaining credit of the matched second credit sub-resource;
the second updating module 404 is configured to deduct the credit resource of the acquired credit from the matched second credit sub-resource and update the consumed credit of the matched second credit sub-resource when the acquired credit of the acquired request is not greater than the remaining credit of the matched second credit sub-resource.
In a preferred embodiment of the present invention, each second credit sub-resource has corresponding resource identification information;
the first determination module includes:
the user identification information sub-module is used for acquiring user identification information for initiating an acquisition request;
and the matching sub-module 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 limit sub-resource matched with 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, at a preset time interval, a remaining credit of each second credit sub-resource;
A second determining module 406, configured to determine the allocation credit according to the maximum remaining credit value and the minimum remaining credit value in the remaining credit values;
the third updating module 407 is configured to update, based on the allocation credit, a total credit value of the second credit sub-resource corresponding to the maximum remaining credit value and a total credit value of the second credit sub-resource corresponding to the minimum remaining credit value.
In a preferred embodiment of the invention, the third updating module comprises:
the first credit total value updating sub-module is used for reducing the allocation credit in the credit total value of the second credit sub-resource corresponding to the maximum residual credit value so as to update and obtain the credit total value of the second credit sub-resource corresponding to the maximum residual credit value;
and the second quota total value updating sub-module is used for adding the allocation quota in the quota total value of the second quota sub-resource corresponding to the minimum residual quota value so as to update and obtain the quota total value of the second quota sub-resource corresponding to the minimum residual quota value.
In a preferred embodiment of the invention, as shown in fig. 4-3, the apparatus further comprises:
the receiving module is also used for receiving a supplementing request for the limit resources;
a supplementing module 408, configured to add a supplementing credit resource corresponding to the supplementing request to at least one of the first credit sub-resource and the at least two second credit sub-resources;
The fourth updating module 409 is configured to update at least one of the consumed credit of the first credit sub-resource and the consumed credit of the at least two second credit sub-resources with the supplementary credit of the supplementary request.
In a preferred embodiment of the invention, the supplementary module is specifically for:
when the consumed credit of the first credit sub-resource is not zero and is not smaller than the supplementary credit, adding the supplementary credit resource into the first credit sub-resource;
the fourth updating module is specifically configured to:
and reducing the consumed credit of the first credit sub-resource by the supplementary credit to update and obtain the consumed credit of the first credit sub-resource.
In a preferred embodiment of the invention, the supplementary module comprises:
the first determining sub-module is used for determining the consumed quota of each second quota sub-resource and the first consumption sum of the consumed quota of each second quota sub-resource when the consumed quota of the first quota sub-resource is zero;
the second determining sub-module is used for determining the supplementary credit corresponding to each second credit sub-resource based on the supplementary credit, the consumed credit of each second credit sub-resource and the first consumption sum;
the first adding sub-module is used for respectively adding the supplementary credit resources corresponding to the supplementary credit of each second credit sub-resource into each second credit sub-resource;
The fourth updating module is specifically configured to:
and respectively reducing the consumed credit of each second credit sub-resource by the corresponding supplementary credit so as to update and obtain the consumed credit of each second credit sub-resource.
In a preferred embodiment of the invention, the supplementary module comprises:
the second adding sub-module is used for adding the supplementary credit resource aiming at the consumed credit of the first credit sub-resource into the first credit sub-resource in the supplementary credit resource when the consumed credit of the first credit sub-resource is not zero and is smaller than the supplementary credit;
the third determining sub-module is used for determining the consumed quota of each second quota sub-resource, the second consumption sum of the consumed quota of each second quota sub-resource and the residual supplementary quota for supplementing the quota resource;
a fourth determining sub-module, configured to determine a supplementary credit corresponding to each second credit sub-resource based on the remaining supplementary credit, the consumed credit of each second credit sub-resource, and the second consumption sum;
the third adding sub-module is used for respectively adding the supplementary credit resources corresponding to the supplementary credit of each second credit sub-resource into each second credit sub-resource;
The fourth updating module is specifically configured to:
and respectively reducing the consumed credit of each second credit sub-resource by the corresponding supplementary credit of each second credit sub-resource so as to update and obtain the consumed credit of each second credit sub-resource, and clearing the consumed credit of the first credit sub-resource.
The processing device for the credit resources in this embodiment may execute the processing method for the credit resources in the first embodiment of the present application, and the implementation principle is similar, and will not be described herein.
In the embodiment of the invention, the credit resource is split into the first credit sub-resource with large credit and the second credit sub-resources with at least two small credits, and meanwhile, the hot spot data corresponding to the credit resource is correspondingly split according to the first credit sub-resource and each second credit sub-resource, so that when a user initiates a service request of the credit resource with large credit, the service request can operate the hot spot data corresponding to the first credit sub-resource and the first credit sub-resource with large credit is adopted to provide the credit resource for the user; when a user initiates a service request of a small-credit resource, the service request can operate hot spot data corresponding to a matched second credit sub-resource, and the corresponding second credit sub-resource is adopted to provide credit resources for the user, so that the service request of any credit resource can be responded, normal service is not influenced, a plurality of service requests can be simultaneously responded, the processing efficiency is improved, flexible credit resource providing strategies are 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 on the same hot spot data, only one service request can operate the hot spot data, other service requests can only wait, the processing efficiency is lower, and for the service request exceeding the total credit of the credit resource, the user can not operate the hot spot data corresponding to the credit resource, so that the user can not acquire the credit resource all the time, thereby influencing normal service is solved, and the user experience is improved.
Further, the real-time detection is carried out on the residual quota of each quota sub-resource, and the real-time allocation of the quota resource is carried out on the quota sub-resource with the maximum residual quota and the quota sub-resource with the minimum residual quota, so that the balance of the residual quota of each quota sub-resource is ensured, and the utilization rate of each quota sub-resource is improved.
Furthermore, when a repayment request of a user is received, targeted credit resource replenishment can be performed according to consumed credit of each credit sub-resource, so that more credit sub-resources are consumed to replenish more credit resources, the balance of the residual credit of each credit sub-resource is further ensured, and the utilization rate of each credit sub-resource is improved.
In yet 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, performs: splitting the credit resource into a first credit sub-resource with large credit and at least two second credit sub-resources with small credit, and correspondingly splitting hot spot data corresponding to the credit resource according to the first credit sub-resources and each second credit sub-resource, so that when a user initiates a service request of the credit resource with large credit, the service request can operate the hot spot data corresponding to the first credit sub-resources and provide the credit resource for the user by adopting the first credit sub-resources with large credit; when a user initiates a service request of a small-credit resource, the service request can operate hot spot data corresponding to a matched second credit sub-resource, and the corresponding second credit sub-resource is adopted to provide credit resources for the user, so that the service request of any credit resource can be responded, normal service is not influenced, a plurality of service requests can be simultaneously responded, the processing efficiency is improved, flexible credit resource providing strategies are 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 on the same hot spot data, only one service request can operate the hot spot data, other service requests can only wait, the processing efficiency is lower, and for the service request exceeding the total credit of the credit resource, the user can not operate the hot spot data corresponding to the credit resource, so that the user can not acquire the credit resource all the time, thereby influencing normal service is solved, and the user experience is improved.
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 is coupled to the memory 5003, e.g., via bus 5002. Optionally, the electronic device 5000 may also include a transceiver 5004. Note that, in practical applications, the transceiver 5004 is not limited to one, 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 exemplary logic blocks, modules, and circuits described in connection with this disclosure. The processor 5001 may also be a combination of computing functions, e.g., including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.
Bus 5002 may include a path to transfer information between the aforementioned components. Bus 5002 may be a PCI bus or an EISA bus, among others. 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 not only one bus or one type of bus.
The memory 5003 may be, but is not limited to, ROM or other type of static storage device, RAM or other type of dynamic storage device, which can store static information and instructions, EEPROM, CD-ROM or other optical disk storage, optical disk storage (including compact disk, laser disk, optical disk, digital versatile disk, blu-ray disc, etc.), magnetic disk storage or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and capable of being accessed by a computer.
The memory 5003 is used for storing application program codes for executing the aspects of the present application and is controlled by the processor 5001 for execution. The processor 5001 is operative to execute application code stored in the memory 5003 to implement what has been shown in any of the method embodiments described previously.
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 stationary terminals such as digital TVs, desktop computers, and the like.
Yet another embodiment of the present application provides a computer readable storage medium having stored thereon a computer program which, when run on a computer, causes the computer to perform the corresponding content of the foregoing method embodiments. Compared with the prior art, the embodiment of the application splits the credit resource into the first credit sub-resource with large credit and the second credit sub-resources with at least two small credits, and correspondingly splits the hot spot data corresponding to the credit resource according to the first credit sub-resource and each second credit sub-resource, so that when a user initiates a service request of the credit resource with large credit, the service request can operate the hot spot data corresponding to the first credit sub-resource and provide the credit resource for the user by adopting the first credit sub-resource with large credit; when a user initiates a service request of a small-credit resource, the service request can operate hot spot data corresponding to a matched second credit sub-resource, and the corresponding second credit sub-resource is adopted to provide credit resources for the user, so that the service request of any credit resource can be responded, normal service is not influenced, a plurality of service requests can be simultaneously responded, the processing efficiency is improved, flexible credit resource providing strategies are 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 on the same hot spot data, only one service request can operate the hot spot data, other service requests can only wait, the processing efficiency is lower, and for the service request exceeding the total credit of the credit resource, the user can not operate the hot spot data corresponding to the credit resource, so that the user can not acquire the credit resource all the time, thereby influencing normal service is solved, and the user experience is improved.
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited in order and may be performed in other orders, unless explicitly stated herein. Moreover, at least some of the steps in the flowcharts of the figures may include a plurality of sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, the order of their execution not necessarily being sequential, but may be performed in turn or alternately with other steps or at least a portion of the other steps or stages.
The foregoing is only a partial embodiment of the present invention, and it should be noted that it will be apparent to those skilled in the art that modifications and adaptations can be made without departing from the principles of the present invention, and such modifications and adaptations are intended to be comprehended within the scope of the present invention.
Claims (11)
1. A method for processing a credit resource is characterized in that the credit resource comprises a first credit sub-resource and at least two second credit sub-resources, the first credit sub-resource is larger than the second credit sub-resource, and hot spot data corresponding to the credit resource is recorded in a pre-configured database; the method comprises the following steps:
Splitting the quota resource into a plurality of sub-resources when the system is initialized, and splitting hot spot data corresponding to the quota resource in the database into a plurality of hot spot data corresponding to the plurality of sub-resources, wherein each sub-resource corresponds to one hot spot data, and the plurality of sub-resources comprise a first quota sub-resource and at least two second quota sub-resources;
when an acquisition request for the limit resource is received, acquiring user identification information for initiating the acquisition request; determining resource identification information matched with the user identification information of the acquisition request by adopting a preset corresponding relation between the resource identification information and the user identification information, and determining a second quota child resource matched with the acquisition request according to the resource identification information;
each second quota sub-resource is provided with corresponding resource identification information, the resource identification information of each second quota sub-resource corresponds to one piece of user identification information, the resource identification information of the first quota sub-resource corresponds to all pieces of user identification information, and the acquired quota corresponding to the acquisition request of a single service is smaller than the sum total value of the first quota sub-resource;
when the acquired quota of the acquisition request is larger than the remaining quota of the matched second quota sub-resource, deducting the quota resource of the acquired quota from the first quota sub-resource by operating one hotspot data corresponding to the first quota sub-resource in the plurality of hotspot data, and updating the consumed quota of the first 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, deducting the quota resource of the acquired quota from the matched second quota sub-resource by operating one hotspot data corresponding to the matched second quota sub-resource in the plurality of hotspot data, and updating the consumed quota of the matched second quota sub-resource;
when a replenishment request for the credit resource is received, based on the consumed credit of the first credit sub-resource, any one of the following is performed:
if the consumed credit of the first credit sub-resource is not zero and is not smaller than the corresponding supplementary credit of the supplementary request, adding the supplementary credit resource into the first credit sub-resource;
if the consumed quota of the first quota sub-resource is zero, determining the consumed quota of each second quota sub-resource and the first consumption sum of the consumed quota of each second quota sub-resource; determining the corresponding supplementary credit of each second credit sub-resource based on the supplementary credit, the consumed credit of each second credit sub-resource and the first consumption sum; adding the supplementary credit resources corresponding to the supplementary credit of each second credit sub-resource into each second credit sub-resource respectively;
If the consumed credit of the first credit sub-resource is not zero and is smaller than the supplementary credit, adding the supplementary credit resource aiming at the consumed credit of the first credit sub-resource in the supplementary credit resource to the first credit sub-resource; determining the consumed credit of each second credit sub-resource, the second consumption sum of the consumed credit of each second credit sub-resource and the residual supplementary credit of the supplementary credit resource; determining the corresponding supplementary credit of each second credit sub-resource based on the residual supplementary credit, the consumed credit of each second credit sub-resource and the second consumption sum; and adding the supplementary credit resources corresponding to the supplementary credit of each second credit sub-resource into each second credit sub-resource respectively.
2. The method for processing the credit resource according to claim 1, wherein each of the second credit sub-resources has corresponding resource identification information;
the determining the second quota child resource matched with the acquisition request includes:
acquiring user identification information for initiating the acquisition request;
and determining 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 limit sub-resource matched with the resource identification information.
3. The method for processing a credit resource according to claim 1 or 2, further comprising:
obtaining the residual quota of each second quota child resource at preset time intervals;
determining the allocation credit according to the maximum residual credit value and the minimum residual credit value in each residual credit;
and updating the sum total value of the second sum sub-resource corresponding to the maximum remaining sum value and the sum total value of the second sum sub-resource corresponding to the minimum remaining sum value based on the allocation sum.
4. The method for processing a credit resource according to claim 3, wherein updating the credit total value of the second credit sub-resource corresponding to the maximum remaining credit value and the credit total value of the second credit sub-resource corresponding to the minimum remaining credit value based on the allocation credit includes:
reducing the allocation credit in the credit total value of the second credit sub-resource corresponding to the maximum residual credit value to update and obtain the credit total value of the second credit sub-resource corresponding to the maximum residual credit value;
and adding the allocation credit in the credit total value of the second credit sub-resource corresponding to the minimum residual credit value to update and obtain the credit total value of the second credit sub-resource corresponding to the minimum residual credit value.
5. The method for processing a credit resource according to claim 1 or 2, further comprising:
and updating at least one of the consumed credit of the first credit sub-resource and the consumed credit of the at least two second credit sub-resources by adopting the supplementary credit of the supplementary request.
6. The method for processing the credit resource according to claim 5, wherein said updating the consumed credit of the first credit sub-resource with the supplementary credit of the supplementary request includes:
and if the consumed quota of the first quota child resource is not zero and is not smaller than the supplementary quota corresponding to the supplementary request, reducing the consumed quota of the first quota child resource by the supplementary quota so as to update and obtain the consumed quota of the first quota child resource.
7. The method for processing the credit resource according to claim 5, wherein said updating the consumed credit of the at least two second credit sub-resources with the supplementary credit of the supplementary request includes:
and if the consumed quota of the first quota sub-resource is zero, 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 the credit resource according to claim 5, wherein said updating the consumed credit of the first credit sub-resource and the consumed credit of the at least two second credit sub-resources with the supplementary credit of the supplementary request includes:
if the consumed credit of the first credit sub-resource is not zero and is smaller than the supplementary credit, reducing the consumed credit of each second credit sub-resource by the supplementary credit corresponding to each second credit sub-resource so as to update and obtain the consumed credit of each second credit sub-resource;
and resetting the consumed quota update of the first quota child resource.
9. The device for processing the credit resource is characterized in that the credit resource comprises a first credit sub-resource and at least two second credit sub-resources, wherein the first credit sub-resource is larger than the second credit sub-resource, and hot spot data corresponding to the credit resource is recorded in a pre-configured database; the device comprises:
the splitting module is used for splitting the quota resources into a plurality of sub-resources and splitting the hot spot data corresponding to the quota resources in the database into a plurality of hot spot data corresponding to the plurality of sub-resources, wherein each sub-resource corresponds to one hot spot data, and the plurality of sub-resources comprise a first quota sub-resource and at least two second quota sub-resources;
The receiving module is used for receiving an acquisition request aiming at the limit resources;
the first determining module is used for acquiring the user identification information for initiating the acquisition request; determining resource identification information matched with the user identification information of the acquisition request by adopting a preset corresponding relation between the resource identification information and the user identification information, and determining a second quota child resource matched with the acquisition request according to the resource identification information;
each second quota sub-resource is provided with corresponding resource identification information, the resource identification information of each second quota sub-resource corresponds to one piece of user identification information, the resource identification information of the first quota sub-resource corresponds to all pieces of user identification information, and the acquired quota corresponding to the acquisition request of a single service is smaller than the sum total value of the first quota sub-resource;
the first updating module is configured to, when the acquired quota of the acquisition request is greater than the remaining quota of the matched second quota child resource, deduct the quota resource of the acquired quota from the first quota child resource by operating on one hotspot data corresponding to the first quota child resource in the plurality of hotspot data, and update the consumed quota of the first quota child resource;
The second updating module is configured to, when the acquired credit of the acquisition request is not greater than the remaining credit of the matched second credit sub-resource, deduct the credit resource of the acquired credit from the matched second credit sub-resource by operating on one hot spot data corresponding to the matched second credit sub-resource in the plurality of hot spot data, and update the consumed credit of the matched second credit sub-resource;
the receiving module is further configured to receive a replenishment request for the quota resource;
a supplementing module, configured to execute any one of the following based on the consumed credit of the first credit sub-resource:
if the consumed credit of the first credit sub-resource is not zero and is not smaller than the corresponding supplementary credit of the supplementary request, adding the supplementary credit resource into the first credit sub-resource;
if the consumed quota of the first quota sub-resource is zero, determining the consumed quota of each second quota sub-resource and the first consumption sum of the consumed quota of each second quota sub-resource; determining the corresponding supplementary credit of each second credit sub-resource based on the supplementary credit, the consumed credit of each second credit sub-resource and the first consumption sum; adding the supplementary credit resources corresponding to the supplementary credit of each second credit sub-resource into each second credit sub-resource respectively;
If the consumed credit of the first credit sub-resource is not zero and is smaller than the supplementary credit, adding the supplementary credit resource aiming at the consumed credit of the first credit sub-resource in the supplementary credit resource to the first credit sub-resource; determining the consumed credit of each second credit sub-resource, the second consumption sum of the consumed credit of each second credit sub-resource and the residual supplementary credit of the supplementary credit resource; determining the corresponding supplementary credit of each second credit sub-resource based on the residual supplementary credit, the consumed credit of each second credit sub-resource and the second consumption sum; and adding the supplementary credit resources corresponding to the supplementary credit of each second credit sub-resource into each second credit sub-resource respectively.
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 configured to execute the method for processing the credit resource according to any one of claims 1 to 8 by invoking the operation instruction.
11. A computer readable storage medium for storing computer instructions which, when run on a computer, cause the computer to perform the method of processing a credit resource as claimed in any one of claims 1 to 8.
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 CN111190910A (en) | 2020-05-22 |
CN111190910B true 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) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112669160B (en) * | 2021-03-18 | 2021-06-29 | 恒生电子股份有限公司 | Data processing method and device, electronic equipment and storage medium |
CN113139004B (en) * | 2021-04-25 | 2024-03-01 | 中国工商银行股份有限公司 | Method and device for controlling credit, computer equipment and computer readable storage medium |
Citations (5)
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 |
-
2019
- 2019-07-11 CN CN201910625848.6A patent/CN111190910B/en active Active
Patent Citations (5)
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 |
Also Published As
Publication number | Publication date |
---|---|
CN111190910A (en) | 2020-05-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108737325B (en) | Multi-tenant data isolation method, device and system | |
US20100115246A1 (en) | System and method of data partitioning for parallel processing of dynamically generated application data | |
CN113554513B (en) | Data processing method, device and system | |
CN109727070B (en) | Method and device for determining potential active users | |
TW202004597A (en) | Virtual resource delivery and crowdfunding method and device based on block chain | |
CN111190910B (en) | Method and device for processing quota resources, electronic equipment and readable storage medium | |
CN110489418B (en) | Data aggregation method and system | |
CN110163746A (en) | A kind of account liquidation method and device | |
CN111553699B (en) | Resource scheduling method and device | |
TW202026970A (en) | A money settlement system and method | |
CA3139693A1 (en) | Dynamic allocation of computing resources | |
CN116028013B (en) | Optimization method, device, divider and medium for FPGA division operation | |
CN111539730A (en) | Data processing method and device based on block chain and electronic equipment | |
CN107147610B (en) | Resource processing method and device | |
CN113312184A (en) | Service data processing method and related equipment | |
CN109426561A (en) | A kind of task processing method, device and equipment | |
CN110532807B (en) | Electronic certificate generation method, device, computer equipment and storage medium | |
CN111209283A (en) | Data processing method and device | |
CN110096352A (en) | Process management method, device and computer readable storage medium | |
WO2021068585A1 (en) | Resource processing method and apparatus, electronic device, and medium | |
CN113504988A (en) | Control method, system, medium and device for system computing power resource scheduling | |
CN113283981A (en) | Data splitting method and device, computer equipment and storage medium | |
CN112418670A (en) | Case allocation method, device, equipment and medium | |
CN110738495A (en) | Member resource allocation method and device | |
CN116385156B (en) | Resource allocation method, apparatus, computer device and computer readable storage medium |
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 | ||
TG01 | Patent term adjustment |