CN105574060A - Lottery statistic data extraction method - Google Patents

Lottery statistic data extraction method Download PDF

Info

Publication number
CN105574060A
CN105574060A CN201510015471.4A CN201510015471A CN105574060A CN 105574060 A CN105574060 A CN 105574060A CN 201510015471 A CN201510015471 A CN 201510015471A CN 105574060 A CN105574060 A CN 105574060A
Authority
CN
China
Prior art keywords
data
days
day
degrees
monthly
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
Application number
CN201510015471.4A
Other languages
Chinese (zh)
Inventor
许运红
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing China Sports Juncai Information Technology Co Ltd
Original Assignee
Beijing China Sports Juncai Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing China Sports Juncai Information Technology Co Ltd filed Critical Beijing China Sports Juncai Information Technology Co Ltd
Priority to CN201510015471.4A priority Critical patent/CN105574060A/en
Publication of CN105574060A publication Critical patent/CN105574060A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a lottery statistic data extraction method. Daily statistic data of lottery data are stored in a day data table; a ten-day data table is built; the statistic data of every ten days are stored; a month data table is built; the statistic data of every month are stored; in the month data table, corresponding to the initial position of every month, a pointer pointing to the initial position of a first ten-day data table corresponding to the month in the ten-day data table is built; in the ten-day data table, corresponding to the initial position of everyten days, a pointer pointing to the initial position of the day data table corresponding to every ten days in the day data table is built. The lottery statistic data extraction method comprises following steps of splitting to-be-extracted data according to a month, ten days and a day; determining the month, ten-day and day data tables in which the initial dates of the to-be-extracted data are located, skipping among the tables according to the pointed directions of the pointers; and carrying outstatistics on the extracted month data of the whole month, the ten-day data of the whole tendays and the day data. In application of the method provided bythe invention, the reading time is shortened.

Description

