Summary of the invention
Technical problem to be solved by this invention provides a kind of real-time charging method, mainly charges and the low excessively technical problem of search efficiency in order to solve in the prior art, can also further adapt to the application scenarios that the user exists the multiple domain name to quicken.
Another object of the present invention is that above-mentioned design is applied to provide a kind of Real-time Billing System in the concrete applied environment, thereby guarantees the realization and the application of this method.
For solving the problems of the technologies described above, the embodiment of the invention provides a kind of Real-time Billing System, comprising:
Obtain the data file module, be used to obtain the data file of each node;
Generate the ephemeral data module, be used for directly being saved to volatile data base after data file with described each node gathers;
Multilevel summarizing module is used for the data file of volatile data base is carried out multistage gathering, to be met the data record that presets the bar number and to be saved in the Query Database;
The inquiry accounting module is used for obtaining corresponding data record and chargeing from described data query according to time period information.
Preferably, the described data file module of obtaining specifically comprises:
Analyze the daily record submodule, be used on each node charging daily record and analyze this node;
Generate the data file submodule, be used for deleting the redundant data of described charging daily record, to generate the data file of each node.
Preferably, described multilevel summarizing module specifically comprises:
Generate the data submodule, be used for described data file is converted to data of the periodic generation of every domain name;
Merge submodule, be used for merging many data of described generation at each domain name;
Gather submodule, be used for described many data are gathered according to channel and temporal information, to reduce the data volume in the database.
Preferably, described inquiry accounting module specifically comprises:
Obtain the band data submodule, be used for obtaining the band data of the identical domain name of type of service according to time period information;
The charging submodule is used for adopting the charging algorithm that presets to charge at the described band data that gets access to.
Preferably, also comprise:
Generate charging bill module, be used to generate the charging bill of meeting consumers' demand.
Compared with prior art, the present invention has the following advantages:
In the present embodiment, what at first get access to is the data file of each node, simultaneously database can be divided into two of volatile data base and Query Databases, inquires about obtaining target data and charge then from Query Database according to the time period information that needs to charge.The embodiment of the invention adopts single domain name data to gather, and the mode that gathers of multiple domain name data, and, database also adopts the multistage mode that gathers, and can design special band data query interface,, improve charging efficiency to reduce the coupling between displaying and the charging.Further, can also adapt to the application scenarios that multi-user's multiple domain name is quickened.
Embodiment
For above-mentioned purpose of the present invention, feature and advantage can be become apparent more, the present invention is further detailed explanation below in conjunction with the drawings and specific embodiments.
The present invention can be used in numerous general or special purpose computingasystem environment or the configuration.For example: personal computer, server computer, handheld device or portable set, plate equipment, multicomputer system, comprise distributed computing environment (DCE) of above any system or equipment or the like.
The present invention can describe in the general context of the computer executable instructions of being carried out by computer, for example program module.Usually, program module comprises the routine carrying out particular task or realize particular abstract, program, object, assembly, data structure or the like.Also can in distributed computing environment (DCE), put into practice the present invention, in these distributed computing environment (DCE), by by communication network connected teleprocessing equipment execute the task.In distributed computing environment (DCE), program module can be arranged in the local and remote computer-readable storage medium that comprises memory device.
With reference to figure 1, show the flow chart of a kind of real-time charging method embodiment 1 of the present invention, can may further comprise the steps:
Step 101: the data file of obtaining each node.
In the present embodiment, can adopt distributed charge information account form, promptly on each node, just the charging daily record of this node is analyzed one time earlier, remove redundant data and just can generate data file, so that subsequent transmission is saved to database again to the center, adopt this mode can reduce the interim redundant data amount of database, and can alleviate the expense that the data volatile data base calculates.
Step 102: directly be saved to volatile data base after the data file of described each node gathered.
In embodiments of the present invention, aspect database, carry out classification, adopted a volatile data base and a formal Query Database to realize.Volatile data base mainly is that the data after each node gathers are directly put in storage, do not merge between the multinode, purpose is to accelerate storage, puts the operation of only inserting (insert) data manipulation and not upgrading (update) and deletion (delete) in storage.Though do not had redundant data in the single node, between the multinode and the data after the time-delay redundancy may appear, so the data that volatile data base is preserved still have redundancy, but redundancy can significantly reduce after gathering through the node in this step.
Step 103: the data file in the volatile data base is carried out multistage gathering, to be met the data record that presets the bar number and to be saved in the Query Database.
Need to prove, at each and the data file of node is saved to after the volatile data base, can adopt the mode of " multistage gathering ", at first remove redundancy by temporary table by storing process, become every domain name, per 5 minutes data, the first order gathers the mode that merges (merge) that adopts, because each node data has sequencing in time, therefore can not disposablely all calculate final data, repetitious union operation must be carried out, after certain hour, final data will be become.And secondary to gather mainly be that data at not changing are again done, for example, suppose that the data on flows after the week will no longer change, gather so then and can carry out at the data before the week.Be met the data record that presets the bar number after gathering and be saved in the Query Database, use for the foreground user inquiring.Need to prove that after gathering, the record strip number of data can tail off a lot, so just improved the user obtains data record from Query Database efficient.
Step 104: from described data query, obtain corresponding data record and charge according to time period information.
Time period information according to user's setting, for example one month, from Query Database, get access to corresponding data record, inquire after the band data of one group of professional same domain name, calculated over 30 days by one month, one total 288*30=8640 sampling point then can adopt various charging ways to charge according to data record of multi-sample point so.For example, 95 bandwidth charging methods, N peak value charging method, N method or the like hourly when busy.
In different embodiment, after step 104, the present invention can also comprise:
Step 105: generate the charging bill of meeting consumers' demand.
Metering data is generated the charging bill according to user's request again, can check more easily for the user.As can be seen, in the present embodiment, adopt single domain name data to gather, and the mode that gathers of multiple domain name data, and database also adopts the multistage mode that gathers, and can design special band data query interface, to reduce the coupling between displaying and the charging, improved charging efficiency.Further, can also adapt to the application scenarios that multi-user's multiple domain name is quickened.
With reference to figure 2, show the flow chart of a kind of real-time charging method embodiment 2 of the present invention, present embodiment can may further comprise the steps:
Step 201: the charging daily record to this node on each node is analyzed.
This step promptly is all at first to analyze the charging daily record of this node at each node, to obtain the preliminary charging daily record of having analyzed.
Step 202: delete the redundant data in the described charging daily record, to generate the data file of each node.
Delete the redundant data in the charging daily record simultaneously, all removed redundant data file at each node.
Step 203: directly be saved to volatile data base after the data file of described each node gathered.
Obtain to gather and to be saved in the volatile data base after the data file of each node.
Step 204: described data file is converted to data of the periodic generation of every domain name.
In this step, need merge according to the data file of domain name, such as data of generation in per five minutes with each node.
Step 205: many data that merge described generation at each domain name.
Many data that generate are merged according to domain name, promptly are that the data record of each domain name all is merged together.
Step 206: described many data are gathered according to channel and temporal information, to reduce the data volume in the database.
This step can be thought the process that secondary gathers, it mainly is the method that has adopted capable commentaries on classics row " increasing the dimension decrement ", the band data of promptly original each channel be 5 minutes one, so one day 288, increase the columns of table so now, so that the flow bandwidth data of 288 records are aggregated on the record.
Step 207: the satisfied data record that presets the bar number after will gathering is saved in the Query Database.
After carrying out the gathering of step 205, the bar number of data record will significantly reduce, and for example, originally 3 months data may be 10,000,000,000, and data volume will be reduced to several ten million bars after gathering so now, satisfy to preset the bar number when gathering.Though this mode of present embodiment has increased the time complexity that gathers, the conceptual data table amount of database can reduce greatly.Add the foundation of suitable subregion and index, can so that the subsequent query data record will be just very fast, so corresponding charging efficiency is also just very high.
Calculate after the band data storehouse that is used to charge, can be stored in the Query Database, the data in follow-up this Query Database can be used as the foundation of the bill of chargeing out.Simultaneously all right design data query interface is showed on Web so and the charging bill can obtain data by calling this interface.
Step 208: the band data of obtaining the identical domain name of type of service according to time period information.
Though calculated the real-time bandwidth data of single domain name, a user quickens one group of domain name often in the practical application, therefore can merge charging.Can provide a type of service to each domain name, as long as meet the domain name of identical services type, just can merge charging, be consistent because identical business means cost.For example, when monthly chargeing, by real-time bandwidth data query interface, the band data of one group of professional same domain name can be found out, one month by calculation in 30 days, the data of a total 288*30=8640 sampling point.
Step 209: adopt the charging algorithm that presets to charge at the described band data that gets access to.
At accessed band data, just can adopt the charging algorithm that presets to charge so.For example: throw some charging method, promptly arrange bandwidth value from big to small, the maximum bandwidth value after some points of skimming is as bandwidth last month.95 bandwidth charging methods are promptly arranged bandwidth value from big to small, remove after 5% the bandwidth value as bandwidth last month, are equivalent to throw the some charging method of (8640*5%) individual point of skimming of chargeing.95 bandwidth charging methods are modal a kind of charging methods.N peak value charging method is found out a peak-peak every day, one month 30, use N peak value as bandwidth last month so from big to small, common the 4th peak value charges.N method hourly when busy is promptly calculated the peak value of the minimum that occurs in one group of N continuous hour, so should the middle of the month this value of maximum as the bandwidth value of this month.
The method of various chargings all can also be embodied as different accounting modules in actual applications, call the real-time bandwidth query interface and find after one month the charging band data, just can call different accounting modules and calculate " charging bandwidth ".Simultaneously can calculate one group of " charging bandwidth " value with various method simultaneously on the backstage, a plurality of results come out to facilitate afterwards the difference between the more different algorithms simultaneously, so that follow-uply be carried out to this analysis and marketing decision-making analysis or the like.
Need to prove, for aforesaid each method embodiment, for simple description, so it all is expressed as a series of combination of actions, but those skilled in the art should know, the present invention is not subjected to the restriction of described sequence of movement, because according to the present invention, some step can adopt other orders or carry out simultaneously.Secondly, those skilled in the art also should know, the embodiment described in the specification all belongs to preferred embodiment, and related action and module might not be that the present invention is necessary.
With reference to figure 3, show the structured flowchart of a kind of Real-time Billing System embodiment 1 of the present invention, can comprise with lower module:
Obtain data file module 301, be used to obtain the data file of each node.
Generate ephemeral data module 302, be used for directly being saved to volatile data base after data file with described each node gathers.
Multilevel summarizing module 303 is used for the data file of volatile data base is carried out multistage gathering, to be met the data record that presets the bar number and to be saved in the Query Database.
Inquiry accounting module 304 is used for obtaining corresponding data record and chargeing from described data query according to time period information.
Generate charging bill module 305, be used to generate the charging bill of meeting consumers' demand.
In the present embodiment, aspect database, carry out classification, adopted a volatile data base and a formal Query Database to realize.Volatile data base mainly is that the data after each node gathers are directly put in storage, does not merge between the multinode, and purpose is to accelerate storage.Adopt simultaneously single domain name data to gather in the present embodiment, and the mode that gathers of multiple domain name data, and, database also adopts the multistage mode that gathers, and can design special band data query interface,, improve charging efficiency to reduce the coupling between displaying and the charging.Further, can also adapt to the application scenarios that multi-user's multiple domain name is quickened.
With reference to figure 4, show the structured flowchart of a kind of Real-time Billing System embodiment 2 of the present invention, can comprise with lower module:
Analyze daily record submodule 401, be used on each node charging daily record and analyze this node.
Generate data file submodule 402, be used for deleting the redundant data of described charging daily record, to generate the data file of each node.
Generate ephemeral data module 302, be used for directly being saved to volatile data base after data file with described each node gathers.
Generate data submodule 403, be used for described data file is converted to data of the periodic generation of every domain name.
Merge submodule 404, be used for merging many data of described generation at each domain name.
Gather submodule 405, be used for described many data are gathered according to channel and temporal information, to reduce the data volume in the database.
Obtain band data submodule 406, be used for obtaining the band data of the identical domain name of type of service according to time period information.
Charging submodule 407 is used for adopting the charging algorithm that presets to charge at the described band data that gets access to.
Need to prove that each embodiment in this specification all adopts the mode of going forward one by one to describe, what each embodiment stressed all is and the difference of other embodiment that identical similar part is mutually referring to getting final product between each embodiment.For system class embodiment, because it is similar substantially to method embodiment, so description is fairly simple, relevant part gets final product referring to the part explanation of method embodiment.
Need to prove, term " comprises ", " comprising " or its any other variant are intended to contain comprising of nonexcludability, thereby make and comprise that process, method, article or the equipment of a series of key elements not only comprise those key elements, but also comprise other key elements of clearly not listing, or also be included as this process, method, article or equipment intrinsic key element.Do not having under the situation of more restrictions, the key element that limits by statement " comprising ... ", and be not precluded within process, method, article or the equipment that comprises described key element and also have other identical element.
More than a kind of real-time charging method provided by the present invention and Real-time Billing System are described in detail, used specific case herein principle of the present invention and execution mode are set forth, the explanation of above embodiment just is used for helping to understand method of the present invention and core concept thereof; Simultaneously, for one of ordinary skill in the art, according to thought of the present invention, the part that all can change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention.