[go: up one dir, main page]

CN105701130A - Numerical value deduction method and system of database - Google Patents

Numerical value deduction method and system of database Download PDF

Info

Publication number
CN105701130A
CN105701130A CN201410712439.7A CN201410712439A CN105701130A CN 105701130 A CN105701130 A CN 105701130A CN 201410712439 A CN201410712439 A CN 201410712439A CN 105701130 A CN105701130 A CN 105701130A
Authority
CN
China
Prior art keywords
label
reduce
reducing
labeled
numerical value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201410712439.7A
Other languages
Chinese (zh)
Other versions
CN105701130B (en
Inventor
陈小华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Advanced New Technologies Co Ltd
Advantageous New Technologies Co Ltd
Original Assignee
Alibaba Group Holding Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201410712439.7A priority Critical patent/CN105701130B/en
Publication of CN105701130A publication Critical patent/CN105701130A/en
Application granted granted Critical
Publication of CN105701130B publication Critical patent/CN105701130B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Retry When Errors Occur (AREA)

Abstract

The embodiment of the invention discloses a numerical value deduction method and system of a database. The method comprises the following steps: a server receives a deduction request, generates a deduction record list according to the deduction request, and judges whether the numerical value of the variable corresponding to the deduction request is greater than a deduction value in the deduction request or not; and when the numerical value of the variable is smaller than the deduction value in the deduction request, the deduction record list is labeled as failure; and whether the numerical value of the variable is increased or not is monitored, and the deduction record list which is labeled as failure is subjected to deduction retrying when the numerical value of the variable is increased. The deduction record list which can not be finished due to the insufficient numerical value of the variable is labeled as the failure, whether the numerical value of the variable is increased or not is monitored, the deduction record list which is labeled as the failure is subjected to the deduction retrying when the numerical value of the variable is increased, deduction retrying frequencies can be greatly reduced, system resources and network resources can be effectively saved, and a deduction success rate is improved.

Description

Data base's numerical value reduces method and system
Technical field
The present invention relates to database technical field, particularly relate to a kind of data base's numerical value and reduce method and system。
Background technology
Data base's numerical value is reduced, refer to the numerical value of certain variable in data base is reduced, for instance preserve the data base of payment data, the remaining sum of account is reduced, wherein account represents with variable in data base, the numerical value of remaining sum and variable, again such as, preserves the data base of user mobile phone telephone expenses data, the telephone expenses of user mobile phone account are reduced, the wherein cell-phone number of user mobile phone account and user, the cell-phone number of user represents with variable in data base, the numerical value of telephone expenses and variable。Data base's numerical value is reduced, a kind of replacement is had to reduce pattern, refer to after user authorizes, by server as middle swivel link, operate without user oneself, other-end or platform reduce certain numerical value by server from the numerical value of variable, such as payment data storehouse, the platform of withholing of bank deducts amount of money from the account of user by the server at place, payment data storehouse within the time set, or for telephone expenses data base, the paying platform of municipal corporation regularly deducts charges for water and electricity etc. by the server at telephone expenses data base place from user mobile phone account。
Replacement at data base's numerical value is reduced in pattern, after other-end or platform reduce request to the server initiation at data base place, server reduces label according to reducing request generation, and deduct from variable value and reduce value accordingly, when variable value is more than when reducing value, reduce successfully, reduce label and be successfully completed。But when variable value is less than reducing value, when reducing unsuccessfully, the process of usual server, is regularly initiate to retry to reduce to variable value according to the request of reducing, for instance variable value is once reduced by every 30min or 60min, if the numerical value in variable increases, once retry and reduce after successfully, then stop again initiating to retry to reduce, reduce label and complete, otherwise, retry and reduce and will constantly carry out。
But, usual server has every day substantial amounts of reduces label due to what variable value deficiency caused reducing failure, to each reduce failure reduce label, server all can constantly initiate to retry and reduce, such as, server have every day 700,000 reduce failure reduce label, label is reduced to each, on average initiate 5 times retry to reduce, then will have every day 3,500,000 times to retry and reduce, for server, such mode of reducing that retries will occupy a large amount of system resource and Internet resources, affects processing speed and the performance of server。On the other hand, it is periodically executed owing to retrying to reduce, when, after once retrying and reducing failure, the numerical value of variable adds, but upper once retry reduce before, if the numerical value of variable is reduced for other purposes by server, the numerical value causing variable has been not enough to again retry next time reduces, then retry that reduce still can be failed next time, and therefore regularly retrying the mode reduced, to reduce success rate low, make to retry the number of times reduced to be difficult to reduce, strengthen the consuming of system resource and Internet resources further。
Summary of the invention
For overcoming variable value in correlation technique to retry to reduce system resource and Internet resources to expend high problem, the application provides a kind of data base's numerical value to reduce method and system。
First aspect according to the embodiment of the present application, it is provided that a kind of data base's numerical value reduces method, including:
Server receives and reduces request, reduces request generation reduce label according to described, and the numerical value of variable corresponding to the request of reducing described in judging whether more than described reduce in request reduce value;
When described variable numerical value less than described reduce in request when reducing value, described label of reducing is labeled as failure;
Whether the numerical value monitoring described variable increases;
When the numerical value of described variable increases, the label of reducing being labeled as failure is retried and reduces。
Optionally, when the described numerical value when described variable increases, the label of reducing being labeled as failure is retried and reduces, including:
Step a1, it is judged that currently carry out retrying reduce reduce label reduce value whether less than or equal to the numerical value of described variable;
Step a2, when currently carry out retrying reduce reduce when reducing value less than or equal to the numerical value of described variable of label, complete currently to carry out to retry reduce reduce label, change to currently carrying out retrying the labelling reducing label reduced successfully;
Step a3, it may be judged whether what have that next is labeled as failure reduces label,
Step a4, if what have that next is labeled as failure reduces label, the label of reducing that next is labeled as failure retries the label of reducing reduced as currently carrying out, and returns step a1, otherwise, terminates to retry to reduce。
Optionally, when the described numerical value when described variable increases, the label of reducing being labeled as failure is retried and reduces, including:
Step b1, calculates the numerical value of described variable successively and is labeled as the difference reducing value reducing label of failure;
Step b2, it is judged that whether described difference is all less than 0;
Step b3, if described difference is all less than 0, stops retrying reducing, otherwise,
If there is difference more than or equal to 0, choose more than or equal to 0 and minimum difference, complete described difference corresponding be labeled as failure reduce label, the labelling reducing label being labeled as failure completed is changed to successfully, and returns step b1。
Optionally, when the described numerical value when described variable increases, the label of reducing being labeled as failure is retried and reduces, including:
Step c1, the numerical value calculating described variable successively deducts the difference reducing value reducing label being labeled as failure;
Step c2, it is judged that whether described difference is all less than 0;
Step c3, if described difference is all less than 0, stops retrying reducing, otherwise
If there is difference more than or equal to 0, choose more than or equal to 0 and minimum difference, complete described difference corresponding be labeled as failure reduce label, the labelling reducing label being labeled as failure completed is changed to successfully;
Step c4, calculate successively the numerical value of described variable deduct the remaining difference more than or equal to 0 corresponding reduce label corresponding reduce value, obtain new difference;
Step c5, it is judged that whether described new difference is all less than 0;
Step c6, if described new difference is all less than 0, stops retrying reducing, otherwise,
If there is the new difference more than or equal to 0, choose more than or equal to 0 and minimum new difference, complete described new difference corresponding be labeled as failure reduce label, the labelling reducing label being labeled as failure completed is changed to successfully, and returns step c4。
Optionally, described data base's numerical value reduces method, it is characterised in that also include:
When described variable numerical value less than described reduce in request when reducing value, by described variable label for owe value;
Monitor and be labeled as whether the numerical value of variable owing value increases, when the numerical value increase of the described variable being labeled as and owing value, successively the label of reducing being labeled as failure is retried and reduces;
When be labeled as failure reduce label all retry reduce successfully time, delete the deficient value labelling of described variable。
Corresponding to the first aspect of the embodiment of the present application, the second aspect according to the embodiment of the present application, it is provided that a kind of data base's numerical value reduces system, including:
Reduce request reception unit, reduce request for reception;
Reduce label and generate unit, described in basis, reduce request generation reduce label;
Judging unit, for variable corresponding to the request of reducing described in judging numerical value whether more than described reduce in request reduce value;
Reduce label indexing unit, for when described variable numerical value less than described reduce in request when reducing value, described label of reducing is labeled as failure;
Monitoring unit, whether the numerical value for monitoring described variable increases;
Retry and reduce unit, for when the numerical value of described variable increases, the label of reducing being labeled as failure being retried and reduces。
Optionally, described in retry and reduce unit, including:
First judgment sub-unit, for judge currently to carry out to retry reduce reduce label reduce value whether less than or equal to the numerical value of described variable;
First performs subelement, for when currently carry out retrying reduce reduce when reducing value less than or equal to the numerical value of described variable of label, complete currently to carry out retrying the label of reducing reduced, and the labelling reducing label described in completing changed to successfully;
Second judgment sub-unit, for judging whether that what next was labeled as failure reduces label;
Second performs subelement, if reducing label for what have that next is labeled as failure, what next was labeled as failure reduces label as currently carrying out retrying the label of reducing reduced, and returns described first judgment sub-unit, otherwise, terminate to retry to reduce。
Optionally, described in retry and reduce unit, including:
Mathematic interpolation subelement, for calculating the numerical value of described variable successively and being labeled as the difference reducing value reducing label of failure;
3rd judgment sub-unit, is used for judging that whether described difference is all less than 0;
3rd performs subelement, if for described difference all less than 0, stops retrying reducing, otherwise,
If there is the difference more than or equal to 0, choose more than or equal to 0 and minimum difference, complete described difference corresponding be labeled as failure reduce label, the labelling reducing label being labeled as failure completed is changed to successfully, and returns described mathematic interpolation subelement。
Optionally, described in retry and reduce unit, including:
Mathematic interpolation subelement, the numerical value for calculating described variable successively deducts the difference reducing value reducing label being labeled as failure;
3rd judgment sub-unit, is used for judging that whether described difference is all less than 0;
4th performs subelement, if for described difference all less than 0, stops retrying reducing, otherwise
If there is difference more than or equal to 0, choose more than or equal to 0 and minimum difference, complete described difference corresponding be labeled as failure reduce label, the labelling reducing label being labeled as failure completed is changed to successfully;
New mathematic interpolation subelement, the numerical value for calculating described variable successively deduct the remaining difference more than or equal to 0 corresponding reduce label corresponding reduce value, obtain new difference;
4th judgment sub-unit, is used for judging that whether described new difference is all less than 0;
5th performs subelement, if for described new difference all less than 0, stops retrying reducing, otherwise,
If there is the new difference more than or equal to 0, choose more than or equal to 0 and minimum new difference, complete described new difference corresponding be labeled as failure reduce label, the labelling reducing label being labeled as failure completed is changed to successfully, and returns described new mathematic interpolation subelement。
Optionally, described data base's numerical value reduces system, also includes:
Variable label unit, for when described variable numerical value less than described reduce in request when reducing value, by described variable label for owe value,
For monitoring, described monitoring unit is labeled as whether the numerical value of variable owing value increases, when the numerical value increase of the described variable being labeled as and owing value, successively the label of reducing being labeled as failure is retried and reduced;
Variable label delete unit, for when be labeled as failure reduce label all retry reduce successfully time, delete the deficient value labelling of described variable。
The technical scheme that the embodiment of the present application provides can include following beneficial effect: the label of reducing that can not complete due to variable value deficiency is labeled as failure, whether the numerical value monitoring variable increases, when the numerical value of variable increases, just the label of reducing being labeled as failure is retried and reduces, not only greatly reduce and retry the number of times reduced, effectively save system resource and Internet resources, and be carry out retrying reducing when the numerical value of variable increases, avoid because do not retry in time reduce cause the numerical value of variable be used as it with and make to retry and reduce unsuccessfully, add largely and retry the success rate reduced。
It should be appreciated that it is only exemplary and explanatory that above general description and details hereinafter describe, the application can not be limited。
Accompanying drawing explanation
In order to be illustrated more clearly that the embodiment of the present application or technical scheme of the prior art, the accompanying drawing used required in embodiment or description of the prior art will be briefly described below, apparently, for those of ordinary skills, under the premise not paying creative work, it is also possible to obtain other accompanying drawing according to these accompanying drawings。
Fig. 1 is the schematic flow sheet that a kind of data base's numerical value shown in the application one exemplary embodiment reduces method。
Fig. 2 is step S104 mono-exemplary flow schematic diagram。
Fig. 3 is step S104 another exemplary schematic flow sheet。
Fig. 4 is the another exemplary flow schematic diagram of step S104。
Fig. 5 is the schematic flow sheet that a kind of data base's numerical value shown in the application another exemplary embodiment reduces method。
Fig. 6 is the block diagram that a kind of data base's numerical value shown in the application one exemplary embodiment reduces system。
Fig. 7 is the block diagram that a kind of data base's numerical value shown in the application another exemplary embodiment reduces system。
Detailed description of the invention
Here in detail exemplary embodiment being illustrated, its example representation is in the accompanying drawings。When as explained below relates to accompanying drawing, unless otherwise indicated, the same numbers in different accompanying drawings represents same or analogous key element。Embodiment described in following exemplary embodiment does not represent all embodiments consistent with the application。On the contrary, they only with in appended claims describe in detail, the application some in the example of consistent system and method。
The application in order to understand the application comprehensively, refer to numerous concrete details in the following detailed description, it will be appreciated by those skilled in the art that can realize without these details。In other embodiments, being not described in detail known method, process, assembly and circuit, obscuring in order to avoid undesirably resulting in embodiment。
First aspect according to the embodiment of the present application, it is provided that a kind of data base's numerical value reduces method。Fig. 1 is the schematic flow sheet that a kind of data base's numerical value shown in the application one exemplary embodiment reduces method, as it is shown in figure 1, described method includes:
Step S101, server receives and reduces request, reduces request generation reduce label according to described, and the numerical value of variable corresponding to the request of reducing described in judging whether more than described reduce in request reduce value。
Wherein, other-end or platform are when needing variable application relevant in the data base of server to reduce, and other-end or platform send to server and reduce request。With conventional to reduce request identical, the described request of reducing comprises variable information etc. corresponding in the data base reducing value and server, namely described value of reducing needs the numerical values recited that the variable of correspondence is reduced from the data base of server, after server receives the request of reducing, according to the variable information comprised in the request of reducing with reduce value generation and reduce label, server according to described in reduce label relevant variable reduced operation。It should be noted that described in reduce label and variable, and following variable value etc. is all the relative recording in the data base of server, for the convenience illustrated, the title of understanding easy to use is described。
After reducing label generation, server relatively described in reduce request reduce value, the numerical value of the variable corresponding with the described request of reducing compares, the numerical value of the variable that the request of reducing described in judgement is corresponding whether more than described reduce in request reduce value, namely judge whether the numerical value of described variable enough completes this time to reduce label。It should be noted that, reduce in label reduce value with corresponding reduce in request to reduce value identical, judge the numerical value of described variable whether more than described reduce in request reduce value, with the numerical value judging described variable whether more than described reduce in label to reduce value consistent。
Step S102, when described variable numerical value less than described reduce in request when reducing value, described label of reducing is labeled as failure。
Wherein, when described variable numerical value less than described reduce in request when reducing value, the numerical value of described variable has been not enough to this time reduce label, namely reduces unsuccessfully, now described label of reducing is labeled as failure。Described labelling can be insert token variable in reducing label, arranging token variable is represent to reduce the value that label failure is corresponding with time successful, such as, when token variable is 0, represent that reducing label processes unsuccessfully, when token variable is 1, represent that reducing label completes, namely reduce successfully, label will be reduced and be labeled as failure, in reducing label, namely insert token variable and to arrange described token variable be 0。
Described labelling can also be: described in reduce label generate time, for reducing label, state variable is set, described state variable is with to reduce label corresponding, and to state variable specify different values represent reduce that label is untreated, failure and success, such as, when reducing label generation, default conditions variable is 0, and it is untreated that label is reduced in expression, arrange and when state variable is 1, represent that reducing label processes unsuccessfully, arrange and when state variable is 2, represent that reducing label completes。To reduce label and be labeled as failure, the state variable being about to reduce label is set to 1。
Identical with regular situation, when described variable numerical value more than or equal to described reduce in request when reducing value, reduce label described in completing。After completing to reduce label, it is possible to the label of reducing completed is labeled as successfully, or the fail flag reducing in label deleted。
For each variable of server, have and multiple relevant reduce label, if the numerical value of variable is little, be also likely to multiple be labeled as failure reduce label。Multiple labels of reducing being labeled as failure that each variable is corresponding can be in any permutation, can also by the time order and function order arrangement generated, or snap-fastener subtracts the priority arrangement of label, described in reduce the priority of label and arrange when label is reduced in generation by the importance of the request of reducing。
Step S103, whether the numerical value monitoring described variable increases。
Wherein, whether the numerical value monitoring described variable increases, can pass through to detect whether that producing new completed increment label realizes, described increment label is corresponding with described variable, for recording described variable by other-end or platform or the situation being increased numerical value by server itself, such as the data base preserving payment data, described variable is account, the numerical value of described variable is the remaining sum of account, when account is recharged, remaining sum increases, and produces accordingly to supplement order with money, described in supplement order with money and be namely equivalent to described increment label。When creating new completed increment label, the numerical value of variable increases;Generally increment label has included and has been not fully complete two states, therefore can also monitor the state of all increment labels of variable, and when there being increment label to complete, the numerical value of variable increases。Described monitoring can be all variablees in server monitored data storehouse, it is also possible to scans all labels of reducing for server, monitor be labeled as failure reduce the variable that label is corresponding。
Step S104, when the numerical value of described variable increases, retries reduce the label of reducing being labeled as failure。
Fig. 2 is step S104 mono-exemplary flow schematic diagram。As in figure 2 it is shown, in a kind of possible embodiment, when the described numerical value when described variable increases, the label of reducing being labeled as failure is retried and reduces, it is possible to including:
Step a1, it is judged that currently carry out retrying reduce reduce label reduce value whether less than or equal to the numerical value of described variable;
Step a2, when currently carry out retrying reduce reduce when reducing value less than or equal to the numerical value of described variable of label, complete currently to carry out to retry reduce reduce label, change to currently carrying out retrying the labelling reducing label reduced successfully;
Step a3, it may be judged whether what have that next is labeled as failure reduces label;
Step a4, if what have that next is labeled as failure reduces label, the label of reducing that next is labeled as failure retries the label of reducing reduced as currently carrying out, and returns step a1;Otherwise,
Step a5, terminates to retry to reduce。
Wherein, the label of reducing being labeled as failure would generally in chronological order or priority orders arrangement, it is possible to according to the arrangement of described time sequencing or priority orders arrangement, the label of reducing being labeled as failure is retried and is reduced。
In step a2, when currently carry out retrying reduce reduce when reducing value less than or equal to the numerical value of described variable of label, namely the numerical value of variable be enough to currently to carry out to retry reduce when reducing label, deduct from the numerical value of variable currently carry out retrying reduce reduce label reduce value, complete currently to carry out to retry reduce reduce label, and currently carrying out of completing is retried the labelling reducing label reduced change to successfully, such as it is set to sign and reduces label by currently carrying out retrying the token variable reducing label reduced and complete successful value。
When after execution of step a2, or when currently carry out retrying reduce reduce when reducing value more than the numerical value of described variable of label, perform step a3, judge whether that what next was labeled as failure reduces label, namely judge to reduce in label sequence, currently carry out retrying reduce reduce label after whether also have what be labeled as failure to reduce label: if had, then using described next be labeled as failure reduce label as currently carry out retrying reduce reduce label, and return step a1, that is, it is labeled as in the sequence reducing label of failure, processed one be labeled as failure reduce label after, what then process that next is labeled as failure reduces label;If currently carry out retrying reduce reduce label after do not have what next was labeled as failure to reduce label, then it represents that all labels of reducing being labeled as failure all process, terminate to retry to reduce。
It should be noted that, often complete one be labeled as failure reduce label, the numerical value of variable all can reduce, to next be labeled as failure reduce label process time, being that the residual value of variable after being reduced value and reducing compares, described residual value is remaining numerical value after the numerical value of variable carries out reducing。It addition, after the numerical value of variable increases, the numerical value of this time be not necessarily enough to all be labeled as failure reduce label, for this time failed be labeled as failure reduce label, by when the numerical value of upper once variable increases, again carry out retrying reducing。
Fig. 3 is step S104 another exemplary schematic flow sheet。As it is shown on figure 3, in alternatively possible embodiment, when the described numerical value when described variable increases, the label of reducing being labeled as failure is retried and reduces, it is possible to including:
Step b1, the numerical value calculating described variable successively deducts each difference reducing value reducing label being labeled as failure of correspondence;
Step b2, it is judged that whether described difference is all less than 0;
Step b3, if described difference is all less than 0, stops retrying reducing;Otherwise,
Step b4, if there is difference more than or equal to 0, choose more than or equal to 0 and minimum difference, complete described difference corresponding be labeled as failure reduce label, the labelling reducing label being labeled as failure completed is changed to successfully, and returns step b1。
Wherein, if add after the numerical value of variable still only small, what be not enough to that any one is labeled as failure reduces label, if in this case still each label of reducing being labeled as failure is processed, can expend unnecessary system resource。Therefore in the present embodiment, when the numerical value of variable increases, after first judging to increase the numerical value of variable whether can enough complete at least one be labeled as failure reduce label, namely in step b1, the numerical value first calculating described variable successively deducts each difference of reducing value of reducing label that be labeled as failure corresponding with this variable, then in step b2, it is judged that whether the difference obtained is all less than 0。If the difference obtained is all less than 0, illustrate this increase after the numerical value of variable be not enough to corresponding with this variable any one be labeled as failure reduce label, then stop retrying reducing, namely retry and reduce end;If in the difference obtained, there is the difference more than or equal to 0, that is this increase after the numerical value of variable be enough to one or more be labeled as failure reduce label, then from the difference more than or equal to 0 corresponding be labeled as failure reduce label, choose one be labeled as failure reduce label, this is reduced label complete, can choose the difference minimum more than or equal in the difference of 0 corresponding be labeled as failure reduce label, this is reduced label complete, the difference maximum more than or equal in the difference of 0 can also be chosen, middle difference or any one difference corresponding be labeled as failure reduce label, this is reduced label complete。This reduces after label completes, and changes to successfully by this labelling reducing label being labeled as failure completed, is then back to step b1。The numerical value that the residual value of this variations per hour is after increasing deducts and is selected for retrying the value of reducing reducing label reduced, and returns step b1 namely for subtracting each other the residual value of rear variable, repeats b1 to b4。
Fig. 4 is the another exemplary flow schematic diagram of step S104。As shown in Figure 4, in the embodiment that another is possible, when the described numerical value when described variable increases, the label of reducing being labeled as failure is retried and reduces, it is possible to including:
Step c1, the numerical value calculating described variable successively deducts the difference reducing value reducing label being labeled as failure;
Step c2, it is judged that whether described difference is all less than 0;
Step c3, if described difference is all less than 0, stops retrying reducing;Otherwise
Step c4, if there is difference more than or equal to 0, chooses more than or equal to 0 and minimum difference, complete described difference corresponding be labeled as failure reduce label, the labelling reducing label being labeled as failure completed is changed to successfully;
Step c5, calculate successively the numerical value of described variable deduct the remaining difference more than or equal to 0 corresponding reduce label corresponding reduce value, obtain new difference;
Step c6, it is judged that whether described new difference is all less than 0;
Step c7, if described new difference is all less than 0, stops retrying reducing;Otherwise,
Step c8, if there is new difference more than or equal to 0, choose more than or equal to 0 and minimum new difference, complete described new difference corresponding be labeled as failure reduce label, the labelling reducing label being labeled as failure completed is changed to successfully, and returns step c5。
Wherein, in the embodiment of the step S104 shown in Fig. 3, the numerical value of variable after increasing has been enough to a plurality of be labeled as when reducing label of failure, often complete one be labeled as failure reduce label, the numerical value of variable and all differences reducing label being labeled as failure after change will be recalculated。But after the numerical value increase of variable, the first time numerical value of calculated variable deducts in the difference reducing value gained reducing label being labeled as failure, failure that what difference less than 0 was corresponding be labeled as reduce that label is known reduces label for what this can not complete, need not repeating the difference calculating these numerical value reducing value and variable reducing label being labeled as failure, double counting can expend unnecessary system resource。
For saving system resource, in the present embodiment, numerical value at variable increases, first time calculate the numerical value of variable deduct be labeled as failure reduce label reduce after value obtains difference, if all differences are all less than 0, then illustrate all to be labeled as reducing label and all can not completing of failure, stop retrying reducing;If there is the difference more than or equal to 0, choose a difference minimum more than or equal in the difference of 0, the difference maximum more than or equal in the difference of 0, middle difference or any one difference can also be chosen, complete the difference that is selected corresponding be labeled as failure reduce label, the labelling reducing label being labeled as failure completed is changed to successfully。Then, for the remaining difference more than or equal to 0 corresponding be labeled as failure reduce label, calculate successively the residual value of variable deduct these reduce label corresponding reduce value, obtain new difference, wherein the residual value of variable be variable numerical value originally deduct completed labelling is changed to successfully reduce label reduce value after the difference that obtains。For the new difference obtained, perform step c6 to step c8 again, wherein step c6 and step c2 is similar, step c8 and step c3 is similar, and the labelling reducing label being labeled as failure completed is changed to by step c8 successfully afterwards return step c5, that is often complete one be labeled as failure reduce label, to the remainder new difference more than or equal to 0 corresponding be labeled as failure reduce label repeated execution of steps c5 to c8, until the label of reducing being labeled as failure that can complete is fully completed。
Fig. 5 is the schematic flow sheet that a kind of data base's numerical value shown in the application another exemplary embodiment reduces method, as it is shown in figure 5, described method includes:
Step S501, server receives and reduces request, reduces request generation reduce label according to described, and the numerical value of variable corresponding to the request of reducing described in judging whether more than described reduce in request reduce value;
Step S502, when described variable numerical value less than described reduce in request when reducing value, described label of reducing is labeled as failure, and by described variable label for owing value;
Step S503, monitors whether the numerical value being labeled as the variable owing value increases;
Step S504, when the numerical value increase of the described variable being labeled as and owing value, retries reduce the label of reducing being labeled as failure;
Step S505, when be labeled as failure reduce label all retry reduce successfully time, delete the deficient value labelling of described variable。
Wherein, step S501 is identical with step S101。In step S502, when described variable numerical value less than described reduce in request when reducing value, label will be reduced and be labeled as failure, and by described variable label for owing value, so in step S503, only need to monitor whether the numerical value being labeled as the variable owing value increases。If all variablees are monitored, owing to variable number is huge, monitoring processes will occupy a large amount of system resource, if passing marker is failed reduce label, monitor be labeled as failure reduce the variable that label is corresponding, due to be labeled as failure to reduce record odd number very many, and generally have under a variable multiple be labeled as failure reduce label, can there is the situation that variable is repeated to be monitored。Only monitor whether the numerical value being labeled as the variable owing value increases, it is possible to greatly reduce system monitoring and process the system resource occupied, improve and reduce treatment effeciency。Described is deficient value by variable label, it is possible to for inserting token variable in the variable information of record, and arrange the token variable value representing the whether deficient value of variable, such as token variable is 0, then representing that described variable owes value, token variable is empty or other values, then it represents that variable does not owe value。By variable label for owing value, it is possible to use the database data labeling method of other routines。
Wherein, step S504 is identical with step S104。In step S505, the reduce label that be labeled as failure corresponding when variable all retries and reduces successfully, what be namely labeled as failure under these variablees all reduces label when all completing, delete the deficient value labelling of described variable, server this variable again occur being labeled as failure reduce label before, whether the numerical value no longer monitoring this variable increases。
Description by above embodiment of the method, those skilled in the art is it can be understood that can add the mode of required general hardware platform by software to the application and realize, hardware can certainly be passed through, but in a lot of situation, the former is embodiment more preferably。Based on such understanding, the part that prior art is contributed by the technical scheme of the application substantially in other words can embody with the form of software product, and it is stored in a storage medium, including some instructions with so that a smart machine performs all or part of step of method described in each embodiment of the application。And aforesaid storage medium includes: the various media that can store data and program code such as read only memory (ROM), random access memory (RAM), magnetic disc or CDs。
Corresponding to the first aspect of the embodiment of the present application, the second aspect according to the embodiment of the present application, it is provided that a kind of data base's numerical value reduces system。Fig. 6 is the block diagram that a kind of database data shown in the application one exemplary embodiment reduces system。As shown in Figure 6, described system includes:
Reduce request reception unit U601, reduce request for reception;
Reduce label and generate unit U602, described in basis, reduce request generation reduce label;
Judging unit U603, for variable corresponding to the request of reducing described in judging numerical value whether more than described reduce in request reduce value;
Reduce label indexing unit U604, for when described variable numerical value less than described reduce in request when reducing value, described label of reducing is labeled as failure;
Monitoring unit U605, whether the numerical value for monitoring described variable increases;
Retry and reduce unit U606, for when the numerical value of described variable increases, the label of reducing being labeled as failure being retried and reduces。
Wherein, in a kind of possible embodiment, described in retry and reduce unit, including:
First judgment sub-unit, for judge currently to carry out to retry reduce reduce label reduce value whether less than or equal to the numerical value of described variable;
First performs subelement, for when currently carry out retrying reduce reduce when reducing value less than or equal to the numerical value of described variable of label, complete currently to carry out retrying the label of reducing reduced, and the labelling reducing label described in completing changed to successfully;
Second judgment sub-unit, for judging whether that what next was labeled as failure reduces label,
Second performs subelement, if reducing label for what have that next is labeled as failure, what next was labeled as failure reduces label as currently carrying out retrying the label of reducing reduced, and returns described first judgment sub-unit, otherwise, terminate to retry to reduce。
Wherein, in alternatively possible embodiment, described in retry and reduce unit, including:
Mathematic interpolation subelement, for calculating the numerical value of described variable successively and being labeled as the difference reducing value reducing label of failure;
3rd judgment sub-unit, is used for judging that whether described difference is all less than 0;
3rd performs subelement, if for described difference all less than 0, stops retrying reducing, otherwise,
If there is the difference more than or equal to 0, choose more than or equal to 0 and minimum difference, complete described difference corresponding be labeled as failure reduce label, the labelling reducing label being labeled as failure completed is changed to successfully, and returns described mathematic interpolation subelement。
Wherein, in the embodiment that another is possible, described in retry and reduce unit, including:
Mathematic interpolation subelement, the numerical value for calculating described variable successively deducts the difference reducing value reducing label being labeled as failure;
3rd judgment sub-unit, is used for judging that whether described difference is all less than 0;
4th performs subelement, if for described difference all less than 0, stops retrying reducing, otherwise
If there is difference more than or equal to 0, choose more than or equal to 0 and minimum difference, complete described difference corresponding be labeled as failure reduce label, the labelling reducing label being labeled as failure completed is changed to successfully;
New mathematic interpolation subelement, the numerical value for calculating described variable successively deduct the remaining difference more than or equal to 0 corresponding reduce label corresponding reduce value, obtain new difference;
4th judgment sub-unit, is used for judging that whether described new difference is all less than 0;
5th performs subelement, if for described new difference all less than 0, stops retrying reducing, otherwise,
If there is the new difference more than or equal to 0, choose more than or equal to 0 and minimum new difference, complete described new difference corresponding be labeled as failure reduce label, the labelling reducing label being labeled as failure completed is changed to successfully, and returns described new mathematic interpolation subelement。
Fig. 7 is the block diagram that a kind of data base's numerical value shown in the application another exemplary embodiment reduces system。As it is shown in fig. 7, described system includes:
Reduce request reception unit U701, reduce request for reception;
Reduce label and generate unit U702, described in basis, reduce request generation reduce label;
Judging unit U703, for variable corresponding to the request of reducing described in judging numerical value whether more than described reduce in request reduce value;
Reduce label indexing unit U704, for when described variable numerical value less than described reduce in request when reducing value, described label of reducing is labeled as failure;
Variable label unit U705, for when described variable numerical value less than described reduce in request when reducing value, by described variable label for owe value;
Monitoring unit U706, for monitoring whether the numerical value being labeled as the variable owing value increases;
Retry and reduce unit U707, for when the numerical value increase of the described variable being labeled as and owing value, the label of reducing being labeled as failure being retried and reduces;
Variable label delete unit U708, for when be labeled as failure reduce label all retry reduce successfully time, delete the deficient value labelling of described variable。
For convenience of description, it is divided into various unit to be respectively described with function when describing system above。Certainly, the function of each unit can be realized in same or multiple softwares and/or hardware when implementing the application。
Each embodiment in this specification all adopts the mode gone forward one by one to describe, between each embodiment identical similar part mutually referring to, what each embodiment stressed is the difference with other embodiments。Especially for system or system embodiment, owing to it is substantially similar to embodiment of the method, so describing fairly simple, relevant part illustrates referring to the part of embodiment of the method。System described above and system embodiment are merely schematic, the wherein said unit illustrated as separating component can be or may not be physically separate, the parts shown as unit can be or may not be physical location, namely may be located at a place, or can also be distributed on multiple NE。Some or all of unit therein can be selected according to the actual needs to realize the purpose of the present embodiment scheme。Those of ordinary skill in the art, when not paying creative work, are namely appreciated that and implement。
It should be noted that, in this article, the such as relational terms of " first " and " second " or the like is used merely to separate an entity or operation with another entity or operating space, and there is relation or the backward of any this reality between not necessarily requiring or imply these entities or operating。And, term " includes ", " comprising " or its any other variant are intended to comprising of nonexcludability, so that include the process of a series of key element, method, system or equipment not only include those key elements, but also include other key elements being not expressly set out, or also include the key element intrinsic for this process, method, system or equipment。When there is no more restriction, statement " including ... " key element limited, it is not excluded that there is also other identical element in including the process of described key element, method, system or equipment。
The above is only the detailed description of the invention of the application, makes to skilled artisans appreciate that or realize the application。The multiple amendment of these embodiments be will be apparent to one skilled in the art, and generic principles defined herein when without departing from spirit herein or scope, can realize in other embodiments。Therefore, the application is not intended to be limited to the embodiments shown herein, and is to fit to the widest scope consistent with principles disclosed herein and features of novelty。

Claims (10)

1. data base's numerical value reduces method, it is characterised in that including:
Server receives and reduces request, reduces request generation reduce label according to described, and the numerical value of variable corresponding to the request of reducing described in judging whether more than described reduce in request reduce value;
When described variable numerical value less than described reduce in request when reducing value, described label of reducing is labeled as failure;
Whether the numerical value monitoring described variable increases;
When the numerical value of described variable increases, the label of reducing being labeled as failure is retried and reduces。
2. data base's numerical value as claimed in claim 1 reduces method, it is characterised in that when the described numerical value when described variable increases, and the label of reducing being labeled as failure is retried and reduced, including:
Step a1, it is judged that currently carry out retrying reduce reduce label reduce value whether less than or equal to the numerical value of described variable;
Step a2, when currently carry out retrying reduce reduce when reducing value less than or equal to the numerical value of described variable of label, complete currently to carry out to retry reduce reduce label, change to currently carrying out retrying the labelling reducing label reduced successfully;
Step a3, it may be judged whether what have that next is labeled as failure reduces label;
Step a4, if what have that next is labeled as failure reduces label, the label of reducing that next is labeled as failure retries the label of reducing reduced as currently carrying out, and returns step a1, otherwise, terminates to retry to reduce。
3. data base's numerical value as claimed in claim 1 reduces method, it is characterised in that when the described numerical value when described variable increases, and the label of reducing being labeled as failure is retried and reduced, including:
Step b1, calculates the numerical value of described variable successively and is labeled as the difference reducing value reducing label of failure;
Step b2, it is judged that whether described difference is all less than 0;
Step b3, if described difference is all less than 0, stops retrying reducing, otherwise,
If there is difference more than or equal to 0, choose more than or equal to 0 and minimum difference, complete described difference corresponding be labeled as failure reduce label, the labelling reducing label being labeled as failure completed is changed to successfully, and returns step b1。
4. data base's numerical value as claimed in claim 1 reduces method, it is characterised in that when the described numerical value when described variable increases, and the label of reducing being labeled as failure is retried and reduced, including:
Step c1, the numerical value calculating described variable successively deducts the difference reducing value reducing label being labeled as failure;
Step c2, it is judged that whether described difference is all less than 0;
Step c3, if described difference is all less than 0, stops retrying reducing, otherwise,
If there is difference more than or equal to 0, choose more than or equal to 0 and minimum difference, complete described difference corresponding be labeled as failure reduce label, the labelling reducing label being labeled as failure completed is changed to successfully;
Step c4, calculate successively the numerical value of described variable deduct the remaining difference more than or equal to 0 corresponding reduce label corresponding reduce value, obtain new difference;
Step c5, it is judged that whether described new difference is all less than 0;
Step c6, if described new difference is all less than 0, stops retrying reducing, otherwise,
If there is the new difference more than or equal to 0, choose more than or equal to 0 and minimum new difference, complete described new difference corresponding be labeled as failure reduce label, the labelling reducing label being labeled as failure completed is changed to successfully, and returns step c4。
5. the data base's numerical value as described in any one of Claims 1-4 reduces method, it is characterised in that also include:
When described variable numerical value less than described reduce in request when reducing value, by described variable label for owe value;
Monitor and be labeled as whether the numerical value of variable owing value increases, when the numerical value increase of the described variable being labeled as and owing value, successively the label of reducing being labeled as failure is retried and reduces;
When be labeled as failure reduce label all retry reduce successfully time, delete the deficient value labelling of described variable。
6. data base's numerical value reduces system, it is characterised in that including:
Reduce request reception unit, reduce request for reception;
Reduce label and generate unit, described in basis, reduce request generation reduce label;
Judging unit, for variable corresponding to the request of reducing described in judging numerical value whether more than described reduce in request reduce value;
Reduce label indexing unit, for when described variable numerical value less than described reduce in request when reducing value, described label of reducing is labeled as failure;
Monitoring unit, whether the numerical value for monitoring described variable increases;
Retry and reduce unit, for when the numerical value of described variable increases, the label of reducing being labeled as failure being retried and reduces。
7. data base's numerical value as claimed in claim 6 reduces system, it is characterised in that described in retry and reduce unit, including:
First judgment sub-unit, for judge currently to carry out to retry reduce reduce label reduce value whether less than or equal to the numerical value of described variable;
First performs subelement, for when currently carry out retrying reduce reduce when reducing value less than or equal to the numerical value of described variable of label, complete currently to carry out retrying the label of reducing reduced, and the labelling reducing label described in completing changed to successfully;
Second judgment sub-unit, for judging whether that what next was labeled as failure reduces label;
Second performs subelement, if reducing label for what have that next is labeled as failure, what next was labeled as failure reduces label as currently carrying out retrying the label of reducing reduced, and returns described first judgment sub-unit, otherwise, terminate to retry to reduce。
8. data base's numerical value as claimed in claim 6 reduces system, it is characterised in that described in retry and reduce unit, including:
Mathematic interpolation subelement, for calculating the numerical value of described variable successively and being labeled as the difference reducing value reducing label of failure;
3rd judgment sub-unit, is used for judging that whether described difference is all less than 0;
3rd performs subelement, if for described difference all less than 0, stops retrying reducing, otherwise,
If there is the difference more than or equal to 0, choose more than or equal to 0 and minimum difference, complete described difference corresponding be labeled as failure reduce label, the labelling reducing label being labeled as failure completed is changed to successfully, and returns described mathematic interpolation subelement。
9. data base's numerical value as claimed in claim 6 reduces system, it is characterised in that described in retry and reduce unit, including:
Mathematic interpolation subelement, the numerical value for calculating described variable successively deducts the difference reducing value reducing label being labeled as failure;
3rd judgment sub-unit, is used for judging that whether described difference is all less than 0;
4th performs subelement, if for described difference all less than 0, stops retrying reducing, otherwise,
If there is difference more than or equal to 0, choose more than or equal to 0 and minimum difference, complete described difference corresponding be labeled as failure reduce label, the labelling reducing label being labeled as failure completed is changed to successfully;
New mathematic interpolation subelement, the numerical value for calculating described variable successively deduct the remaining difference more than or equal to 0 corresponding reduce label corresponding reduce value, obtain new difference;
4th judgment sub-unit, is used for judging that whether described new difference is all less than 0;
5th performs subelement, if for described new difference all less than 0, stops retrying reducing, otherwise,
If there is the new difference more than or equal to 0, choose more than or equal to 0 and minimum new difference, complete described new difference corresponding be labeled as failure reduce label, the labelling reducing label being labeled as failure completed is changed to successfully, and returns described new mathematic interpolation subelement。
10. the data base's numerical value as described in any one of claim 6 to 9 reduces system, it is characterised in that also include:
Variable label unit, for when described variable numerical value less than described reduce in request when reducing value, by described variable label for owe value,
For monitoring, described monitoring unit is labeled as whether the numerical value of variable owing value increases, when the numerical value increase of the described variable being labeled as and owing value, successively the label of reducing being labeled as failure is retried and reduced;
Variable label delete unit, for when be labeled as failure reduce label all retry reduce successfully time, delete the deficient value labelling of described variable。
CN201410712439.7A 2014-11-28 2014-11-28 Database numerical value reduces method and system Active CN105701130B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410712439.7A CN105701130B (en) 2014-11-28 2014-11-28 Database numerical value reduces method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410712439.7A CN105701130B (en) 2014-11-28 2014-11-28 Database numerical value reduces method and system

Publications (2)

Publication Number Publication Date
CN105701130A true CN105701130A (en) 2016-06-22
CN105701130B CN105701130B (en) 2019-02-01

Family

ID=56230488

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410712439.7A Active CN105701130B (en) 2014-11-28 2014-11-28 Database numerical value reduces method and system

Country Status (1)

Country Link
CN (1) CN105701130B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070143248A1 (en) * 2005-12-19 2007-06-21 Yahoo! Inc. Method using query processing servers for query processing of column chunks in a distributed column chunk data store
CN101122885A (en) * 2007-09-11 2008-02-13 腾讯科技(深圳)有限公司 Data cache processing method, system and data cache device
CN103544153A (en) * 2012-07-10 2014-01-29 阿里巴巴集团控股有限公司 Data updating method and system based on database

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070143248A1 (en) * 2005-12-19 2007-06-21 Yahoo! Inc. Method using query processing servers for query processing of column chunks in a distributed column chunk data store
CN101122885A (en) * 2007-09-11 2008-02-13 腾讯科技(深圳)有限公司 Data cache processing method, system and data cache device
CN103544153A (en) * 2012-07-10 2014-01-29 阿里巴巴集团控股有限公司 Data updating method and system based on database

Also Published As

Publication number Publication date
CN105701130B (en) 2019-02-01

Similar Documents

Publication Publication Date Title
CN106911780A (en) Traffic ID generation method, apparatus and system
CN103678408A (en) Method and device for inquiring data
CN107545315A (en) Order processing method and device
CN106557482B (en) Inventory system data updating method and device
CN105530272A (en) Method and device for application data synchronization
CN105446893A (en) Data storage method and device
CN105989532A (en) Data processing method and device
CN105989079A (en) Method and apparatus for obtaining device fingerprint
CN116090808A (en) RPA breakpoint reconstruction method and device, electronic equipment and medium
CN105630840A (en) Push message sorting method and device
CN110134646B (en) Knowledge platform service data storage and integration method and system
CN109242582A (en) The generation method and Related product of invoice
CN106775962B (en) Rule execution method and device
CN104063374A (en) Data deduplication method and equipment
CN104636218B (en) Data reconstruction method and device
CN105701130A (en) Numerical value deduction method and system of database
CN104506630A (en) Method, server and system for generating authority data on basis of user roles
CN105740278A (en) Data processing method and apparatus
CN106844605B (en) Batch data logical process method and device
CN109359132A (en) A kind of method of data processing, device and system
CN105741061A (en) Data processing method, service engine and client side
CN106933933B (en) Data table information processing method and device
CN109582829A (en) A kind of processing method, device, equipment and readable storage medium storing program for executing
CN110889764A (en) Information processing method and device
CN109857590B (en) Data backup system of power dispatching center

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20201010

Address after: Grand Cayman Islands

Patentee after: Innovative advanced technology Co.,Ltd.

Address before: Grand Cayman Islands

Patentee before: Advanced innovation technology Co.,Ltd.

Effective date of registration: 20201010

Address after: Grand Cayman Islands

Patentee after: Advanced innovation technology Co.,Ltd.

Address before: Grand Cayman Islands

Patentee before: Alibaba Group Holding Ltd.

TR01 Transfer of patent right