Disclosure of Invention
One or more embodiments of the present disclosure provide a method and an apparatus for processing resource changes, so as to improve the output efficiency of a resource report.
To solve the above technical problem, one or more embodiments of the present specification are implemented as follows:
in one aspect, one or more embodiments of the present specification provide a method for processing resource change, including:
acquiring daily resource occurrence quantity of each date in a preset time period; wherein the daily resource amount refers to the amount of resources which change on the same day;
calculating the cumulative resource occurrence amount between the starting date of the preset time period and each date according to the daily resource occurrence amount; wherein, the resource accumulation occurrence amount refers to the accumulation value of the resource change between the starting date and each date;
respectively calculating the end-term resource amount of each date according to the cumulative resource occurrence amount and the initial resource amount of the starting date; wherein the initial resource amount refers to the resource amount before the resource change occurs on the day; the end balance refers to the amount of resources after a resource change occurs on the same day;
and generating a resource surplus report according to the end resource amount, wherein the resource surplus report comprises the corresponding relation between the end resource amount and each date.
In one embodiment, the obtaining the daily occurrence of resources on each date within the predetermined time period includes:
acquiring a first resource report, wherein the first resource report comprises the daily resource occurrence amount of each date;
and extracting the daily resource occurrence amount of each date from the first resource report.
In one embodiment, the calculating the cumulative resource occurrence amount from the starting date of the predetermined time period to each date in the predetermined time period according to the daily resource occurrence amount includes:
acquiring a date report containing each date;
performing Cartesian product operation on the first resource report and the date report to obtain a second resource report containing the daily occurrence amount of the resources and the corresponding relation between each first date and each second date; wherein, each first date is each date in the first resource report, and each second date is each date in the date report;
deleting the entries which do not accord with the preset conditions in the second resource report to obtain a third resource report; the preset condition comprises that the first date is not later than a corresponding second date;
and respectively calculating the resource accumulated occurrence amount between the starting date and each date according to the resource daily occurrence amount in the third resource report.
In one embodiment, the calculating the amount of resources at the end of each date according to the cumulative amount of occurrences of resources and the amount of resources at the beginning of each date includes:
and determining the sum of the cumulative resource occurrence amount and the initial resource amount as the final resource amount of the date corresponding to the cumulative resource occurrence amount.
In one embodiment, the determining the sum of the cumulative resource occurrence amount and the initial resource amount as the end-of-term resource amount of the date corresponding to the cumulative resource occurrence amount includes:
generating a fourth resource report containing the corresponding relation between the first date and the resource accumulation occurrence amount;
performing Cartesian product operation on the fourth resource report and the initial resource amount to obtain a fifth resource report containing the corresponding relation among the first date, the resource accumulation occurrence amount and the initial resource amount;
and adding the resource accumulation occurrence amount and the initial resource amount in the fifth resource report to obtain the end-term resource amount of the date corresponding to the resource accumulation occurrence amount.
In one embodiment, the method further comprises:
if the fact that the resource daily occurrence amount of a third date in the dates is updated is detected, calculating the resource accumulated occurrence amount between the starting date and each fourth date after the third date according to the updated resource daily occurrence amount of the third date;
and updating the resource surplus report according to the accumulated resource occurrence between the starting date and the fourth dates.
In another aspect, one or more embodiments of the present disclosure provide a method for processing a balance change, including:
acquiring daily occurrence amount of each date in a preset time period; wherein the daily amount of money refers to the amount of money that changes on the day;
calculating the accumulated occurrence amount between the starting date of the preset time period and each date according to the daily occurrence amount; wherein the accumulated occurrence amount refers to an accumulated value of amount change occurring between the starting date and each date;
respectively calculating the end balance of each date according to the accumulated occurrence amount and the beginning balance of the starting date; wherein the initial balance refers to the amount of money before the balance change on the day; the end balance refers to the amount of money after a balance change occurs on the same day;
and generating a balance report according to the end balance, wherein the balance report comprises the corresponding relation between the end balance and each date.
In one embodiment, the obtaining the daily occurrence amount for each date within the predetermined time period includes:
acquiring a first amount report, wherein the first amount report comprises daily occurrence amounts of all dates;
and extracting the daily occurrence amount of each date from the first amount report.
In one embodiment, said calculating a cumulative occurrence amount between a start date of said predetermined period of time and said dates according to said daily occurrence amount comprises:
acquiring a date report containing each date;
carrying out Cartesian product operation on the first amount report and the date report to obtain a second amount report containing the daily amount, the corresponding relation between each first date and each second date; wherein each first date is each date in the first amount report, and each second date is each date in the date report;
deleting the items which do not accord with the preset conditions in the second amount report to obtain a third amount report; the preset condition comprises that the first date is not later than a corresponding second date;
and respectively calculating the accumulated occurrence amount between the starting date and each date according to the daily occurrence amount in the third amount report.
In one embodiment, said calculating the end balances of said dates according to said cumulative occurrence amount and the beginning balance of said starting date respectively comprises:
and determining the sum of the accumulated occurrence amount and the initial balance as the end balance of the date corresponding to the accumulated occurrence amount.
In one embodiment, the determining the sum of the cumulative occurrence amount and the initial balance as an end balance of a date corresponding to the cumulative occurrence amount includes:
generating a fourth amount report including a corresponding relationship between the first date and the accumulated amount;
performing Cartesian product operation on the fourth amount report and the initial balance to obtain a fifth amount report containing the corresponding relation among the first date, the accumulated occurrence amount and the initial balance;
and adding the accumulated amount of occurrence and the initial balance in the fifth amount report to obtain the final balance of the date corresponding to the accumulated amount of occurrence.
In one embodiment, the method further comprises:
if the fact that the daily occurrence amount of the third date in the dates is updated is detected, calculating the accumulated occurrence amount from the starting date to the fourth dates after the third date according to the updated daily occurrence amount of the third date;
and updating the balance report according to the accumulated occurrence amount from the starting date to the fourth dates.
In another aspect, one or more embodiments of the present specification provide a resource change processing apparatus, including:
the first acquisition module is used for acquiring the daily resource occurrence amount of each date in a preset time period; wherein the daily resource amount refers to the amount of resources which change on the same day;
the first calculation module is used for calculating the cumulative resource occurrence amount between the starting date of the preset time period and each date according to the daily resource occurrence amount; wherein, the resource accumulation occurrence amount refers to the accumulation value of the resource change between the starting date and each date;
the second calculation module is used for calculating the future end resource amount of each date according to the cumulative resource occurrence amount and the future beginning resource amount of the starting date; wherein the initial resource amount refers to the resource amount before the resource change occurs on the day; the end balance refers to the amount of resources after a resource change occurs on the same day;
and the first generation module is used for generating a resource surplus report according to the end-of-term resource amount, wherein the resource surplus report comprises the corresponding relation between the end-of-term resource amount and each date.
In one embodiment, the first obtaining module comprises:
the first acquisition unit is used for acquiring a first resource report, and the first resource report comprises the daily resource occurrence amount of each date;
and the first extraction unit is used for extracting the daily resource occurrence amount of each date from the first resource report.
In one embodiment, the first calculation module comprises:
the second acquisition unit is used for acquiring a date report containing each date;
the first operation unit is used for carrying out Cartesian product operation on the first resource report and the date report to obtain a second resource report containing the resource daily occurrence amount, the corresponding relation between each first date and each second date; wherein, each first date is each date in the first resource report, and each second date is each date in the date report;
the first deleting unit is used for deleting the items which do not accord with the preset conditions in the second resource report to obtain a third resource report; the preset condition comprises that the first date is not later than a corresponding second date;
and the first calculation unit is used for respectively calculating the resource accumulated occurrence amount between the starting date and each date according to the resource daily occurrence amount in the third resource report.
In one embodiment, the second calculation module comprises:
and the first determining unit is used for determining the sum of the cumulative resource occurrence amount and the initial resource amount as the end-term resource amount of the date corresponding to the cumulative resource occurrence amount.
In one embodiment, the first determining unit is further configured to:
generating a fourth resource report containing the corresponding relation between the first date and the resource accumulation occurrence amount;
performing Cartesian product operation on the fourth resource report and the initial resource amount to obtain a fifth resource report containing the corresponding relation among the first date, the resource accumulation occurrence amount and the initial resource amount;
and adding the resource accumulation occurrence amount and the initial resource amount in the fifth resource report to obtain the end-term resource amount of the date corresponding to the resource accumulation occurrence amount.
In one embodiment, the above apparatus further comprises:
the third calculation module is used for calculating the cumulative resource occurrence amount between the starting date and each fourth date after the third date according to the updated resource daily occurrence amount of the third date if the fact that the resource daily occurrence amount of the third date in the dates is updated is detected;
and the first updating module is used for updating the resource surplus report according to the resource accumulated occurrence amount between the starting date and each fourth date.
In another aspect, one or more embodiments of the present specification provide an apparatus for processing a balance change, including:
the second acquisition module is used for acquiring daily occurrence amount of each date in a preset time period; wherein the daily amount of money refers to the amount of money that changes on the day;
the fourth calculation module is used for calculating the accumulated occurrence amount between the starting date of the preset time period and each date according to the daily occurrence amount; wherein the accumulated occurrence amount refers to an accumulated value of amount change occurring between the start date and each date;
a fifth calculating module, configured to calculate end balances of the dates according to the cumulative occurrence amount and the initial balances of the start dates, respectively; wherein the initial balance refers to the amount of money before the balance change on the day; the end balance refers to the amount of money after a balance change occurs on the same day;
and the second generation module is used for generating a balance report according to the end balance, wherein the balance report comprises the corresponding relation between the end balance and each date.
In one embodiment, the second obtaining module comprises:
a third obtaining unit, configured to obtain a first amount report, where the first amount report includes daily occurrence amounts of the dates;
and the second extraction unit is used for extracting the daily occurrence amount of each date from the first amount report.
In one embodiment, the fourth calculation module comprises:
a fourth acquiring unit, configured to acquire a date report including the dates;
the second operation unit is used for carrying out Cartesian product operation on the first amount report and the date report to obtain a second amount report containing the daily amount, the corresponding relation between the first dates and the second dates; wherein each first date is each date in the first amount report, and each second date is each date in the date report;
the second deleting unit is used for deleting the items which do not accord with the preset conditions in the second amount report to obtain a third amount report; the preset condition comprises that the first date is not later than a corresponding second date;
and the second calculation unit is used for calculating the accumulated occurrence amount between the starting date and each date according to the daily occurrence amount in the third amount report.
In one embodiment, the fifth calculation module comprises:
and a second determining unit configured to determine a sum of the cumulative occurrence amount and the initial balance as an end-of-term balance of a date corresponding to the cumulative occurrence amount.
In one embodiment, the second determination unit is further configured to:
generating a fourth amount report including a corresponding relationship between the first date and the accumulated amount;
performing Cartesian product operation on the fourth amount report and the initial balance to obtain a fifth amount report containing the corresponding relation among the first date, the accumulated occurrence amount and the initial balance;
and adding the accumulated amount of occurrence and the initial balance in the fifth amount report to obtain the final balance of the date corresponding to the accumulated amount of occurrence.
In one embodiment, the above apparatus further comprises:
a sixth calculating module, configured to calculate, if it is detected that a daily occurrence amount of a third date in the dates is updated, a cumulative occurrence amount between the start date and each fourth date after the third date according to the updated daily occurrence amount of the third date;
and the second updating module is used for updating the balance report according to the accumulated occurrence amount between the starting date and each fourth date.
In yet another aspect, one or more embodiments of the present specification provide a resource change processing device, including:
a processor; and
a memory arranged to store computer executable instructions that, when executed, cause the processor to:
acquiring daily resource occurrence quantity of each date in a preset time period; wherein the daily resource amount refers to the amount of resources which change on the same day;
calculating the cumulative resource occurrence amount between the starting date of the preset time period and each date according to the daily resource occurrence amount; wherein, the resource accumulation occurrence amount refers to the accumulation value of the resource change between the starting date and each date;
respectively calculating the end-term resource amount of each date according to the cumulative resource occurrence amount and the initial resource amount of the starting date; wherein the initial resource amount refers to the resource amount before the resource change occurs on the day; the end balance refers to the amount of resources after a resource change occurs on the same day;
and generating a resource surplus report according to the end resource amount, wherein the resource surplus report comprises the corresponding relation between the end resource amount and each date.
In yet another aspect, an embodiment of the present application provides a storage medium for storing computer-executable instructions, where the computer-executable instructions, when executed, implement the following processes:
acquiring daily resource occurrence quantity of each date in a preset time period; wherein the daily resource amount refers to the amount of resources which change on the same day;
calculating the cumulative resource occurrence amount between the starting date of the preset time period and each date according to the daily resource occurrence amount; wherein, the resource accumulation occurrence amount refers to the accumulation value of the resource change between the starting date and each date;
respectively calculating the end-term resource amount of each date according to the cumulative resource occurrence amount and the initial resource amount of the starting date; wherein the initial resource amount refers to the resource amount before the resource change occurs on the day; the end balance refers to the amount of resources after a resource change occurs on the same day;
and generating a resource surplus report according to the end resource amount, wherein the resource surplus report comprises the corresponding relation between the end resource amount and each date.
In yet another aspect, one or more embodiments of the present specification provide a resource change processing device, including:
a processor; and
a memory arranged to store computer executable instructions that, when executed, cause the processor to:
acquiring daily occurrence amount of each date in a preset time period; wherein the daily amount of money refers to the amount of money that changes on the day;
calculating the accumulated occurrence amount between the starting date of the preset time period and each date according to the daily occurrence amount; wherein the accumulated occurrence amount refers to an accumulated value of amount change occurring between the starting date and each date;
respectively calculating the end balance of each date according to the accumulated occurrence amount and the initial balance of the starting date; wherein the initial balance refers to the amount of money before the balance change on the day; the end balance refers to the amount of money after a balance change occurs on the same day;
and generating a balance report according to the end balance, wherein the balance report comprises the corresponding relation between the end balance and each date.
In yet another aspect, an embodiment of the present application provides a storage medium for storing computer-executable instructions, where the computer-executable instructions, when executed, implement the following processes:
acquiring daily occurrence amount of each date in a preset time period; wherein the daily amount of money refers to the amount of money that changes on the day;
calculating the accumulated occurrence amount between the starting date of the preset time period and each date according to the daily occurrence amount; wherein the accumulated occurrence amount refers to an accumulated value of amount change occurring between the starting date and each date;
respectively calculating the end balance of each date according to the accumulated occurrence amount and the initial balance of the starting date; wherein the initial balance refers to the amount of money before the balance change on the day; the end balance refers to the amount of money after a balance change occurs on the same day;
and generating a balance report according to the end balance, wherein the balance report comprises the corresponding relation between the end balance and each date.
By adopting the technical scheme of one or more embodiments of the specification, the resource daily occurrence amount of each date in the preset time period is obtained, the resource cumulative occurrence amount between the starting date and each date of the preset time period is calculated by using the resource daily occurrence amount, the end-of-term resource amount of each date is further calculated according to the resource cumulative occurrence amount and the initial-of-term resource amount of the starting date, and finally, the resource surplus report is generated by using the calculated end-of-term resource amount. Therefore, when the resource surplus report is generated, the end-of-term resource amount of each date in the resource surplus report can be calculated only by giving the starting date and the ending date of the preset time period and the resource daily occurrence amount of each date, and the dependency relationship between the end-of-term resource amount of each day and the last-day resource amount is removed, so that the end-of-term resource amount of each day is not required to be waited for being produced when the end-of-term resource amount of each day is calculated, and the production efficiency of the resource surplus report is effectively improved. Moreover, even if the daily resource occurrence amount of a certain day is abnormal, the report is not required to be repaired in sequence every day, and the report repairing efficiency is greatly improved.
By adopting the technical scheme of one or more embodiments of the specification, the daily occurrence amount of each date in the preset time period is obtained, the cumulative occurrence amount between the starting date and each date of the preset time period is calculated by using the daily occurrence amount, the end balance of each date is calculated according to the cumulative occurrence amount and the initial balance of the starting date, and finally, a balance report is generated by using the calculated end balance. Therefore, when the balance report is generated, the end of term balance of each date in the balance report can be calculated only by giving the starting date and the ending date of the preset time period and the daily occurrence amount of each date, and the dependency relationship between the end of term balance of each day and the end of term balance of the previous day is eliminated, so that the end of term balance output of the previous day does not need to be waited when the end of term balance of each day is calculated, and the output efficiency of the balance report is effectively improved. Moreover, even if the amount of money on a certain day is abnormal, the report does not need to be repaired in sequence every day, and the report repairing efficiency is greatly improved.
Detailed Description
One or more embodiments of the present disclosure provide a method and an apparatus for processing resource changes, so as to improve the output efficiency of a resource report.
In order to make those skilled in the art better understand the technical solutions in one or more embodiments of the present disclosure, the technical solutions in one or more embodiments of the present disclosure will be clearly and completely described below with reference to the drawings in one or more embodiments of the present disclosure, and it is obvious that the described embodiments are only a part of the embodiments of the present disclosure, and not all embodiments. All other embodiments that can be derived by a person skilled in the art from one or more of the embodiments of the present disclosure without making any creative effort shall fall within the protection scope of one or more of the embodiments of the present disclosure.
Fig. 1 is a schematic flow chart of a resource change processing method according to an embodiment of the present specification, as shown in fig. 1, the method includes:
s102, acquiring daily resource occurrence quantity of each date in a preset time period.
The daily resource amount refers to the amount of resources that change on the same day.
And S104, calculating the cumulative resource occurrence amount between the starting date and each date of the preset time period according to the daily resource occurrence amount.
The resource accumulation occurrence amount refers to an accumulation value of resource changes occurring between a start date and each date.
And S106, respectively calculating the end-term resource amount of each date according to the cumulative resource occurrence amount and the initial resource amount of the initial date.
Wherein, the initial resource amount refers to the resource amount before the resource change occurs on the day; the end balance refers to the amount of resources after a resource change occurs on the day.
And S108, generating a resource residual amount report according to the end-of-term resource amount, wherein the resource residual amount report comprises the corresponding relation between the end-of-term resource amount and each date.
By adopting the technical scheme of one or more embodiments of the specification, the resource daily occurrence amount of each date in the preset time period is obtained, the resource cumulative occurrence amount between the starting date and each date of the preset time period is calculated by using the resource daily occurrence amount, the end-of-term resource amount of each date is further calculated according to the resource cumulative occurrence amount and the initial-of-term resource amount of the starting date, and finally, the resource surplus report is generated by using the calculated end-of-term resource amount. Therefore, when the resource surplus report is generated, the end-of-term resource amount of each date in the resource surplus report can be calculated only by giving the starting date and the ending date of the preset time period and the resource daily occurrence amount of each date, and the dependency relationship between the end-of-term resource amount of each day and the last-day resource amount is removed, so that the end-of-term resource amount of each day is not required to be waited for being produced when the end-of-term resource amount of each day is calculated, and the production efficiency of the resource surplus report is effectively improved. Moreover, even if the daily occurrence quantity of resources of a certain day is abnormal, the reports do not need to be repaired in sequence every day, and the report repairing efficiency is greatly improved.
The following describes the processing method of resource change in the above embodiment in detail.
The daily occurrence of resources on each date within a predetermined time period is first acquired.
The daily resource amount refers to the amount of resources that change on the same day. Each date within the predetermined time period, i.e., each date between the start date and the expiration date of the predetermined time period.
In one embodiment, when the daily resource occurrence amount of each date in a predetermined time period is acquired, a first resource report including the daily resource occurrence amount of each date may be acquired first, and the daily resource occurrence amount of each date may be extracted from the first resource report.
Table 1 shows a first resource report acquired in an embodiment. In this embodiment, if the starting date of the predetermined time period is D1 and the ending date is D3, the first resource report includes the daily occurrence amount of the resource on each date between D1 and D3. For example, in the first resource report shown in table 1, the daily resource occurrence amount of D1 is 5, the daily resource occurrence amount of D2 is 10, and the daily resource occurrence amount of D3 is 6. In addition, the first resource report shown in table 1 may include other items such as accounts, names, and the like, besides the daily occurrence amount of the resource, and the ellipses "… …" in the table identify other items not shown, and the ellipses "… …" in the following tables have the same meaning as in table 1, and are not described again.
TABLE 1
| Date
|
Account
|
Name (R)
|
……
|
Daily occurrence of resources
|
| D1
|
……
|
……
|
……
|
5
|
| D2
|
……
|
……
|
……
|
10
|
| D3
|
……
|
……
|
……
|
6 |
After the daily resource occurrence amount of each date is acquired, the cumulative resource occurrence amount from the starting date of the preset time period to each date is calculated according to the acquired daily resource occurrence amount. Specifically, the calculation can be performed according to the following steps A1-A4.
Step A1, a date report including each date is obtained.
Table 2 shows a date report acquired in an embodiment, assuming that the dates in this embodiment are D1 to D3. Since each date included in the date report acquired in step a1 is the same as each date in the first resource report, the number of rows in the date report and the first resource report are also necessarily the same.
TABLE 2
Step A2, performing Cartesian product operation on the first resource report and the date report to obtain a second resource report containing the daily occurrence of the resource, the corresponding relationship between each first date and each second date.
Wherein, each first date is each date in the first resource report, and each second date is each date in the date report.
Performing a cartesian product operation on the first resource report shown in table 1 and the date report shown in table 2 to obtain a second resource report shown in table 3.
TABLE 3
| The first date
|
Account
|
Name (R)
|
……
|
Daily occurrence of resources
|
The second date
|
| D1
|
……
|
……
|
……
|
5
|
D1
|
| D2
|
……
|
……
|
……
|
|
D1
|
| D3
|
……
|
……
|
……
|
|
D1
|
| D1
|
……
|
……
|
……
|
|
D2
|
| D2
|
……
|
……
|
……
|
10
|
D2
|
| D3
|
……
|
……
|
……
|
|
D2
|
| D1
|
……
|
……
|
……
|
|
D3
|
| D2
|
……
|
……
|
……
|
|
D3
|
| D3
|
……
|
……
|
……
|
6
|
D3 |
Step A3, deleting the items which do not accord with the preset conditions in the second resource report to obtain a third resource report; the preset condition comprises that the first date is not later than the corresponding second date.
Since there is no possibility that the resource is changed when the first date is later than the second date corresponding thereto, the entry meeting the non-preset condition should be deleted. For example, after deleting the entries in table 3 that do not meet the preset condition, a third resource report shown in table 4 can be obtained.
TABLE 4
| The first date
|
Account
|
Name (R)
|
……
|
Daily occurrence of resources
|
The second date
|
| D1
|
……
|
……
|
……
|
5
|
D1
|
| D1
|
……
|
……
|
……
|
|
D2
|
| D2
|
……
|
……
|
……
|
10
|
D2
|
| D1
|
……
|
……
|
……
|
|
D3
|
| D2
|
……
|
……
|
……
|
|
D3
|
| D3
|
……
|
……
|
……
|
6
|
D3 |
Step A4, respectively calculating the resource accumulated occurrence amount between the initial date and each date according to the resource daily occurrence amount in the third resource report.
Taking the third resource report shown in table 4 as an example, the starting date is D1, and the cumulative resource occurrence amount between the starting dates D1 and D2 is the sum of the daily resource occurrence amount on the day D1 and the daily resource occurrence amount on the day D2, i.e., 5+10 equals 15. The cumulative resource occurrence amount between the start dates D1 and D3 is the sum of the daily resource occurrence amount on the day D1, the daily resource occurrence amount on the day D2 and the daily resource occurrence amount on the day D3, namely 5+10+ 6-21.
Through the above steps A1-A4, the cumulative amount of occurrences of resources between the start date and each date has been calculated. Then, the amount of the end-of-period resource on each date is calculated based on the amount of the cumulative resource occurrence and the amount of the initial resource on the start date. Specifically, the sum of the cumulative resource occurrence amount and the initial resource amount on the start date may be determined as the end-of-term resource amount on the date corresponding to the cumulative resource occurrence amount.
In one embodiment, the sum of the cumulative occurrence of resources and the initial resource amount may be calculated as follows, steps B1-B3.
And step B1, generating a fourth resource report containing the corresponding relation between the first date and the resource accumulation occurrence amount.
Continuing with the above example, calculating the cumulative resource occurrence between the start date and each date according to the daily resource occurrence in the third resource report shown in table 4 is: the cumulative occurrence amount of resources between the start dates D1 to D2 was 15, and the cumulative occurrence amount of resources between the start dates D1 to D3 was 21. Therefore, a fourth resource report is generated as shown in table 5 below.
TABLE 5
| The first date
|
Account
|
Name (R)
|
……
|
Cumulative resource occurrence
|
| D1
|
……
|
……
|
……
|
5
|
| D2
|
……
|
……
|
……
|
15
|
| D3
|
……
|
……
|
……
|
21 |
And step B2, performing Cartesian product operation on the fourth resource report and the initial resource amount to obtain a fifth resource report containing the corresponding relation among the first date, the resource accumulation occurrence amount and the initial resource amount.
Assuming that the initial resource amount of the start date D1 is 100, the fourth resource report shown in table 5 and the initial resource amount are subjected to cartesian product operation, so as to obtain a fifth resource report shown in table 6 below.
TABLE 6
| The first date
|
Account
|
Name (R)
|
……
|
Cumulative resource occurrence
|
Initial resource amount
|
| D1
|
……
|
……
|
……
|
5
|
100
|
| D2
|
……
|
……
|
……
|
15
|
100
|
| D3
|
……
|
……
|
……
|
21
|
100 |
And step B3, adding the resource accumulation occurrence amount and the initial resource amount in the fifth resource report to obtain the final resource amount of the date corresponding to the resource accumulation occurrence amount.
The cumulative resource occurrence amount and the initial-stage resource amount in the fifth resource report shown in table 6 are added, and the final-stage resource amount at each date can be calculated as follows: the amount of end-term resources of D1 is 100+5 ═ 105; the amount of end-term resources of D2 is 100+15 ═ 115; the amount of end-term resources for D3 is 100+21 ═ 121.
After the amount of the future resource on each date is calculated, a report of the remaining amount of the resource is generated based on the amount of the future resource on each date, as shown in table 7 below.
TABLE 7
| The first date
|
Account
|
Name(s)
|
……
|
Amount of end-of-term resources
|
| D1
|
……
|
……
|
……
|
105
|
| D2
|
……
|
……
|
……
|
115
|
| D3
|
……
|
……
|
……
|
121 |
As can be seen from the above-described embodiments, when calculating the end resource amount on each date, the initial resource amount on the start date and the cumulative resource generation amount corresponding to each date may be added without depending on the end resource amount on the previous date, so that it is not necessary to wait for the end resource amount on the previous date to be generated when calculating the end resource amount on each day, and the output efficiency of the remaining resource amount report is effectively improved.
In one embodiment, if it is detected that the resource daily occurrence amount of the third date in each date is updated, the resource cumulative occurrence amount between the start date and each fourth date after the third date is calculated according to the updated resource daily occurrence amount of the third date, and the resource remaining amount report is updated according to the resource cumulative occurrence amount between the start date and each fourth date. Specifically, after the cumulative resource occurrence amount between the start date and the fourth date after the third date is calculated, the end-of-term resource amount on each date may be calculated using the cumulative resource occurrence amount, and the remaining resource amount report may be updated according to the newly calculated end-of-term resource amount on each date.
In this embodiment, if the daily resource occurrence amount of a certain day is updated, it is only necessary to recalculate the cumulative resource occurrence amount between the start date and each date after the certain date, and then update the resource remaining amount report. Therefore, even if the daily occurrence quantity of resources on a certain day is abnormal, the reports do not need to be repaired in sequence one day, and the report repairing efficiency is greatly improved.
Fig. 2 is a schematic flow chart of a processing method of balance change according to an embodiment of the present disclosure, as shown in fig. 2, the method includes:
s202, acquiring daily occurrence amount of each date in a preset time period.
Wherein the daily amount of money refers to the amount of money that changes on the day.
S204, calculating the accumulated occurrence amount between the initial date and each date of the preset time period according to the daily occurrence amount.
The cumulative occurrence amount is a cumulative value of the amount change occurring between the start date and each date.
And S206, respectively calculating the balance of the end of each date according to the accumulated amount of the generated money and the balance of the beginning of the initial date.
Wherein, the initial balance refers to the amount of money before the balance change on the day; the end balance refers to the amount of money after a balance change occurs on the day.
And S208, generating a balance report according to the end balance, wherein the balance report comprises the corresponding relation between the end balance and each date.
By adopting the technical scheme of one or more embodiments of the specification, the daily occurrence amount of each date in the preset time period is obtained, the cumulative occurrence amount between the starting date and each date of the preset time period is calculated by using the daily occurrence amount, the end balance of each date is calculated according to the cumulative occurrence amount and the initial balance of the starting date, and finally, a balance report is generated by using the calculated end balance. Therefore, when the balance report is generated, the end balance of each date in the balance report can be calculated only by giving the starting date and the ending date of the preset time period and the daily occurrence amount of each date, and the dependency relationship between the end balance of each day and the end balance of the previous day is eliminated, so that the end balance output of the previous day does not need to be waited when the end balance of each day is calculated, and the output efficiency of the balance report is effectively improved. Moreover, even if the amount of money on a certain day is abnormal, the report does not need to be repaired in sequence every day, and the report repairing efficiency is greatly improved.
The processing method of the balance change in the above embodiment is described in detail below.
The daily occurrence amount of each date within a predetermined period of time is first acquired.
Wherein the daily amount of money refers to the amount of money that changes on the day. Each date within the predetermined time period, i.e., each date between the start date and the expiration date of the predetermined time period.
In one embodiment, when the daily occurrence amount of each date in the predetermined time period is obtained, a first amount report including the daily occurrence amount of each date may be obtained first, and then the daily occurrence amount of each date is extracted from the first amount report.
Table 8 shows a first amount report obtained in one embodiment. Assuming that the starting date of the predetermined time period is D1 and the ending date is D3 in the present embodiment, the daily occurrence amount (in units of yuan) of each date between D1 and D3 is included in the first amount report. For example, in the first amount table shown in table 8, the daily occurrence amount of D1 is 5, the daily occurrence amount of D2 is 10, and the daily occurrence amount of D3 is 6.
TABLE 8
| Date
|
Account
|
Name (R)
|
……
|
Daily occurrence amount (Yuan)
|
| D1
|
……
|
……
|
……
|
5
|
| D2
|
……
|
……
|
……
|
10
|
| D3
|
……
|
……
|
……
|
6 |
After the daily occurrence amount of each date is acquired, the cumulative occurrence amount from the start date to each date of the predetermined period is calculated based on the acquired daily occurrence amount. Specifically, the calculation can be performed according to the following steps C1-C4.
Step C1, a date report including the dates is obtained.
Table 9 shows a date report acquired in an embodiment, assuming that the dates in this embodiment are D1 to D3. Since each date included in the date report acquired in step C1 is the same as each date in the first amount report, the line numbers of the date report and the first amount report are also necessarily the same.
TABLE 9
And step C2, carrying out Cartesian product operation on the first amount report and the date report to obtain a second amount report containing the daily amount, the corresponding relation between the first dates and the second dates.
Wherein each first date is each date in the first amount report, and each second date is each date in the date report.
The first amount report shown in table 8 and the date report shown in table 9 are subjected to cartesian product operation to obtain a second amount report shown in table 10.
TABLE 10
| The first date
|
Account
|
Name (R)
|
……
|
Daily occurrence amount (Yuan)
|
The second date
|
| D1
|
……
|
……
|
……
|
5
|
D1
|
| D2
|
……
|
……
|
……
|
|
D1
|
| D3
|
……
|
……
|
……
|
|
D1
|
| D1
|
……
|
……
|
……
|
|
D2
|
| D2
|
……
|
……
|
……
|
10
|
D2
|
| D3
|
……
|
……
|
……
|
|
D2
|
| D1
|
……
|
……
|
……
|
|
D3
|
| D2
|
……
|
……
|
……
|
|
D3
|
| D3
|
……
|
……
|
……
|
6
|
D3 |
Step C3, deleting the items which do not accord with the preset conditions in the second amount report to obtain a third amount report; the preset condition comprises that the first date is not later than the corresponding second date.
Since there is no possibility that the amount of money varies when the first date is later than the second date corresponding thereto, the entry meeting the non-preset condition should be deleted. For example, after deleting the entries in table 10 that do not meet the preset condition, a third amount report shown in table 11 can be obtained.
And step C4, respectively calculating the accumulated occurrence amount between the initial date and each date according to the daily occurrence amount in the third amount report.
TABLE 11
| The first date
|
Account
|
Name (R)
|
……
|
Daily occurrence amount (Yuan)
|
The second date
|
| D1
|
……
|
……
|
……
|
5
|
D1
|
| D1
|
……
|
……
|
……
|
|
D2
|
| D2
|
……
|
……
|
……
|
10
|
D2
|
| D1
|
……
|
……
|
……
|
|
D3
|
| D2
|
……
|
……
|
……
|
|
D3
|
| D3
|
……
|
……
|
……
|
6
|
D3 |
Taking the third amount report shown in table 11 as an example, the starting date is D1, and the cumulative amount of money generated between the starting dates D1 and D2 is the sum of the daily amount of money generated on the day D1 and the daily amount of money generated on the day D2, i.e., 5+10 is 15 (yuan). The cumulative amount of the generated money between the start dates D1 and D3 is the sum of the daily amount of the generated money on the day D1, the daily amount of the generated money on the day D2, and the daily amount of the generated money on the day D3, that is, 5+10+ 6-21 (yuan).
Through the above-described steps C1-C4, the cumulative amount of occurrence from the start date to each date has been calculated. Then, the end balance of each date is calculated based on the cumulative amount of money generated and the initial balance of the start date. Specifically, the sum of the cumulative occurrence amount and the initial balance of the start date may be determined as the end balance of the date corresponding to the cumulative occurrence amount.
In one embodiment, the sum of the cumulative amount of occurrences and the beginning balance of the start date may be calculated as follows, steps E1-E3.
Step E1, a fourth amount report is generated containing the corresponding relationship between the first date and the cumulative amount of money.
Continuing with the above example, the cumulative amount of occurrences between the start date and each date calculated from the daily amount of occurrences in the third amount report shown in table 11 is: the cumulative occurrence amount between the start dates D1 to D2 was 15 (yuan), and the cumulative occurrence amount between the start dates D1 to D3 was 21 (yuan). Therefore, a fourth amount report is generated as shown in table 12 below.
TABLE 12
| The first date
|
Account
|
Name (R)
|
……
|
Cumulative amount of occurrence (Yuan)
|
| D1
|
……
|
……
|
……
|
5
|
| D2
|
……
|
……
|
……
|
15
|
| D3
|
……
|
……
|
……
|
21 |
And E2, performing Cartesian product operation on the fourth amount report and the initial balance to obtain a fifth amount report containing the corresponding relation among the first date, the accumulated occurrence amount and the initial balance.
Assuming that the balance at the beginning of the start date D1 is 100 (yuan), the fifth amount report shown in the following table 13 can be obtained by performing a cartesian product operation on the fourth amount report and the beginning resource amount shown in table 12.
Watch 13
| The first date
|
Account
|
Name(s)
|
……
|
Cumulative amount of occurrence (Yuan)
|
Balance at beginning of period (Yuan)
|
| D1
|
……
|
……
|
……
|
5
|
100
|
| D2
|
……
|
……
|
……
|
15
|
100
|
| D3
|
……
|
……
|
……
|
21
|
100 |
And E3, adding the accumulated amount of occurrence and the initial balance in the fifth amount report to obtain the final balance of the date corresponding to the accumulated amount of occurrence.
The cumulative occurrence amount and the initial balance in the fifth amount report shown in table 13 are added, and the final balance of each date can be calculated as follows: the end balance of D1 is 100+5 to 105 (yuan); the end-of-term balance of D2 is 100+15 to 115 (yuan); the end-of-term balance of D3 is 100+21 to 121 (yuan).
After calculating the end of term balances on each date, a balance report is generated based on the end of term balances on each date, as shown in table 14 below.
TABLE 14
| The first date
|
Account
|
Name (R)
|
……
|
Balance at end of term (yuan)
|
| D1
|
……
|
……
|
……
|
105
|
| D2
|
……
|
……
|
……
|
115
|
| D3
|
……
|
……
|
……
|
121 |
As can be seen from the above embodiments, when calculating the end balance of each date, the end balance of the previous date is not relied on, but the initial balance of the start date and the accumulated amount of occurrence corresponding to each date are added, so that it is not necessary to wait for the end balance of the previous date to be produced when calculating the end balance of each day, and the production efficiency of the balance report is effectively improved.
In one embodiment, if it is detected that the daily occurrence amount of the third date in each date is updated, the accumulated occurrence amount between the start date and each fourth date after the third date is calculated according to the updated daily occurrence amount of the third date, and the balance report is updated according to the accumulated occurrence amount between the start date and each fourth date. Specifically, after the cumulative occurrence amount between the start date and the fourth date after the third date is calculated, the end balance of each date may be calculated using the cumulative occurrence amount, and the balance report may be updated according to the newly calculated end balance of each date.
In this embodiment, if the daily occurrence amount of a certain day is updated, the accumulated occurrence amount between the start date and each date after the certain date is only calculated again, and the balance report is updated. Therefore, even if the daily occurrence amount of a certain day is abnormal, the report does not need to be repaired in sequence every day, and the repair efficiency of the report is greatly improved.
In summary, particular embodiments of the present subject matter have been described. Other embodiments are within the scope of the following claims. In some cases, the actions recited in the claims can be performed in a different order and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may be advantageous.
Based on the same idea, the above-mentioned resource change processing method and balance change processing method provided in one or more embodiments of the present specification further provide a resource change processing device and a balance change processing device.
Fig. 3 is a schematic block diagram of a resource change processing apparatus according to an embodiment of the present specification, and as shown in fig. 3, a resource change processing apparatus 300 includes:
a first obtaining module 310, configured to obtain daily resource occurrence amounts of dates in a predetermined time period; wherein, the daily resource amount refers to the amount of resources which change on the same day;
the first calculating module 320 is used for calculating the cumulative resource occurrence amount from the starting date to each date of the preset time period according to the daily resource occurrence amount; the resource accumulation occurrence amount refers to an accumulation value of resource change occurring between the starting date and each date;
the second calculating module 330 is configured to calculate end-term resource amounts of each date according to the cumulative resource occurrence amount and the initial resource amount of the start date; wherein, the initial resource amount refers to the resource amount before the resource change occurs on the day; the end balance refers to the amount of resources after the change of resources occurs on the same day;
the first generating module 340 is configured to generate a resource remaining amount report according to the end-of-term resource amount, where the resource remaining amount report includes a correspondence between the end-of-term resource amount and each date.
In one embodiment, the first obtaining module 310 includes:
the system comprises a first acquisition unit, a second acquisition unit and a resource management unit, wherein the first acquisition unit is used for acquiring a first resource report, and the first resource report comprises daily resource occurrence amount of each date;
and the first extraction unit is used for extracting the daily resource occurrence amount of each date from the first resource report.
In one embodiment, the first calculation module 320 includes:
the second acquisition unit is used for acquiring a date report containing each date;
the first operation unit is used for carrying out Cartesian product operation on the first resource report and the date report to obtain a second resource report containing the resource daily occurrence amount, the corresponding relation between each first date and each second date; wherein, each first date is each date in the first resource report, and each second date is each date in the date report;
the first deleting unit is used for deleting the items which do not accord with the preset conditions in the second resource report to obtain a third resource report; the preset conditions comprise that the first date is not later than a corresponding second date;
and the first calculation unit is used for calculating the resource accumulated occurrence amount from the starting date to each date according to the resource daily occurrence amount in the third resource report.
In one embodiment, the second calculation module 330 includes:
and the first determining unit is used for determining the sum of the resource accumulation occurrence amount and the initial resource amount as the end-term resource amount of the date corresponding to the resource accumulation occurrence amount.
In one embodiment, the first determination unit is further configured to:
generating a fourth resource report containing the corresponding relation between the first date and the resource accumulation occurrence amount;
performing Cartesian product operation on the fourth resource report and the initial resource amount to obtain a fifth resource report containing the corresponding relation among the first date, the resource accumulation occurrence amount and the initial resource amount;
and adding the resource accumulation occurrence amount and the initial resource amount in the fifth resource report to obtain the final resource amount of the date corresponding to the resource accumulation occurrence amount.
In one embodiment, the apparatus 300 further comprises:
the third calculation module is used for calculating the cumulative resource occurrence amount between the starting date and each fourth date after the third date according to the updated resource daily occurrence amount of the third date if the resource daily occurrence amount of the third date in each date is detected to be updated;
and the first updating module is used for updating the resource surplus report according to the resource accumulated occurrence amount between the starting date and each fourth date.
By adopting the device in one or more embodiments of the present specification, the resource daily occurrence amount of each date in the predetermined time period is acquired, the resource cumulative occurrence amount between the start date and each date in the predetermined time period is calculated by using the resource daily occurrence amount, the end-of-term resource amount of each date is calculated according to the resource cumulative occurrence amount and the initial resource amount of the start date, and finally, the resource surplus report is generated by using the calculated end-of-term resource amount. Therefore, when the resource surplus report is generated, the end-of-term resource amount of each date in the resource surplus report can be calculated only by giving the starting date and the ending date of the preset time period and the resource daily occurrence amount of each date, and the dependency relationship between the end-of-term resource amount of each day and the last-day resource amount is removed, so that the end-of-term resource amount of each day is not required to be waited for being produced when the end-of-term resource amount of each day is calculated, and the production efficiency of the resource surplus report is effectively improved. Moreover, even if the daily occurrence quantity of resources of a certain day is abnormal, the reports do not need to be repaired in sequence every day, and the report repairing efficiency is greatly improved.
It should be understood by those skilled in the art that the above-mentioned processing apparatus for resource change can be used to implement the above-mentioned processing method for resource change, and the detailed description thereof should be similar to the above-mentioned method, and therefore, for avoiding the complexity, it is not repeated herein.
Fig. 4 is a schematic block diagram of a processing apparatus for balance change according to an embodiment of the present disclosure, and as shown in fig. 4, the processing apparatus 400 for balance change includes:
a second obtaining module 410, configured to obtain daily occurrence amounts of dates within a predetermined time period; wherein the daily amount of money refers to the amount of money that changes on the day;
a fourth calculating module 420, configured to calculate, according to the daily occurrence amount, an accumulated occurrence amount from the start date to each date of the predetermined time period; wherein, the accumulated occurrence amount refers to the accumulated value of the amount change between the starting date and each date;
a fifth calculating module 430, configured to calculate end balances of the dates according to the cumulative occurrence amount and the initial balance of the start date; wherein, the initial balance refers to the amount of money before the balance change on the day; the end balance refers to the amount of money after the balance change occurs on the same day;
the second generating module 440 is configured to generate a balance report according to the end balance, where the balance report includes a correspondence between the end balance and each date.
In one embodiment, the second obtaining module 410 includes:
the third acquisition unit is used for acquiring a first amount report, and the first amount report comprises daily occurrence amounts of all dates;
and the second extraction unit is used for extracting daily occurrence amount of each date from the first amount report.
In one embodiment, the fourth calculation module 420 includes:
a fourth acquiring unit, configured to acquire a date report including each date;
the second operation unit is used for carrying out Cartesian product operation on the first amount report and the date report to obtain a second amount report containing the daily amount, the corresponding relation between the first dates and the second dates; wherein each first date is each date in the first amount report, and each second date is each date in the date report;
the second deleting unit is used for deleting the items which do not accord with the preset conditions in the second amount report to obtain a third amount report; the preset conditions comprise that the first date is not later than a corresponding second date;
and the second calculation unit is used for calculating the accumulated occurrence amount from the starting date to each date according to the daily occurrence amount in the third amount report.
In one embodiment, the fifth calculation module 430 includes:
and a second determining unit configured to determine a sum of the cumulative occurrence amount and the initial balance as an end-of-term balance of a date corresponding to the cumulative occurrence amount.
In one embodiment, the second determination unit is further configured to:
generating a fourth amount report including the corresponding relation between the first date and the accumulated amount;
performing Cartesian product operation on the fourth amount report and the beginning balance to obtain a fifth amount report containing the corresponding relation among the first date, the accumulated occurrence amount and the beginning balance;
and adding the accumulated amount of occurrence and the initial balance in the fifth amount report to obtain the final balance of the date corresponding to the accumulated amount of occurrence.
In one embodiment, the apparatus 400 further comprises:
a sixth calculating module, configured to calculate, if it is detected that the daily occurrence amount of the third date in each date is updated, a cumulative occurrence amount between the start date and each fourth date after the third date according to the updated daily occurrence amount of the third date;
and the second updating module is used for updating the balance report according to the accumulated occurrence amount between the starting date and each fourth date.
By adopting the device in one or more embodiments of the present specification, the daily occurrence amount of each date in the predetermined time period is acquired, the cumulative occurrence amount between the start date and each date in the predetermined time period is calculated by using the daily occurrence amount, the end balance of each date is calculated according to the cumulative occurrence amount and the initial balance of the start date, and finally, the balance report is generated by using the calculated end balance. Therefore, when the balance report is generated, the end of term balance of each date in the balance report can be calculated only by giving the starting date and the ending date of the preset time period and the daily occurrence amount of each date, and the dependency relationship between the end of term balance of each day and the end of term balance of the previous day is eliminated, so that the end of term balance output of the previous day does not need to be waited when the end of term balance of each day is calculated, and the output efficiency of the balance report is effectively improved. Moreover, even if the amount of money on a certain day is abnormal, the report does not need to be repaired in sequence every day, and the report repairing efficiency is greatly improved.
It should be understood by those skilled in the art that the processing apparatus for balance change can be used to implement the processing method for balance change described above, wherein the detailed description thereof should be similar to that of the method described above, and therefore, for avoiding the complexity, it is not repeated herein.
Based on the same idea, one or more embodiments of the present specification further provide a resource-changed processing device, as shown in fig. 5. The processing devices with varied resources may have relatively large differences due to different configurations or performances, and may include one or more processors 501 and a memory 502, where the memory 502 may store one or more stored applications or data. Memory 502 may be, among other things, transient storage or persistent storage. The application program stored in memory 502 may include one or more modules (not shown), each of which may include a series of computer-executable instructions in a processing device for a change in resources. Further, the processor 501 may be configured to communicate with the memory 502 to execute a series of computer-executable instructions in the memory 502 on a processing device with varying resources. The resource-changing processing device may also include one or more power supplies 503, one or more wired or wireless network interfaces 504, one or more input-output interfaces 505, and one or more keyboards 506.
In particular, in this embodiment, the processing device with resource change includes a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer-executable instructions for the processing device with resource change, and the one or more programs configured to be executed by the one or more processors include computer-executable instructions for:
acquiring daily resource occurrence quantity of each date in a preset time period; wherein the daily resource amount refers to the amount of resources which change on the same day;
calculating the cumulative resource occurrence amount between the starting date of the preset time period and each date according to the daily resource occurrence amount; wherein, the resource accumulation occurrence amount refers to the accumulation value of the resource change between the starting date and each date;
respectively calculating the end-term resource amount of each date according to the cumulative resource occurrence amount and the initial resource amount of the starting date; wherein the initial resource amount refers to the resource amount before the resource change occurs on the day; the end balance refers to the amount of resources after a resource change occurs on the same day;
and generating a resource surplus report according to the end resource amount, wherein the resource surplus report comprises the corresponding relation between the end resource amount and each date.
Optionally, the computer executable instructions, when executed, may further cause the processor to:
acquiring a first resource report, wherein the first resource report comprises the daily resource occurrence amount of each date;
and extracting the daily resource occurrence amount of each date from the first resource report.
Optionally, the computer executable instructions, when executed, may further cause the processor to:
acquiring a date report containing each date;
performing Cartesian product operation on the first resource report and the date report to obtain a second resource report containing the daily occurrence amount of the resources and the corresponding relation between each first date and each second date; wherein, each first date is each date in the first resource report, and each second date is each date in the date report;
deleting the entries which do not accord with the preset conditions in the second resource report to obtain a third resource report; the preset condition comprises that the first date is not later than a corresponding second date;
and respectively calculating the resource accumulated occurrence amount between the starting date and each date according to the resource daily occurrence amount in the third resource report.
Optionally, the computer executable instructions, when executed, may further cause the processor to:
and determining the sum of the cumulative resource occurrence amount and the initial resource amount as the end-term resource amount of the date corresponding to the cumulative resource occurrence amount.
Optionally, the computer executable instructions, when executed, may further cause the processor to:
generating a fourth resource report containing the corresponding relation between the first date and the resource accumulation occurrence amount;
performing Cartesian product operation on the fourth resource report and the initial resource amount to obtain a fifth resource report containing the corresponding relation among the first date, the resource accumulation occurrence amount and the initial resource amount;
and adding the resource accumulation occurrence amount and the initial resource amount in the fifth resource report to obtain the end-term resource amount of the date corresponding to the resource accumulation occurrence amount.
Optionally, the computer executable instructions, when executed, may further cause the processor to:
if the fact that the resource daily occurrence amount of a third date in the dates is updated is detected, calculating the resource accumulated occurrence amount between the starting date and each fourth date after the third date according to the updated resource daily occurrence amount of the third date;
and updating the resource surplus report according to the accumulated resource occurrence between the starting date and the fourth dates.
One or more embodiments of the present specification also provide a computer-readable storage medium storing one or more programs, the one or more programs including instructions, which when executed by an electronic device including a plurality of application programs, enable the electronic device to perform the above processing method for resource change, and are specifically configured to perform:
acquiring daily resource occurrence quantity of each date in a preset time period; wherein the daily resource amount refers to the amount of resources which change on the same day;
calculating the cumulative resource occurrence amount between the starting date of the preset time period and each date according to the daily resource occurrence amount; wherein, the resource accumulation occurrence amount refers to the accumulation value of the resource change between the starting date and each date;
respectively calculating the end-term resource amount of each date according to the cumulative resource occurrence amount and the initial resource amount of the starting date; wherein the initial resource amount refers to the resource amount before the resource change occurs on the day; the end balance refers to the amount of resources after a resource change occurs on the same day;
and generating a resource surplus report according to the end resource amount, wherein the resource surplus report comprises the corresponding relation between the end resource amount and each date.
Based on the same idea, one or more embodiments of the present specification further provide a device for processing balance change, as shown in fig. 6. The processing device for balance change may have a relatively large difference due to different configurations or performances, and may include one or more processors 601 and a memory 602, where one or more stored applications or data may be stored in the memory 602. Wherein the memory 602 may be transient or persistent storage. The application program stored in memory 602 may include one or more modules (not shown), each of which may include a series of computer-executable instructions in a processing device for balance changes. Still further, processor 601 may be configured to communicate with memory 602 to execute a series of computer-executable instructions in memory 602 on a processing device with a balance change. The processing apparatus of balance changes may also include one or more power supplies 603, one or more wired or wireless network interfaces 604, one or more input-output interfaces 605, one or more keyboards 606.
In particular, in this embodiment, the processing device for balance change includes a memory, and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer-executable instructions for the processing device for balance change, and the one or more programs configured to be executed by the one or more processors include computer-executable instructions for:
acquiring daily occurrence amount of each date in a preset time period; wherein the daily amount of money refers to the amount of money that changes on the day;
calculating the accumulated occurrence amount between the starting date of the preset time period and each date according to the daily occurrence amount; wherein the accumulated occurrence amount refers to an accumulated value of amount change occurring between the starting date and each date;
respectively calculating the end balance of each date according to the accumulated occurrence amount and the initial balance of the starting date; wherein the initial balance refers to the amount of money before the balance change on the day; the end balance refers to the amount of money after a balance change occurs on the same day;
and generating a balance report according to the end balance, wherein the balance report comprises the corresponding relation between the end balance and each date.
Optionally, the computer executable instructions, when executed, may further cause the processor to:
acquiring a first amount report, wherein the first amount report comprises daily occurrence amounts of all dates;
and extracting the daily occurrence amount of each date from the first amount report.
Optionally, the computer executable instructions, when executed, may further cause the processor to:
acquiring a date report containing each date;
carrying out Cartesian product operation on the first amount report and the date report to obtain a second amount report containing the daily amount, the corresponding relation between each first date and each second date; wherein each first date is each date in the first amount report, and each second date is each date in the date report;
deleting the items which do not accord with the preset conditions in the second amount report to obtain a third amount report; the preset condition comprises that the first date is not later than a corresponding second date;
and respectively calculating the accumulated occurrence amount between the starting date and each date according to the daily occurrence amount in the third amount report.
Optionally, the computer executable instructions, when executed, may further cause the processor to:
and determining the sum of the accumulated occurrence amount and the initial balance as the end balance of the date corresponding to the accumulated occurrence amount.
Optionally, the computer executable instructions, when executed, may further cause the processor to:
generating a fourth amount report including a corresponding relationship between the first date and the accumulated amount;
performing Cartesian product operation on the fourth amount report and the initial balance to obtain a fifth amount report containing the corresponding relation among the first date, the accumulated occurrence amount and the initial balance;
and adding the accumulated amount of occurrence and the initial balance in the fifth amount report to obtain the final balance of the date corresponding to the accumulated amount of occurrence.
Optionally, the computer executable instructions, when executed, may further cause the processor to:
if the fact that the daily occurrence amount of the third date in the dates is updated is detected, calculating the accumulated occurrence amount from the starting date to the fourth dates after the third date according to the updated daily occurrence amount of the third date;
and updating the balance report according to the accumulated occurrence amount between the starting date and the fourth dates.
One or more embodiments of the present specification also provide a computer-readable storage medium storing one or more programs, the one or more programs including instructions, which when executed by an electronic device including a plurality of application programs, enable the electronic device to perform the above processing method for resource change, and are specifically configured to perform:
acquiring daily occurrence amount of each date in a preset time period; wherein the daily amount of money refers to the amount of money that changes on the day;
calculating the accumulated occurrence amount between the starting date of the preset time period and each date according to the daily occurrence amount; wherein the accumulated occurrence amount refers to an accumulated value of amount change occurring between the starting date and each date;
respectively calculating the end balance of each date according to the accumulated occurrence amount and the beginning balance of the starting date; wherein the initial balance refers to the amount of money before the balance change on the day; the end balance refers to the amount of money after a balance change occurs on the same day;
and generating a balance report according to the end balance, wherein the balance report comprises the corresponding relation between the end balance and each date.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, 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 divided into various units by function, and are described separately. Of course, the functionality of the various elements may be implemented in the same one or more software and/or hardware implementations in implementing one or more embodiments of the present description.
One skilled in the art will recognize that one or more embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, one or more embodiments of the present description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, one or more embodiments of the present description 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 so forth) having computer-usable program code embodied therein.
One or more embodiments of the present specification are 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 a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
One or more embodiments of the present description 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.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only one or more embodiments of the present disclosure, and is not intended to limit the present disclosure. Various modifications and alterations to one or more embodiments described herein will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of one or more embodiments of the present specification should be included in the scope of claims of one or more embodiments of the present specification.