The extracting method of competing color statistics
Technical field
The present invention relates to a kind of extracting method of competing color statistics.
Background technology
For competing color data, its statistics project more, and due to its participate in competing color person numerous, therefore its data volume is very large.
Competing color statistics comprises dimension item and data item.Dimension item is used for representing the classification of data, and wherein, business date, Termination ID, game type etc. belong to dimension item.The data of the statistics that data item is namely corresponding, wherein, sell poll, consumption sum, cancellation poll, cancel the amount of money, prize-winning poll, winning amount, prize poll, the prize amount of money, abandon lottery ticket number, abandon amount of bonus etc. and belong to data item.
Only for the competing color system of physical culture, altogether more than 40,000 station terminals, every station terminal can perform 15 kinds of competing coloured silk game, 600,000 row statisticss of having an appointment every day occur, these huge data all need to gather to server and store, so that the statistics of data and extraction.
When current competing color statistics stores, store successively according to statistics every day, form day degree statistics (day_sales) table, the total of the miscellaneous service data that namely day degree statistics daily occurs, and these data are carried out order arrangement with the date.When a period of time continuous print data need be extracted, be that the mode adopting carry out gathering after statistics the every day of extracting successively in whole date range is extracted.Data after gathering, when extracting, need read required data one by one, because the quantity of documents added up in units of day is a lot, read very slow, cause extraction to calculate slower.
Summary of the invention
In view of this, fundamental purpose of the present invention is the extracting method of the competing color statistics providing a kind of Time Continuous, to shorten the reading time.
The extracting method of competing color statistics provided by the invention, statistics every day of competing color data is stored in day degree tables of data, comprising:
Set up the ten days degrees of data table storage statistics of per ten days, set up a monthly data table and store monthly statistics;
In monthly data table, correspondence is reference position monthly, set up in a sensing ten days degrees of data table to should the moon first ten days degrees of data table reference position pointer; In ten days degrees of data table, the reference position in corresponding per ten days, sets up in a sensing day degree tables of data should the pointer of day degree tables of data reference position in ten days;
Competing color statistics extraction step comprises:
A, the data that will extract to be split with the moon, ten days, day successively;
B, determine from date place monthly of extracted data;
Judge place monthly as non-the whole month degrees of data time, then according to the ten days degrees of data table of this month of pointed in monthly data table;
Determine the ten days degree at from date place, when judging that place ten days, degree was non-whole ten days degrees of data, then according in ten days degrees of data table this in ten days degree this ten days of pointed day degree tables of data in the reference position in this ten days, and by described reference position, retrieve the reference position of the day degree will extracting data;
By described pointed described ten days degrees of data table position, read the ten days degrees of data in whole ten days in initial this month moon determined successively, and by the reference position retrieved in the described day degree tables of data of described pointed, read the day degrees of data worked as in ten days determined successively;
C, determine date of expiry place monthly of extracted data;
The monthly data of the initial moon to the whole month stopped the moon is read successively from monthly data table;
D, when judging date of expiry place monthly of extracted data as non-the whole month degrees of data, then according to the ten days degrees of data table of this month of pointed in monthly data table;
Determine the ten days degree at date of expiry place, judge that place ten days degree is non-whole ten days degrees of data, then according in ten days degrees of data table this in ten days degree this ten days of pointed day degree tables of data in the reference position in this ten days, and by described reference position, retrieve described date of expiry position;
By described pointer jump point to described ten days degrees of data table position, read the ten days degrees of data in whole ten days in this month termination moon determined successively, and by the date of expiry position retrieved in the described day degree tables of data of described pointed, read out the day degrees of data worked as in ten days determined successively;
E, by the monthly data of extracted described the whole month, whole ten days ten days degrees of data and described day degrees of data add up.
Optionally, different tables of data adopts different subregions to store.
By upper, the present invention calculates ten days degree statistics in advance, monthly statistics stores, calculating is added up to use monthly, the ten days degree statistics combination of high polymerization when calculation date section statistics after, make digital independent need not read mass data successively according to day degree tables of data again, reduce accurately in guarantee data simultaneously and read data from disk, reduce calculated amount, decrease the reading time of data, thus improve the search efficiency of competing color statistics.
And, due to monthly, ten days degree, between day degree tables of data by pointer quick position, make under use one table time do not need to carry out full-text search, but directly by needle locating to relevant position, carry out a small amount of retrieval and can navigate to correct ten days degree, on the date, this also greatly reduces operand, decreases the reading time of data, thus improves the search efficiency of competing color statistics.
Further, different monthly, ten days degree, day degree table adopts different subregions to store, only can read the subregion relating to the period during inquiry like this, other subregions can not be read, raising search efficiency.
Accompanying drawing explanation
Fig. 1 is day degree data representation intention;
Fig. 2 be ten days degrees of data represent intention;
Fig. 3 is that monthly data represents intention;
Fig. 4 is that data extract process flow diagram.
Embodiment
The present invention is when carrying out competing color data and storing, except day degree statistics (day_sales) table, shown in Figure 1, also establish ten days degrees of data table (tenday_sales) as shown in Figure 2 and monthly data table as shown in Figure 3 (month_sales), wherein, ten days degree, monthly statistics namely by ten days degree, monthly generation the total of miscellaneous service data.
Wherein, ten days degrees of data table be calculate based on day degree tables of data, ten days degrees of data table dimension and day degree to add up dimension table identical, statistics be within the scope of identical dimensional degree in the middle ten days every day data with.Such as, sold and listed ten days January the 3rd in 2014 degrees of data computing formula for example is following:
tenday _ sales ( 2014 - 01 - 21 ) = Σ n = 2014 - 01 - 21 2014 - 01 - 31 day _ sales ( n )
Wherein, monthly data table be based on day degree or ten days degrees of data table calculate, the dimension of monthly data table is identical with day degree tables of data dimension, statistics be in identical dimensional within the scope of day degree or ten days degree every day data with.Such as, sold and listed in January, 2014 monthly data computing formula for example is following:
month _ sales ( 2014 - 01 ) = Σ n = 2014 - 01 - 01 2014 - 01 - 31 day _ sales ( n )
Moreover, in monthly data table, correspondence is reference position monthly, set up in a sensing ten days degrees of data table to should the moon first ten days degrees of data table reference position pointer, such as give corresponding first ten days degrees of data table initial row.In ten days degrees of data table, the reference position in corresponding per ten days, to set up in a sensing day degree tables of data should the pointer of day degree tables of data reference position in ten days, such as, gives the initial row of corresponding day degree tables of data.By pointer, when being removed access ten days degrees of data table by monthly data table, or when going to access day degree tables of data by ten days degrees of data, so that quick position when reading, remove the retrieval successively of data from and compare.
Corresponding above-mentioned date storage method, the present invention provides a kind of extracting method of data accordingly, with when given arbitrary continuation date section, can fast query gather the competing color statistics of described date section.Its ultimate principle is: by above-mentioned monthly data table, ten days degrees of data table, day degree tables of data can realize the whole month degrees of data that date section can be used to comprise when arbitrary continuation date section extracts data, whole ten days degrees of data, use the whole date section of part day degree Data-parallel language again, then all data are gathered by the dimension such as Termination ID, game total.Wherein, when degrees of data table positions to day degree tables of data to ten days from monthly data table, realize quick position by above-mentioned pointer, and need not search for location with regard to each whole table.
Referring to the process flow diagram shown in Fig. 4, be described with specific embodiment, in this example, to extract 2014-03-08 to 2014-06-02 data instance.
Step 110: the data that extract are split with the moon, ten days, day successively.In this example:
period _ sales ( 2014 - 03 - 08,2014 - 06 - 02 ) = Σ n = 2014 - 03 - 08 2014 - 06 - 02 day _ sales ( n ) = Σ n = 2014 - 03 - 08 2014 - 03 - 10 day _ sales ( n ) + Σ n = 2014 - 03 - 11 2014 - 03 - 20 day _ sales ( n ) + Σ n = 2014 - 03 - 21 2014 - 03 - 31 day _ sales ( n ) + Σ n = 2014 - 04 - 01 2014 - 04 - 30 day _ sales ( n ) + Σ n = 2014 - 05 - 01 2014 - 05 - 31 day _ sales ( n ) + Σ n = 2014 - 06 - 01 2014 - 06 - 02 day _ sales ( n ) = Σ n = 2014 - 03 - 08 2014 - 03 - 10 day _ sales ( n ) + tenday _ sales ( 2014 - 03 - 11 ) + tenday _ sales ( 2014 - 03 - 21 ) + month _ sales ( 2014 - 04 ) + month _ sales ( 2014 - 05 ) + Σ n = 2014 - 06 - 01 2014 - 06 - 02 day _ sales ( n )
Step 220: determine the monthly of from date (i.e. 2014-03-08) place of extracted data, if place is monthly is non-the whole month degrees of data, then according to the ten days degrees of data table of this month of pointed in monthly data table, determine the ten days degree at from date place, in this example be first ten days degree, judge that place ten days degree is non-whole ten days degrees of data, then according in ten days degrees of data table this in ten days degree this ten days of pointed day degree tables of data in the reference position in this ten days, and retrieve described reference position by described reference position.
As seen from the above, in this example, big data quantity retrieval need do not carried out in day degree tables of data, can reference position be navigated to by means of only low volume data retrieval.
In this example, corresponding monthly table month_sales (2014-03), ten days degree table tenday_sales (2014-03-1).
In like manner, determine the correspondence position in monthly, ten days degree at date of expiry (i.e. 2014-06-12) place of extracted data, day degree table, and navigate to the final position in day degree tables of data.
corresponding monthly table month_sales (2014-06), ten days degree table tenday_sales (2014-06-1);
Step 230: read the monthly data of the initial moon to the described the whole month stopped the moon successively from monthly data table, in this example, due to 3, the data in June are non-the whole month data, therefore do not read, and namely read 4, May these two judges that place is the monthly data of the whole month;
The relevant position of described ten days degrees of data table is jumped to by described pointer, read the ten days degrees of data in the whole ten days in this month determined successively, such as, in March 2, whole ten days data in 3 ten days, and jump to the relevant position in described day degree tables of data by described pointer, read the day degrees of data that should read determined worked as in ten days determined successively.
Step 240: extracted data are added up.
By upper, by monthly, ten days degrees of data, greatly reduce data statistics amount.And position fixing process, pointer makes retrieval coupling greatly reduce, and realizes quick position.From above method, during 2014-03-08 to 2014-06-02 data can by 5 day degree statisticss, 2 ten days degree statistics, 2 monthly statisticss, suppose that every bar records 600,000 row data, then extract (5+2+2) * 60=,540 ten thousand row data altogether and gather.And all need 8,6*6,0=5,160 ten thousand row data from day degrees of data extraction and gather.Efficiency improves about 10 times
The present invention calculates ten days degree statistics, monthly statistics in advance, calculating is added up to use monthly, the ten days degree statistics combination of high polymerization when calculation date section statistics after, make digital independent need not read mass data successively according to day degree tables of data again, reduce accurately in guarantee data simultaneously and read data from disk, reduce calculated amount, decrease the reading time of data, thus improve the search efficiency of competing color statistics.
Further, due to the existence of the above-mentioned pointer between tables of data, make to obtain location of next table, full-text search need not be carried out to next table, but directly by needle locating to relevant position, carry out retrieving on a small quantity can navigating on the correct date.Also operand is greatly reduced.
Wherein, above-mentioned different tables of data can adopt different subregions to store.Only can read the subregion relating to the period during such inquiry, other subregions can not be read, improve search efficiency.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, within the spirit and principles in the present invention all, any amendment done, equivalent replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (2)

