CN107341243A - Billing cycle generation method and system based on section tree finding algorithm - Google Patents
Billing cycle generation method and system based on section tree finding algorithm Download PDFInfo
- Publication number
- CN107341243A CN107341243A CN201710546909.0A CN201710546909A CN107341243A CN 107341243 A CN107341243 A CN 107341243A CN 201710546909 A CN201710546909 A CN 201710546909A CN 107341243 A CN107341243 A CN 107341243A
- Authority
- CN
- China
- Prior art keywords
- section
- billing cycle
- clearing
- tree
- deadline
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
- G06F16/2228—Indexing structures
- G06F16/2246—Trees, e.g. B+trees
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2458—Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
- G06F16/2477—Temporal data queries
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q10/00—Administration; Management
- G06Q10/10—Office automation; Time management
- G06Q10/109—Time management, e.g. calendars, reminders, meetings or time accounting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q40/00—Finance; Insurance; Tax strategies; Processing of corporate or income taxes
- G06Q40/12—Accounting
- G06Q40/125—Finance or payroll
Landscapes
- Engineering & Computer Science (AREA)
- Business, Economics & Management (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Finance (AREA)
- Human Resources & Organizations (AREA)
- Data Mining & Analysis (AREA)
- Strategic Management (AREA)
- Accounting & Taxation (AREA)
- Economics (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Marketing (AREA)
- Databases & Information Systems (AREA)
- Entrepreneurship & Innovation (AREA)
- General Business, Economics & Management (AREA)
- Operations Research (AREA)
- Technology Law (AREA)
- Development Economics (AREA)
- Quality & Reliability (AREA)
- Tourism & Hospitality (AREA)
- Fuzzy Systems (AREA)
- Mathematical Physics (AREA)
- Probability & Statistics with Applications (AREA)
- Computational Linguistics (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The invention discloses a kind of billing cycle generation method and system based on section tree finding algorithm, wherein method includes:S1, clearing configuration data is received, clearing configuration data includes clearing section, account day, and clearing section includes starting date, deadline, and starting date is no earlier than deadline earlier than deadline, account day;S2, the root node that configuration data generation billing cycle Interval Tree will be settled accounts, root node includes Node color, found key value, section lvalue, section r value, section return value, the Node color of root node is black, find key value in clearing section, section lvalue is starting date, section r value is deadline, and section return value is the account day;S3, using root node generate billing cycle Interval Tree, billing cycle Interval Tree is Interval Tree, and billing cycle Interval Tree includes some nodes.The present invention only needs easy configuration clearing section and account day, just can simply, intuitively, fast obtain billing cycle of interest and Settlement Date.
Description
Technical field
The present invention relates to financial settlement field, more particularly to a kind of billing cycle generation side based on section tree finding algorithm
Method and system.
Background technology
At present, typically need to carry out related clearing to evade wind according to the qualification situation of different suppliers in financial settlement
Danger, such as clearing require general and have by week knot, by monthly closing entry, per year tie, or even also require in one week repeatedly clearing, knot more in January
Calculate, the situation such as more clearing in 1 year, at this moment just need billing cycle and Settlement Date neatly to customize configuration, so as to
Settlement clerk is allowed simply, intuitively, fast to obtain billing cycle of interest and Settlement Date.
Interval Tree is operation of the support for extending to obtain based on RBTree using section as the dynamic set of element, and Interval Tree is left
The node interval of side is both less than the section of its father node, the node interval on right side is both greater than the section of its father node, in addition section
Tree finding algorithm is typically begun stepping through from root node, and the lookup and insertion of interval element can be in time complexity O (lgn) institutes
Completed in the time of expression, n is Interval Tree nodes.Therefore, Interval Tree is highly suitable for such as billing cycle, the clearing time
Flexible configuration and lookup.
The content of the invention
The technical problem to be solved in the present invention is can not neatly to customize configuration clearing week in the prior art to overcome
Phase and the defects of be not easy to search billing cycle, there is provided a kind of billing cycle generation method based on section tree finding algorithm and
System.
The present invention is that solve above-mentioned technical problem by following technical proposals:
A kind of billing cycle generation method based on section tree finding algorithm, the described method comprises the following steps:
S1, clearing configuration data is received, the clearing configuration data includes clearing section, account day, the clearing section
Including starting date, deadline, the starting date is no earlier than the deadline earlier than the deadline, the account day;
S2, the root node by the clearing configuration data generation billing cycle Interval Tree, the root node include node face
Color, find key value, section lvalue, section r value, section return value, the Node color is black, described to find key value in institute
State in clearing section, the section lvalue is the starting date, and the section r value is the deadline, the section return value
For the account day;
S3, generate the billing cycle Interval Tree using the root node, the billing cycle Interval Tree is Interval Tree, institute
Stating billing cycle Interval Tree includes some nodes.
It is preferred that the span in the clearing section can arbitrary disposition.
It is preferred that the span in the clearing section can be configured to a week, one month or 1 year.
A kind of billing cycle generation system based on section tree finding algorithm, the system include receiving module, root node
Generation module, Interval Tree generation module,
The receiving module is used to receive clearing configuration data, and the clearing configuration data includes clearing section, account day,
The clearing section includes starting date, deadline, and for the starting date earlier than the deadline, the account day is no earlier than described cut
Only day;
The root node generation module is used for the root node of the clearing configuration data generation billing cycle Interval Tree, institute
Stating root node includes Node color, finds key value, section lvalue, section r value, section return value, and the Node color is black
Color, described to find key value in the clearing section, the section lvalue is the starting date, and the section r value cuts to be described
Only day, the section return value are the account day;
The Interval Tree generation module is used to generate the billing cycle Interval Tree, the clearing week using the root node
Phase Interval Tree is Interval Tree, and the billing cycle Interval Tree includes some nodes.
It is preferred that the span in the clearing section can arbitrary disposition.
It is preferred that the span in the clearing section can be configured to a week, one month or 1 year.
The positive effect of the present invention is:Billing cycle generation provided by the invention based on section tree finding algorithm
Settlement clerk's easy configuration clearing section and account day are only needed in method and system, wherein methods described, by methods described with regard to energy
Automatically billing cycle Interval Tree is set up, so as to be based on section tree finding algorithm, settlement clerk just can simply, intuitively, fast obtain
Obtain billing cycle of interest and Settlement Date.
Brief description of the drawings
Fig. 1 is the flow chart of the billing cycle generation method based on section tree finding algorithm of embodiments of the invention 1.
Fig. 2 is four days knots of the billing cycle generation method based on section tree finding algorithm of embodiments of the invention 1
Billing cycle Interval Tree schematic diagram.
Fig. 3 is the Monday knot of the billing cycle generation method based on section tree finding algorithm of embodiments of the invention 2
Billing cycle Interval Tree schematic diagram.
Fig. 4 is the knot in January one of the billing cycle generation method based on section tree finding algorithm of embodiments of the invention 2
Billing cycle Interval Tree schematic diagram.
Fig. 5 is 1 year knot of the billing cycle generation method based on section tree finding algorithm of embodiments of the invention 2
Billing cycle Interval Tree schematic diagram.
Fig. 6 is one week two knot of the billing cycle generation method based on section tree finding algorithm of embodiments of the invention 3
Billing cycle Interval Tree schematic diagram.
Fig. 7 is that the billing cycle based on section tree finding algorithm of embodiments of the invention 4 generates the schematic diagram of system.
Embodiment
The present invention is further illustrated below by the mode of embodiment, but does not therefore limit the present invention to described reality
Apply among a scope.
Embodiment 1
As shown in figure 1, the billing cycle generation method based on section tree finding algorithm that the present embodiment provides, methods described
Comprise the following steps:
101st, clearing configuration data is received, the clearing configuration data includes clearing section, account day, the clearing section
Including starting date, deadline, the starting date is no earlier than the deadline earlier than the deadline, the account day;
102nd, the root node of the clearing configuration data generation billing cycle Interval Tree, the root node are included into node face
Color, find key value, section lvalue, section r value, section return value, the Node color is black, described to find key value in institute
State in clearing section, the section lvalue is the starting date, and the section r value is the deadline, the section return value
For the account day;
103rd, the billing cycle Interval Tree being generated using the root node, the billing cycle Interval Tree is Interval Tree,
The billing cycle Interval Tree includes some nodes.
Wherein, each node of billing cycle Interval Tree include Node color, find key value, section lvalue, section it is right
Value and section return value, the Node color are red or black, are specially that red or black should meet Interval Tree characteristic, institute
State to find key value and typically may be configured as section lvalue more simply, intuitively.
Further, the span in the clearing section can arbitrary disposition.
The present embodiment is in specific implementation, such as shown in Fig. 2 the clearing section is arranged to four days one settle accounts,
Then it is by above-mentioned steps 101-103 that settlement clerk is of interest from this period on June 22,28 days to 2017 May in 2017
The clearing section of interior clearing in every four days one and its account day set up the billing cycle Interval Tree automatically, at this moment just can be very simple
List, intuitively, fast obtain each billing cycle and its Settlement Date.For improve the formation speed of the billing cycle Interval Tree and
Search efficiency, the billing cycle Interval Tree can be deposited in caching.In addition, being based on the billing cycle Interval Tree, lead to
Section tree finding algorithm is crossed, settlement clerk just can simply, intuitively, fast find billing cycle of interest and Settlement Date,
For example wonder clearing section and its account day corresponding to 20 days June in 2017, just can be quick according to section tree finding algorithm
It is 20170619-20170622 and the account day is 20170623 that ground, which finds clearing section,.For another example, in July, 2017 is wondered
Billing cycle and its Settlement Date corresponding to 10 days, it is in June, 2017 because the billing cycle Interval Tree only has deadline
The clearing section of 22 days and its account day, the billing cycle configuration corresponding to is at this moment needed, extrapolate required query time 2017
Billing cycle corresponding on July 10, is 20170709-20170712, the account day 20170713.Because the billing cycle is to face
When search, billing cycle Interval Tree will not be configured to, be not also put into caching so as to saving build time and caching.
Embodiment 2
Being looked into based on Interval Tree based on the billing cycle generation method of section tree finding algorithm and embodiment 1 of the present embodiment
Look for that the billing cycle generation method of algorithm is essentially identical, and difference is, the span in the clearing section can be configured to a star
Phase, one month or 1 year.Wherein, span can need not define from the daystart in cycle since centre, only need to meet one
The time in individual cycle, but in order to easy-to-understand, typically be set to tie from daystart to the cycle by span in the present embodiment
Shu.Billing cycle Interval Tree as shown in Figure 3 just for a Monday tie, here only by it is of interest from May 22nd, 2017 extremely
Clearing section and its account day the step 101-103 as described in embodiment 1 lifes in each week in this period on June 25th, 2017
Into corresponding billing cycle Interval Tree;Billing cycle Interval Tree as shown in Figure 4 is just a month knot, will only be closed here
Note from the clearing section of every month and its account day in December, 2016 to this period in June, 2017 as described in embodiment 1
Step 101-103 generates corresponding billing cycle Interval Tree;Billing cycle Interval Tree as shown in Figure 5 is just 1 year knot,
Here only walked of interest from 2016 to 2018 this annual clearing section of 3 years and its account day as described in embodiment 1
Rapid 101-103 generates corresponding billing cycle Interval Tree.In addition, wonder when corresponding clearing section and its clearing
Day, for example be between all interfaces for belonging to which week and its account day or the monthly closing entry section and its account day that belong to which moon, or belong to
Year when is between interface and its account day, lookup method and its process description are identical with the corresponding content in embodiment 1, herein
It is not repeated.
Embodiment 3
The billing cycle generation method based on section tree finding algorithm of the present embodiment is the situation of one week two knot.This implementation
The clearing section is configured to one week in example, and it is interior at one week settled accounts twice, so the present embodiment still with the base of embodiment 1
This is identical, and difference is, because one week is seven days, if being settled accounts twice in one week, can obtain two new knots
Section is calculated, for example as shown in Figure 6, two kinds of new clearing sections as first four days and latter three days will be divided into one week seven days,
Certainly new clearing section can also have other different point-scores, not reinflated narration here.At this moment, by of interest from 2017
First four days of each week and the new clearing area formed respectively for latter three days in this period June 21 29 days to 2017 May
Between generate corresponding billing cycle Interval Tree.In addition, for wondering when which week corresponding clearing section belongs on earth
First four days or after three days and its account day, lookup method and its process description it is identical with the corresponding content in embodiment 1,
It is not repeated herein.
Certainly, the situation repeatedly settled accounts in other billing cycle can voluntarily be analogized, and be not repeated herein.
Embodiment 4
As shown in fig. 7, the generation system of the billing cycle based on section tree finding algorithm that the present embodiment provides, the system
Including receiving module 1, root node generation module 2, Interval Tree generation module 3,
The receiving module 1 is used to receive clearing configuration data, and the clearing configuration data includes clearing section, clearing
Day, the clearing section includes starting date, deadline, and the starting date is no earlier than institute earlier than the deadline, the account day
State deadline;
The root node generation module 2 is used for the root node of the clearing configuration data generation billing cycle Interval Tree,
The billing cycle Interval Tree is Interval Tree, the root node include Node color, find key value, section lvalue, section r value,
Section return value, the Node color are black, and described to find key value in the clearing section, the section lvalue is described
Starting date, the section r value are the deadline, and the section return value is the account day;
The Interval Tree generation module 3 is used to generate the billing cycle Interval Tree, the clearing using the root node
Cycle Interval Tree includes some nodes.
Further, the span in the clearing section can arbitrary disposition.
Further, the span in the clearing section can be configured to a week, one month or 1 year.
Although the embodiment of the present invention is the foregoing described, it will be appreciated by those of skill in the art that this is only
For example, protection scope of the present invention is to be defined by the appended claims.Those skilled in the art without departing substantially from
On the premise of the principle and essence of the present invention, various changes or modifications can be made to these embodiments, but these changes and
Modification each falls within protection scope of the present invention.
Claims (6)
1. a kind of billing cycle generation method based on section tree finding algorithm, it is characterised in that methods described includes following step
Suddenly:
S1, clearing configuration data is received, the clearing configuration data includes clearing section, account day, and the clearing section includes
Starting date, deadline, the starting date are no earlier than the deadline earlier than the deadline, the account day;
S2, the root node by the clearing configuration data generation billing cycle Interval Tree, the root node include Node color, looked into
Key assignments, section lvalue, section r value, section return value are looked for, the Node color is black, described to find key value in the clearing
In section, the section lvalue is the starting date, and the section r value is the deadline, and the section return value is described
Account day;
S3, generate the billing cycle Interval Tree using the root node, the billing cycle Interval Tree is Interval Tree, the knot
Calculating cycle Interval Tree includes some nodes.
2. the billing cycle generation method based on section tree finding algorithm as claimed in claim 1, it is characterised in that the knot
The span for calculating section can arbitrary disposition.
3. the billing cycle generation method based on section tree finding algorithm as claimed in claim 2, it is characterised in that the knot
The span for calculating section can be configured to a week, one month or 1 year.
4. a kind of billing cycle generation system based on section tree finding algorithm, it is characterised in that the system includes receiving mould
Block, root node generation module, Interval Tree generation module,
The receiving module is used to receive clearing configuration data, and the clearing configuration data includes clearing section, account day, described
Settling accounts section includes starting date, deadline, and the starting date is no earlier than the cut-off earlier than the deadline, the account day
Day;
Root node of the root node generation module for the clearing configuration data to be generated to billing cycle Interval Tree, described
Node includes Node color, found key value, section lvalue, section r value, section return value, and the Node color is black, institute
To state and find key value in the clearing section, the section lvalue is the starting date, and the section r value is the deadline,
The section return value is the account day;
The Interval Tree generation module is used to generate the billing cycle Interval Tree, the billing cycle area using the root node
Between tree be Interval Tree, the billing cycle Interval Tree includes some nodes.
5. the billing cycle generation system based on section tree finding algorithm as claimed in claim 4, it is characterised in that the knot
The span for calculating section can arbitrary disposition.
6. the billing cycle generation system based on section tree finding algorithm as claimed in claim 5, it is characterised in that the knot
The span for calculating section can be configured to a week, one month or 1 year.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710546909.0A CN107341243A (en) | 2017-07-06 | 2017-07-06 | Billing cycle generation method and system based on section tree finding algorithm |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710546909.0A CN107341243A (en) | 2017-07-06 | 2017-07-06 | Billing cycle generation method and system based on section tree finding algorithm |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107341243A true CN107341243A (en) | 2017-11-10 |
Family
ID=60218883
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710546909.0A Pending CN107341243A (en) | 2017-07-06 | 2017-07-06 | Billing cycle generation method and system based on section tree finding algorithm |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107341243A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111078689A (en) * | 2019-11-20 | 2020-04-28 | 深圳希施玛数据科技有限公司 | Data processing method and system of discontinuous pre-sorting traversal tree algorithm |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103856462A (en) * | 2012-12-05 | 2014-06-11 | 深圳市快播科技有限公司 | Method and system for managing sessions |
CN105159915A (en) * | 2015-07-16 | 2015-12-16 | 中国科学院计算技术研究所 | Dynamically adaptive LSM (Log-structured merge) tree combination method and system |
CN105653367A (en) * | 2015-12-24 | 2016-06-08 | 北京奇虎科技有限公司 | Method and device for traversing timer |
CN105808155A (en) * | 2014-12-31 | 2016-07-27 | 北京神州云科数据技术有限公司 | Double-controller-based read-write locking method and device |
CN106484878A (en) * | 2016-10-12 | 2017-03-08 | 南京航空航天大学 | Efficient method of counting based on Interval Tree |
-
2017
- 2017-07-06 CN CN201710546909.0A patent/CN107341243A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103856462A (en) * | 2012-12-05 | 2014-06-11 | 深圳市快播科技有限公司 | Method and system for managing sessions |
CN105808155A (en) * | 2014-12-31 | 2016-07-27 | 北京神州云科数据技术有限公司 | Double-controller-based read-write locking method and device |
CN105159915A (en) * | 2015-07-16 | 2015-12-16 | 中国科学院计算技术研究所 | Dynamically adaptive LSM (Log-structured merge) tree combination method and system |
CN105653367A (en) * | 2015-12-24 | 2016-06-08 | 北京奇虎科技有限公司 | Method and device for traversing timer |
CN106484878A (en) * | 2016-10-12 | 2017-03-08 | 南京航空航天大学 | Efficient method of counting based on Interval Tree |
Non-Patent Citations (1)
Title |
---|
徐懿彬 等: "一种新型有序数据结构:容量平衡三又查找树", 《HTTP://WWW.CNKI.NET/KCMS/DETAIL/11.2127.TP.20160302.1655.034.HTM1》 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111078689A (en) * | 2019-11-20 | 2020-04-28 | 深圳希施玛数据科技有限公司 | Data processing method and system of discontinuous pre-sorting traversal tree algorithm |
CN111078689B (en) * | 2019-11-20 | 2023-05-26 | 深圳希施玛数据科技有限公司 | Data processing method and system of discontinuous pre-ordering traversal tree algorithm |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104408132B (en) | Data push method and system | |
RU2011116176A (en) | ATOMIC MULTIPLE DATA MODIFICATION IN A DISTRIBUTED DATA STORAGE SYSTEM | |
CN104298687B (en) | A kind of hash partition management method and device | |
CN109087035A (en) | Engineering construction plan creating method and system and electronic equipment | |
CN107832916B (en) | Identification method for critical risk factors and critical risk transmission path of cascade hydropower station based on Bayesian risk network | |
CN111026567B (en) | Handle identification coding system and method based on block chain | |
CN107145556A (en) | General distributed parallel computing environment | |
CN106202236A (en) | A kind of customer location Forecasting Methodology and device | |
CN106227862A (en) | E-commerce data integration method based on distribution | |
CN109492115A (en) | A kind of Automobile Service knowledge physical network construction method, device and equipment | |
CN107491563A (en) | Towards the data processing method and system of settlement for account | |
CN107145499A (en) | The method and apparatus filed for ahead daily record | |
CN107341243A (en) | Billing cycle generation method and system based on section tree finding algorithm | |
CN105787090A (en) | Index building method and system of OLAP system of electric data | |
CN110134646B (en) | Knowledge platform service data storage and integration method and system | |
CN104036039A (en) | Parallel processing method and system of data | |
CN102436501A (en) | Parallel file managing system based on web | |
CN106786533B (en) | The acquisition methods and device of electric dispatching plan data | |
CN106250501A (en) | Report processing method and reporting system | |
Rosenberg | Adapt Lake Mead releases to inflow to give managers more flexibility to slow reservoir drawdown | |
CN104636397A (en) | Resource allocation method, computation speedup method and device for distributed computation | |
CN102891760B (en) | Tunnel protection configuration method and system in a kind of network management system | |
CN105095478B (en) | The method and device of the creation time of file in a kind of acquisition distributed file system | |
CN102497410A (en) | Method for dynamically partitioning computing resources of cloud computing system | |
CN106201784A (en) | A kind of data back up method based on git and system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20171110 |