CN116932514A - Budget deduction method and device - Google Patents
Budget deduction method and device Download PDFInfo
- Publication number
- CN116932514A CN116932514A CN202310954919.3A CN202310954919A CN116932514A CN 116932514 A CN116932514 A CN 116932514A CN 202310954919 A CN202310954919 A CN 202310954919A CN 116932514 A CN116932514 A CN 116932514A
- Authority
- CN
- China
- Prior art keywords
- deduction
- budget
- chain
- amount
- execution
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 72
- 230000011218 segmentation Effects 0.000 claims description 9
- 238000011084 recovery Methods 0.000 claims description 8
- 238000004064 recycling Methods 0.000 claims description 6
- 238000012545 processing Methods 0.000 description 14
- 230000008569 process Effects 0.000 description 10
- 238000010586 diagram Methods 0.000 description 9
- 230000006870 function Effects 0.000 description 9
- 230000006872 improvement Effects 0.000 description 8
- 238000004590 computer program Methods 0.000 description 7
- 238000005516 engineering process Methods 0.000 description 6
- 230000018109 developmental process Effects 0.000 description 3
- 230000005540 biological transmission Effects 0.000 description 2
- 230000008859 change Effects 0.000 description 2
- 230000007423 decrease Effects 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 238000004519 manufacturing process Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000002159 abnormal effect Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000005055 memory storage Effects 0.000 description 1
- 229920001296 polysiloxane Polymers 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 239000010979 ruby Substances 0.000 description 1
- 229910001750 ruby Inorganic materials 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000012800 visualization Methods 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/21—Design, administration or maintenance of databases
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The application provides a budget deduction method and a device, wherein the method comprises the following steps: receiving a withhold request, wherein the withhold request comprises: deducting the limit; when the deduction amount is larger than the budget amount of any DB on a pre-stored database DB chain, determining deduction portions of at least two execution DB and each execution DB according to the deduction amount and the budget amount of the DB on the DB chain; and deducting the budget amount of the execution DB according to the deduction share of the execution DB.
Description
Technical Field
The present application relates to the field of computer technologies, and in particular, to a budget deduction method and apparatus.
Background
With the rapid development of internet technology, the data processing capacity of an application system is increased. A plurality of databases are generally arranged in an application system to meet the requirements of a large number of data processing requests.
For example, in a budget system, a plurality of DBs (databases) are provided, each DB having a corresponding budget amount. When the budget system receives a deduction request sent by a user, the budget amount in the DB is deducted according to the deduction amount in the deduction request.
Under the application background, how to process the deduction request with larger deduction limit is a problem to be solved by the technicians.
Disclosure of Invention
In view of this, the embodiment of the application provides a budget deduction method and device, which can process a deduction request with larger deduction limit.
In a first aspect, an embodiment of the present application provides a budget deduction method, including:
receiving a withhold request, wherein the withhold request comprises: deducting the limit;
when the deduction amount is greater than the budget amount of any one DB on the pre-stored DB chain,
determining at least two execution DBs and deduction shares of each execution DB according to the deduction shares and the budget shares of the DBs on the DB chain;
and deducting the budget amount of the execution DB according to the deduction share of the execution DB.
In a second aspect, an embodiment of the present application provides a budget deduction device, including:
the receiving unit is configured to receive a deduction request, where the deduction request includes: deducting the limit;
the determining unit is used for determining at least two execution DBs and deduction shares of each execution DB according to the deduction amount and the budget amount of the DB on the DB chain when the deduction amount is larger than the budget amount of any DB on the pre-stored DB chain;
and the deduction unit is used for deducting the budget amount of the execution DB according to the deduction portion of the execution DB.
The above at least one technical scheme adopted by the embodiment of the application can achieve the following beneficial effects: the method can process deduction requests with deduction amount larger than budget amount. In addition, the method does not need to carry out distributed transaction, does not need to judge the processing result of the deduction request according to the deduction results of a plurality of DB, and can improve the deduction success rate.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a budget deduction method according to one embodiment of the present application;
FIG. 2 is a schematic diagram of the structure of a single DB chain provided by one embodiment of the application;
FIG. 3 is a schematic diagram of the structure of a plurality of DB chains provided by one embodiment of the present application;
FIG. 4 is a flow chart of a budget deduction method according to another embodiment of the present application;
FIG. 5 is a schematic diagram of a budget deduction device according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments, and all other embodiments obtained by those skilled in the art without making any inventive effort based on the embodiments of the present application are within the scope of protection of the present application.
As shown in fig. 1, an embodiment of the present application provides a budget deduction method, which may include the following steps:
step 101: receiving a deduction request, wherein the deduction request comprises the following steps: deducting the limit.
One deduction request may be received at the same time, or several deduction requests may be received. In addition to deducting the amount, the deduction request may also include a service identifier or the like. When the budgeting amounts of a plurality of services are stored in the DB, the method can distinguish different services through the service identification in the deduction request, so that budget deduction can be carried out on the corresponding services.
The performance parameters of each DB may be further included in the deduction request, and in the actual application scenario, the number of deduction requests processed by the DB may be determined by the performance parameters of the DB.
Step 102: when the deduction amount is larger than the budget amount of any DB on the pre-stored DB chain, determining at least two execution DB and deduction portions of each execution DB according to the deduction amount and the budget amount of the DB on the DB chain.
Wherein the execution DB is a DB participating in executing the deduction request. The DB chain includes at least two DB, each DB acting as a node of the DB chain. The budgets of different DBs may or may not be the same.
In the practical application scenario, the number of the stored DB chains may be one or more. For convenience of description, only one DB chain will be described as an example.
As shown in fig. 2, a DB chain is composed of four DBs, and the budgeting amounts corresponding to a-D are all 1 ten thousand. When the deduction amount is 2 ten thousand, the execution DB is determined to be D and C according to the deduction sequence from the tail node to the head node, and the corresponding deduction portions are 1 ten thousand. When the deduction amount is 2.5 ten thousand, the corresponding execution DB is D, C, B, and the corresponding deduction amount is 1 ten thousand, 1 ten thousand and 0.5 ten thousand respectively.
As can be seen from the above, the sum of budgeted amounts of the execution DB may be greater than or equal to the deducted amount.
Prior to step 101, the method may further comprise: determining a budget total amount, and equally dividing the budget total amount to the DB of the DB chain, namely, each DB has the same budget amount.
Step 103: and deducting the budget amount of the execution DB according to the deduction share of the execution DB.
Step 103 may specifically include the following two cases according to the relationship between the deducted share of the execution DB and the budget amount of the execution DB:
case 1: the deducted shares of the execution DB are all equal to their budgeted amount.
At this time, when the deducted share of the execution DB is equal to the budget amount of the execution DB, the execution DB is removed from the DB chain.
Case 2: the deducted share of the partial execution DB is equal to its budget line, and the deducted shares of the other execution DBs are smaller than its budget line.
At this time, when the deducted share of the execution DB is equal to the budget amount of the execution DB, the execution DB is removed from the DB chain. When the deduction share of the execution DB is smaller than the budget line of the execution DB, deducting the deduction share of the execution DB in the budget line of the execution DB.
For case 2, the method may further include: the remaining level of the execution DB is added to the standby DB. The remaining amount of the execution DB is an amount after the budget amount of the execution DB is deducted.
Along the above example, execution DB is D, C, B, and the corresponding deduction shares are 1 ten thousand, 1 ten thousand and 0.5 ten thousand respectively. Then D and C are removed from the DB chain and deducted by 0.5 ten thousand from the budget amount of B.
The method can carry out budget deduction by changing the structure of the DB chain, reduce the access times to the DB and improve the deduction efficiency.
In addition, the method can process deduction requests with deduction amount larger than budget amount, distributed transactions are not needed, the processing results of the deduction requests are not needed to be judged according to the deduction results of a plurality of DB, and the deduction success rate can be improved.
In one embodiment of the application, the method further comprises: and when the deduction limit is not larger than the budget limit of any DB on the pre-stored DB chain, deducting the deduction limit in the budget limit of the working DB of the DB chain, wherein the working DB is the head node of the DB chain.
In the embodiment of the application, in order to ensure the orderly proceeding of the deduction process, the head node of the DB chain is used as the working node, and each chain is provided with one working node. Of course, other DBs may also be used as working nodes in the actual application scenario, which is not described herein.
For example, in FIG. 2, the head nodes are A, and the budgets corresponding to A-D are all 1 ten thousand. And when the deduction limit is 0.5 ten thousand, deducting in the A.
In one embodiment of the application, the method further comprises: when deducting deduction and deduction fail in the budget amount of the working DB, deducting deduction and deduction are carried out in the budget amount of the preset standby DB.
The budget amount of the standby DB may be determined by the total budget amount. For example, the budget amount of the standby DB is 30% of the total budget amount.
The standby DB is used for deducting, so that the deduction efficiency can be improved, and the influence caused by deduction failure in the working DB is reduced.
The embodiment of the application has very high availability and strong and controllable disaster recovery capability through the standby DB pocket.
It should be noted that, when the deduction limit is greater than the budget limit of any DB on the pre-stored database DB chain, the standby DB may be used.
For example, the method further comprises: when deducting the deduction share of the execution DB in the budget line of the execution DB fails, deducting the deduction share in the budget line of the standby DB.
In addition, the method may further deduct the deduction share in the standby DB. At this time, the method further includes: when the deduction share of the execution DB is smaller than the budget line of the execution DB, deducting the deduction share of the execution DB in the budget line of the standby DB.
It should be noted that the standby DB may be used in combination with the DB on the DB chain according to the needs of the actual scene.
In order to improve the deduction success rate, in one embodiment of the application, the method further comprises: and when the number of the DB on the current DB chain is smaller than a preset number threshold, recycling the remaining amount of the working DB on the current DB chain to the standby DB, and adding other DB on the current DB chain to other DB chains.
When there are a plurality of DB chains, the deduction success rate decreases as the number of DB chains DB, the remaining amount in the work DB decreases. At this time, the deduction success rate can be ensured by combining the DB chains. Wherein other DBs on the current DB chain refer to nodes on the current DB chain other than the working node. The method provided by the embodiment is suitable for the case that the deduction limit is larger than the budget limit of any DB on a pre-stored database DB chain.
In one embodiment of the application, the method further comprises: when the residual amount of the working DB is smaller than a preset first threshold value, recovering the residual amount of the working DB to a standby DB; the DB connected to the work DB in the DB chain is updated to the work DB.
When the working DB fails, the nodes can be switched by the method provided by the embodiment, and the overall availability is not affected.
The embodiment of the application is also applicable to the situation that the deduction limit is larger than the budget limit of any DB on a pre-stored database DB chain.
In one embodiment of the present application, in order to reasonably use the credit in the standby DB, the method further includes: when the residual amount of the standby DB is larger than a preset second threshold, determining a segmentation amount according to the residual amount of the standby DB and the second threshold; the segmentation limit is added to the DB on the DB chain.
In the actual application scenario, the segmentation limit may be added to one DB, may be added to a specified DB, or may be added to each DB.
The method can improve the utilization rate of the budget amount in the standby DB, reduce the possibility of deduction failure in the DB, and improve the processing efficiency of deduction requests.
The embodiment of the application is also applicable to the situation that the deduction limit is larger than the budget limit of any DB on a pre-stored database DB chain.
In one embodiment of the application, the method further comprises: when the residual credit of the standby DB is smaller than a preset third threshold value, determining a recovery credit according to the residual credit of the standby DB and the third threshold value; determining idle nodes in the DB chain according to the recovery limit; and recycling the budget limit of the idle node into the standby DB.
The idle node refers to a non-working node, and no deduction request which is being processed exists in the idle node. The embodiment of the application is also applicable to the situation that the deduction limit is larger than the budget limit of any DB on a pre-stored database DB chain.
In one embodiment of the application, the method further comprises: acquiring a TAIR lock; the structure of the DB chain is updated according to the TAIR lock.
In the embodiment of the application, all changes to the DB chain structure need to be performed through TAIR locks, so as to avoid abnormal DB chain structure when concurrency occurs. Because the DB chain structure change is very small in amount relative to the budget deduction (e.g., 100 nodes up to 100 head nodes updated), there is no excessive lock contention problem.
In an actual application scene, after updating the structure of the DB chain, updating the TAIR record, releasing the TAIR lock, and timely releasing the occupation of the TAIR lock, so as to speed up the processing speed of the deduction request.
Wherein the structure of the update DB chain includes, but is not limited to: the DB on the DB chain is removed, or the DB on the DB chain is added, or the head node of the DB chain is updated.
The adjustment of the DB chain may be further accomplished by adjusting the DB nodes, for example, by deleting all nodes on the DB and thus deleting the DB chain. The embodiment of the application can dynamically adjust the number of DB chains through the TAIR lock, thereby improving the processing capacity of the whole system. If the single DB chain processing capacity is 1, the performance of those 5 DB chains is improved by 5 times. This value can be dynamically adjusted as desired. And meanwhile, the service is not affected.
As shown in fig. 3, when the stored DB chain includes a plurality of pieces and the deduction amount is greater than the budget amount of any DB on the pre-stored DB chain, the execution DB may be a non-working node of one DB chain, or may be a non-working node of a part or all of the chains, or the like. In an actual application scene, deduction is preferentially performed on the same DB chain, so that the occupation of the DB of other DB chains is avoided, and the processing speed of the deduction request is further influenced.
The method gives flexibility to the chain structure to the whole DB cluster, so that the flexibility is high and the expansibility is strong when the follow-up management, the visualization, the manual preset operation and the expansion of the customization according to the service are performed.
As shown in fig. 4, the embodiment of the present application describes in detail a budget deduction method, which includes:
step 401: receiving a deduction request, wherein the deduction request comprises the following steps: deducting the limit.
Step 402: when the deduction amount is larger than the budget amount of any DB on the pre-stored database DB chain, determining the deduction amount of at least two execution DB and each execution DB according to the deduction amount and the budget amount of the DB on the DB chain.
Step 403: when the deduction share of the execution DB is equal to the budget line of the execution DB, the execution DB is removed from the DB chain, and when the deduction share of the execution DB is smaller than the budget line of the execution DB, the deduction share of the execution DB is deducted in the budget line of the execution DB.
Step 404: and when the deduction limit is not larger than the budget limit of any DB on the pre-stored DB chain, deducting the deduction limit in the budget limit of the working DB of the DB chain, wherein the working DB is the head node of the DB chain.
Step 405: when deducting deduction and deduction fail in the budget amount of the working DB, deducting deduction and deduction are carried out in the budget amount of the preset standby DB.
Step 406: and when the residual quota of the working DB is smaller than a preset first threshold value, recovering the residual quota of the working DB to the standby DB.
Step 407: a TAIR lock is acquired.
Step 408: according to the TAIR lock, a DB connected to a work DB in a DB chain is updated to the work DB.
Step 409: when the residual amount of the standby DB is larger than a preset second threshold, determining a segmentation amount according to the residual amount of the standby DB and the second threshold; the segmentation limit is added to the DB on the DB chain.
Step 409 may further be determining the recovery unit according to the remaining unit of the standby DB and the third threshold when the remaining unit of the standby DB is smaller than the preset third threshold; determining idle nodes in the DB chain according to the recovery limit; and recycling the budget limit of the idle node into the standby DB.
As shown in fig. 5, an embodiment of the present application provides a budget deduction device, including:
the receiving unit 501 is configured to receive a deduction request, where the deduction request includes: deducting the limit;
a determining unit 502, configured to determine, when the deduction amount is greater than a pre-stored budget amount of any one DB on the DB chain, deduction portions of at least two execution DBs and each execution DB according to the deduction amount and the budget amount of the DB on the DB chain;
the deduction unit 503 is configured to deduct the budget amount of the execution DB according to the deduction share of the execution DB.
In an embodiment of the application the deduction unit 503 is adapted to remove the execution DB from the DB chain when the deduction share of the execution DB is equal to the budget share of the execution DB.
In an embodiment of the application, the deduction unit 503 is configured to deduct the deduction share of the execution DB in the budget line of the execution DB when the deduction share of the execution DB is smaller than the budget line of the execution DB.
In one embodiment of the present application, the deduction unit 503 is further configured to deduct the deduction amount from the budget amount of the working DB of the DB chain when the deduction amount is not greater than the budget amount of any DB on the pre-stored DB chain, where the working DB is the head node of the DB chain.
In one embodiment of the present application, the deduction unit 503 is further configured to deduct the deduction amount from the budget amount of the preset standby DB when the deduction of the deduction amount from the budget amount of the working DB fails.
In one embodiment of the present application, the deduction unit 503 is further configured to recycle the remaining credit of the working DB to the standby DB when the remaining credit of the working DB is less than a preset first threshold; the DB connected to the work DB in the DB chain is updated to the work DB.
In one embodiment of the present application, the deduction unit 503 is further configured to determine the segmentation limit according to the remaining limit of the standby DB and the second threshold when the remaining limit of the standby DB is greater than the preset second threshold; the segmentation limit is added to the DB on the DB chain.
In one embodiment of the present application, the deduction unit 503 is further configured to determine the recycling amount according to the remaining amount of the standby DB and the third threshold when the remaining amount of the standby DB is less than the preset third threshold; determining idle nodes in the DB chain according to the recovery limit; and recycling the budget limit of the idle node into the standby DB.
In one embodiment of the present application, the deduction unit 503 is further configured to, when the number of DBs on the current DB chain is smaller than the preset number threshold, recycle the remaining amount of the working DB on the current DB chain to the standby DB, and add other DBs on the current DB chain to the other DB chains.
In one embodiment of the application, the apparatus further comprises: an updating unit;
the updating unit is used for acquiring the TAIR lock; the structure of the DB chain is updated according to the TAIR lock.
In an embodiment of the application, the updating unit is configured to remove the DB on the DB chain, or to add the DB on the DB chain, or to update the head node of the DB chain.
The application provides budget deduction equipment, which comprises: a processor and a memory;
the memory is configured to store execution instructions and the processor is configured to execute the execution instructions stored by the memory to implement the method of any of the embodiments described above.
In the 90 s of the 20 th century, improvements to one technology could clearly be distinguished as improvements in hardware (e.g., improvements to circuit structures such as diodes, transistors, switches, etc.) or software (improvements to the process flow). However, with the development of technology, many improvements of the current method flows can be regarded as direct improvements of hardware circuit structures. Designers almost always obtain corresponding hardware circuit structures by programming improved method flows into hardware circuits. Therefore, an improvement of a method flow cannot be said to be realized by a hardware entity module. For example, a programmable logic device (Programmable Logic Device, PLD) (e.g., a field programmable gate array (Field Programmable gate array, FPGA)) is an integrated circuit whose logic function is determined by the user programming the device. A designer programs to "integrate" a digital system onto a PLD without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Moreover, nowadays, instead of manually manufacturing integrated circuit chips, such programming is mostly implemented by using "logic compiler" software, which is similar to the software compiler used in program development and writing, and the original code before the compiling is also written in a specific programming language, which is called hardware description language (Hardware Description Language, HDL), but not just one of the hdds, but a plurality of kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), confluence, CUPL (Cornell UniversityProgramming Language), HDCal, JHDL (Java Hardware Description Language), lava, lola, myHDL, PALASM, RHDL (Ruby Hardware Description Language), etc., VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog are currently most commonly used. It will also be apparent to those skilled in the art that a hardware circuit implementing the logic method flow can be readily obtained by merely slightly programming the method flow into an integrated circuit using several of the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer readable medium storing computer readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable logic controllers, and embedded microcontrollers, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, atmelAT91SAM, microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic of the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller in a pure computer readable program code, it is well possible to implement the same functionality by logically programming the method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers, etc. Such a controller may thus be regarded as a kind of hardware component, and means for performing various functions included therein may also be regarded as structures within the hardware component. Or even means for achieving the various functions may be regarded as either software modules implementing the methods or structures within hardware components.
The system, apparatus, module or unit set forth in the above embodiments may be implemented in particular by a computer chip or entity, or by a product having a certain function. One typical implementation is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being functionally divided into various units, respectively. Of course, the functions of each element may be implemented in the same piece or pieces of software and/or hardware when implementing the present application.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises the element.
The application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, as relevant to see a section of the description of method embodiments.
The foregoing is merely exemplary of the present application and is not intended to limit the present application. Various modifications and variations of the present application will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. which come within the spirit and principles of the application are to be included in the scope of the claims of the present application.
Claims (17)
1. A budget deduction method, comprising:
receiving a withhold request, wherein the withhold request comprises: deducting the limit;
when the deduction amount is greater than the budget amount of any one DB on the pre-stored database DB chain,
determining at least two execution DBs and deduction shares of each execution DB according to the deduction shares and the budget shares of the DBs on the DB chain;
and deducting the budget amount of the execution DB according to the deduction share of the execution DB.
2. The budget deduction method according to claim 1, further comprising, before receiving the deduction request:
determining a budget total amount, and uniformly distributing the budget total amount to all the DB of the DB chain.
3. The budget deduction method according to claim 1, wherein a plurality of DB chains are provided.
4. The budget deduction method according to claim 1, wherein the deduction request further comprises a service identifier, and the service identifier is used for distinguishing different services.
5. The budget deduction method according to claim 1,
the deducting the budget amount of the execution DB according to the deduction share of the execution DB comprises the following steps:
when the deducted share of the execution DB is equal to the budget amount of the execution DB, the execution DB is removed from the DB chain.
6. The budget deduction method according to claim 5, further comprising:
when the deduction share of the execution DB is smaller than the budget line of the execution DB, deducting the deduction share of the execution DB in the budget line of the execution DB.
7. The budget deduction method according to claim 1, further comprising:
when the deduction amount is not greater than the budget amount of any one DB on the pre-stored DB chain,
deducting the deducted amount in the budget amount of a working DB of the DB chain, wherein the working DB is a head node of the DB chain.
8. The budget deduction method according to claim 7, further comprising:
and when deducting the deduction limit in the budget limit of the working DB fails, deducting the deduction limit in the preset budget limit of the standby DB.
9. The budget deduction method according to claim 8, further comprising:
when the residual amount of the working DB is smaller than a preset first threshold value, recovering the residual amount of the working DB to the standby DB;
and updating the DB connected with the working DB in the DB chain into the working DB.
10. The budget deduction method according to claim 8, further comprising:
when the residual amount of the standby DB is larger than a preset second threshold, determining a segmentation amount according to the residual amount of the standby DB and the second threshold;
and adding the segmentation limit to a DB on the DB chain.
11. The budget deduction method according to claim 8, further comprising:
when the residual credit of the standby DB is smaller than a preset third threshold value, determining a recovery credit according to the residual credit of the standby DB and the third threshold value;
determining idle nodes in the DB chain according to the recovery limit;
and recovering the budget amount of the idle node into the standby DB.
12. The budget deduction method according to claim 8, further comprising:
and when the number of the DB on the current DB chain is smaller than a preset number threshold, recycling the remaining amount of the working DB on the current DB chain to the standby DB, and adding other DB on the current DB chain to other DB chains.
13. The budget deduction method according to claim 1, further comprising:
acquiring a TAIR lock;
and updating the structure of the DB chain according to the TAIR lock.
14. The budget deduction method according to claim 13,
said updating the structure of said DB chain, comprising:
removing the DB chain, or adding the DB chain, or updating the head node of the DB chain.
15. A budget deduction device comprising:
the receiving unit is configured to receive a deduction request, where the deduction request includes: deducting the limit;
the determining unit is used for determining at least two execution DBs and deduction shares of each execution DB according to the deduction amount and the budget amount of the DB on the DB chain when the deduction amount is larger than the budget amount of any DB on the pre-stored database DB chain;
and the deduction unit is used for deducting the budget amount of the execution DB according to the deduction portion of the execution DB.
16. The budget deduction device according to claim 15, wherein said determining unit is adapted to determine a budget total amount and to equally divide the budget total amount to respective DBs of said DB chain before said receiving a deduction request.
17. The budget deduction device according to claim 15,
the receiving unit is configured to receive a deduction request, where the deduction request includes: deducting the amount and a service identifier, wherein the service identifier is used for distinguishing different services.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310954919.3A CN116932514A (en) | 2018-11-14 | 2018-11-14 | Budget deduction method and device |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310954919.3A CN116932514A (en) | 2018-11-14 | 2018-11-14 | Budget deduction method and device |
CN201811356206.2A CN109614388B (en) | 2018-11-14 | 2018-11-14 | Budget deduction method and device |
Related Parent Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811356206.2A Division CN109614388B (en) | 2018-11-14 | 2018-11-14 | Budget deduction method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116932514A true CN116932514A (en) | 2023-10-24 |
Family
ID=66003277
Family Applications (2)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811356206.2A Active CN109614388B (en) | 2018-11-14 | 2018-11-14 | Budget deduction method and device |
CN202310954919.3A Pending CN116932514A (en) | 2018-11-14 | 2018-11-14 | Budget deduction method and device |
Family Applications Before (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811356206.2A Active CN109614388B (en) | 2018-11-14 | 2018-11-14 | Budget deduction method and device |
Country Status (1)
Country | Link |
---|---|
CN (2) | CN109614388B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113139004B (en) * | 2021-04-25 | 2024-03-01 | 中国工商银行股份有限公司 | Method and device for controlling credit, computer equipment and computer readable storage medium |
Family Cites Families (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6925447B2 (en) * | 2000-02-04 | 2005-08-02 | Medtronic, Inc. | Responsive manufacturing and inventory control |
JP2003162664A (en) * | 2001-11-27 | 2003-06-06 | Sony Corp | System, method and server for inquiring shop inventories |
CN103544153B (en) * | 2012-07-10 | 2016-07-27 | 阿里巴巴集团控股有限公司 | A kind of data-updating method based on data base and system |
CN103729404B (en) * | 2013-12-05 | 2018-01-12 | 金蝶软件(中国)有限公司 | Budget data processing method and system |
CN105335297B (en) * | 2014-08-06 | 2018-05-08 | 阿里巴巴集团控股有限公司 | Data processing method, device and system based on distributed memory and database |
CN106469391A (en) * | 2015-08-18 | 2017-03-01 | 阿里巴巴集团控股有限公司 | The method and apparatus reducing inventory data |
CN105468690B (en) * | 2015-11-17 | 2018-11-30 | 中国建设银行股份有限公司 | A kind of inventory data treating method and apparatus |
CN105550366B (en) * | 2016-01-20 | 2019-10-18 | 百度在线网络技术(北京)有限公司 | Inventory information treating method and apparatus |
CN107463593A (en) * | 2016-12-13 | 2017-12-12 | 阿里巴巴集团控股有限公司 | Stock reduces method and its equipment |
CN107451853B (en) * | 2017-07-06 | 2021-04-20 | 浙江唯品会支付服务有限公司 | Method, device and system for real-time red packet distribution and storage medium |
CN107895043A (en) * | 2017-11-30 | 2018-04-10 | 冶金自动化研究设计院 | Based on PM chains iron and steel enterprise production logistics information method for organizing |
CN108537580A (en) * | 2018-03-27 | 2018-09-14 | 刘丹 | Enterprise based on single line public affairs row is general to share consumption business model system |
-
2018
- 2018-11-14 CN CN201811356206.2A patent/CN109614388B/en active Active
- 2018-11-14 CN CN202310954919.3A patent/CN116932514A/en active Pending
Also Published As
Publication number | Publication date |
---|---|
CN109614388B (en) | 2023-07-14 |
CN109614388A (en) | 2019-04-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107450979B (en) | Block chain consensus method and device | |
CN107391527B (en) | Data processing method and device based on block chain | |
CN106899666B (en) | Data processing method and device for service identification | |
CN107577697B (en) | Data processing method, device and equipment | |
CN107291720B (en) | Method, system and computer cluster for realizing batch data processing | |
CN110008018A (en) | A kind of batch tasks processing method, device and equipment | |
CN107578338B (en) | Service publishing method, device and equipment | |
CN108615184B (en) | Accounting method and device | |
CN110297837B (en) | Data updating method and device and data query method and device | |
CN111459724B (en) | Node switching method, device, equipment and computer readable storage medium | |
CN109118361B (en) | Method, device and system for managing limit | |
CN109614388B (en) | Budget deduction method and device | |
CN111400032B (en) | Resource allocation method and device | |
CN110244964B (en) | Operation and maintenance method, device and equipment based on operation and maintenance application | |
CN110276637B (en) | Resource allocation method and device, and coupon allocation method and device | |
CN116737345A (en) | Distributed task processing system, distributed task processing method, distributed task processing device, storage medium and storage device | |
CN116384505A (en) | Data processing method and device, storage medium and electronic equipment | |
CN116304212A (en) | Data processing system, method, equipment and storage medium | |
CN110032433B (en) | Task execution method, device, equipment and medium | |
CN114817212A (en) | Database optimization method and optimization device | |
CN110633321B (en) | Data synchronization method, device and equipment | |
CN110245115B (en) | File processing method, engine and system | |
CN110134701B (en) | Buffer account supplementing method and device | |
CN116167437B (en) | Chip management system, method, device and storage medium | |
CN117743472B (en) | Storage task breakpoint synchronization method, device, medium and equipment |
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 |