1. an extracting method for competing color statistics, statistics every day of competing color data is stored in day degree tables of data, it is characterized in that:
Set up the ten days degrees of data table storage statistics of per ten days, set up a monthly data table and store monthly statistics;
In monthly data table, correspondence is reference position monthly, set up in a sensing ten days degrees of data table to should the moon first ten days degrees of data table reference position pointer; In ten days degrees of data table, the reference position in corresponding per ten days, sets up in a sensing day degree tables of data should the pointer of day degree tables of data reference position in ten days;
Competing color statistics extraction step comprises:
A, the data that will extract to be split with the moon, ten days, day successively;
B, determine from date place monthly of extracted data;
Judge place monthly as non-the whole month degrees of data time, then according to the ten days degrees of data table of this month of pointed in monthly data table;
Determine the ten days degree at from date place, when judging that place ten days, degree was non-whole ten days degrees of data, then according in ten days degrees of data table this in ten days degree this ten days of pointed day degree tables of data in the reference position in this ten days, and by described reference position, retrieve the reference position of the day degree will extracting data;
By described pointed described ten days degrees of data table position, read the ten days degrees of data in whole ten days in initial this month moon determined successively, and by the reference position retrieved in the described day degree tables of data of described pointed, read the day degrees of data worked as in ten days determined successively;
C, determine date of expiry place monthly of extracted data;
The monthly data of the initial moon to the whole month stopped the moon is read successively from monthly data table;
D, when judging date of expiry place monthly of extracted data as non-the whole month degrees of data, then according to the ten days degrees of data table of this month of pointed in monthly data table;
Determine the ten days degree at date of expiry place, judge that place ten days degree is non-whole ten days degrees of data, then according in ten days degrees of data table this in ten days degree this ten days of pointed day degree tables of data in the reference position in this ten days, and by described reference position, retrieve described date of expiry position;
By described pointer jump point to described ten days degrees of data table position, read the ten days degrees of data in whole ten days in this month termination moon determined successively, and by the date of expiry position retrieved in the described day degree tables of data of described pointed, read out the day degrees of data worked as in ten days determined successively;
E, by the monthly data of extracted described the whole month, whole ten days ten days degrees of data and described day degrees of data add up.
2. method according to claim 1, is characterized in that, different tables of data adopts different subregions to store.
CN201510015471.4A 2015-01-13 2015-01-13 Lottery statistic data extraction method Pending CN105574060A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510015471.4A CN105574060A (en) 2015-01-13 2015-01-13 Lottery statistic data extraction method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510015471.4A CN105574060A (en) 2015-01-13 2015-01-13 Lottery statistic data extraction method

Publications (1)

Publication Number Publication Date
CN105574060A true CN105574060A (en) 2016-05-11

Family

ID=55884197

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510015471.4A Pending CN105574060A (en) 2015-01-13 2015-01-13 Lottery statistic data extraction method

Country Status (1)

Country Link
CN (1) CN105574060A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111367985A (en) * 2020-03-12 2020-07-03 红云红河烟草(集团)有限责任公司 Online single file system of wrapping machine group
CN113112158A (en) * 2021-04-13 2021-07-13 青岛海尔科技有限公司 Method and device for processing equipment use data, storage medium and electronic device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1783077A (en) * 2004-10-14 2006-06-07 国际商业机器公司 Methods and apparatus for processing a database query
US20090112853A1 (en) * 2007-10-29 2009-04-30 Hitachi, Ltd. Ranking query processing method for stream data and stream data processing system having ranking query processing mechanism
CN103605664A (en) * 2013-10-22 2014-02-26 芜湖大学科技园发展有限公司 Massive dynamic data fast query method meeting different time granularity requirements
US20140074853A1 (en) * 2011-02-21 2014-03-13 Amadeus S.A.S. Method and system for providing statistical from a data warehouse

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1783077A (en) * 2004-10-14 2006-06-07 国际商业机器公司 Methods and apparatus for processing a database query
US20090112853A1 (en) * 2007-10-29 2009-04-30 Hitachi, Ltd. Ranking query processing method for stream data and stream data processing system having ranking query processing mechanism
US20140074853A1 (en) * 2011-02-21 2014-03-13 Amadeus S.A.S. Method and system for providing statistical from a data warehouse
CN103605664A (en) * 2013-10-22 2014-02-26 芜湖大学科技园发展有限公司 Massive dynamic data fast query method meeting different time granularity requirements

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111367985A (en) * 2020-03-12 2020-07-03 红云红河烟草(集团)有限责任公司 Online single file system of wrapping machine group
CN113112158A (en) * 2021-04-13 2021-07-13 青岛海尔科技有限公司 Method and device for processing equipment use data, storage medium and electronic device

Similar Documents

Publication Publication Date Title
McGrew Jr et al. An introduction to statistical problem solving in geography
CN102929901B (en) The method and apparatus improving data warehouse performance
Hellman et al. Effects of the sampling design and selection of parameter values on pollen-based quantitative reconstructions of regional vegetation: a case study in southern Sweden using the REVEALS model
CN101355457B (en) Test method and test equipment
CN102089759A (en) A method of generating an analytical data set for input into an analytical model
CN103838787B (en) A kind of method and apparatus being updated to Distributed Data Warehouse
EP3456360A1 (en) Device and method for tuning relational database
CN107657048A (en) user identification method and device
CN110288350A (en) User's Value Prediction Methods, device, equipment and storage medium
CN106326242A (en) Application pushing method and apparatus
Struwe et al. Spatial evolutionary and ecological vicariance analysis (SEEVA), a novel approach to biogeography and speciation research, with an example from Brazilian Gentianaceae
CN103562905A (en) Improved data visualization configuration system and method
Schmidt‐Lebuhn et al. Distorted perception of the spatial distribution of plant diversity through uneven collecting efforts: the example of Asteraceae in Australia
CN102968813A (en) Surface sampling method of triangular patch mesh model
CN101341506A (en) Method of technology valuation
CN105574060A (en) Lottery statistic data extraction method
Liu et al. Towards the conservation of the Mesozoic relict fern Christensenia: a fern species with extremely small populations in China
CN101620706A (en) Data mining and modeling method for incremental sales
CN107844874A (en) Enterprise operation problem analysis system and its method
CN110389963A (en) The recognition methods of channel effect, device, equipment and storage medium based on big data
CN110135851A (en) A kind of transaction backing method and relevant device based on data processing
CN109901796A (en) Sequencing selection method, apparatus, peripheral storage device and storage medium based on external memory
CN107402925A (en) Information-pushing method and device
CN108763258A (en) Document subject matter parameter extracting method, Products Show method, equipment and storage medium
CN107066602A (en) A kind of news information method for pushing and system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20160511

RJ01 Rejection of invention patent application after publication